Sunday, March 25, 2012

CREATE TABLE and CONSTRAINTS

well very new to sql,as I am...
I am posting this query,please explain me what it is,

Code: ( text )

  1. CREATE TABLE [dbo].[DOORD_ORDER] (

  2. [ORDER_NBR] [int] NOT NULL ,

  3. [TOTAL_SEQ_NBR] [int] NOT NULL ,

  4. [DELIVERY_IND] [char] (1) NOT NULL ,

  5. [CONTACT_LST_NME] [varchar] (30) NOT NULL ,

  6. [CONTACT_FRST_NME] [varchar] (40) NOT NULL ,

  7. [CONTACT_TYP] [varchar] (30) NOT NULL ,

  8. [CONTACT_TXT] [varchar] (100) NOT NULL ,

  9. [OR_CDE] [char] (1) NOT NULL ,

  10. [DROPOFF_DTE] [datetime] NOT NULL ,

  11. [PICKUP_DTE] [datetime] NOT NULL ,

  12. [LST_OPR_ID] [char] (8) NOT NULL ,

  13. [LST_MNT_TSMP] [datetime] NOT NULL ,

  14. [WAIT_INSTORE_IND] [char] (1) NOT NULL

  15. ) ON [PRIMARY]

  16. GO

  17. ALTER TABLE [dbo].[DOORD_ORDER] WITH NOCHECK ADD

  18. CONSTRAINT [PK_DOORD] PRIMARY KEY CLUSTERED

  19. (

  20. [ORDER_NBR]

  21. ) WITH FILLFACTOR = 90 ON [PRIMARY]

  22. GO

Hirak

This query creates a new table called [dbo].[DOORD_ORDER] and then adds a constraint to the table in this case designates the primary key [ORDER_NBR].

Mary|||well mary,is this oracle?

we didnt do like this in oracle,right?
please tell me what type of db query is this
hirak

Quote:

Originally Posted by mmccarthy

Hirak

This query creates a new table called [dbo].[DOORD_ORDER] and then adds a constraint to the table in this case designates the primary key [ORDER_NBR].

Mary

|||

Quote:

Originally Posted by hirak1984

well mary,is this oracle?

we didnt do like this in oracle,right?
please tell me what type of db query is this
hirak


Actually it does look like Oracle to me. It's been a while since I've used it though so I could be wrong. It could also be SQL Server. Sorry Hirak I haven't used either in a few years and they all just blend together now.

Mary|||you need not be sorry mary because you are right.

this is a sqlserver query I found out now.
I am sorry to post it in oracle forum,because then I didnt have an idea,what it was.
I dont have necessary privileges,please transfer it to the sqlserver forum

Quote:

Originally Posted by mmccarthy

Actually it does look like Oracle to me. It's been a while since I've used it though so I could be wrong. It could also be SQL Server. Sorry Hirak I haven't used either in a few years and they all just blend together now.

Mary

No comments:

Post a Comment