By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,825 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

Im hungry, tired and in need of some MS SQL help

P: 2
Hello everyone,

I'm creating a database in access but using SQL... its for my course at uni. I want to set a boolean value: Yes/No. but i don't know how to do this, table i want -

CREATE TABLE CASE(
CASE_ID NUMERIC NOT NULL PRIMARY KEY,
CASE_NAME CHAR (255),
CASE_DESCRIPTION CHAR (1024),
CASE_TYPE_ID CHAR (8), /*(FK)*/
CASE_STATUS (YES/NO), <---- here i want it to be either 'OPEN' or 'CLOSED' instead of 'YES or 'NO' is this possible? but would also like how to do a yes and no, lol
CLIENT_ID NUMERIC, /*(FK)*/
INV_OFF_ID NUMERIC, /*(FK)*/
FEE_ID NUMERIC, /*(FK)*/

Cheers
Dan
May 7 '07 #1
Share this Question
Share on Google+
1 Reply


JConsulting
Expert 100+
P: 603
here's a blurb straight out of Northwind database. Notice the case for IsDiscontinued. Hope this helps.
J

Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE Products (
  2.       ProductID int IDENTITY(1, 1) NOT NULL,
  3.       ProductName nvarchar(40) NOT NULL,
  4.       SupplierID int NULL,
  5.       CategoryID int NULL,
  6.       QuantityPerUnit nvarchar(20) NULL,
  7.       UnitPrice money NULL,
  8.       UnitsInStock smallint NULL,
  9.       UnitsOnOrder smallint NULL,
  10.       ReorderLevel smallint NULL,
  11.       Discontinued bit NOT NULL,
  12.       IsDiscontinued AS (case Discontinued when 1 then 'Yes' when 0 then 'No' end)
  13. )
May 7 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.