SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Incorrect Syntax near ENABLE -
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

R00t
Starting Member

4 Posts

Posted - 06/26/2013 :  16:25:20  Show Profile  Reply with Quote
Hi everyone,

I'm trying to run this on sql server. do you know what could be causing the following error:

Msg 102, Level 15, State 1, Line 2
Incorrect syntax near 'ENABLE'.


CREATE TABLE "TEST_INDEX_WEIGHTINGS" (
"INSTR_ID" NUMBER DEFAULT -1 NOT NULL ENABLE,
"INDEX_ID" NUMBER DEFAULT -1 NOT NULL ENABLE,
"IDXW_DATE" DATE NOT NULL ENABLE,
"IDXW_INSTR_WEIGHT" FLOAT(126) NOT NULL ENABLE,
"IDXW_CE" FLOAT(126),
"IDXW_SPLIT_CE" FLOAT(126),
"IDXW_GROSS_CE" FLOAT(126),
"IDXW_INST_QUOTE_DATE" DATE,
"IDXW_PRICE" FLOAT(126),
"IDXW_ACCRUED_INTEREST" FLOAT(126),
"IDXW_FX_RATE" FLOAT(126),
"IDXW_RETURN" FLOAT(126),
"IDXW_BASE_RETURN" FLOAT(126),
"IDXW_RETURN_BEGIN_DATE" DATE,
"IDXW_MARKET_CAP" FLOAT(126),
"IDXW_MARKET_CAP_INSTR_CUR" FLOAT(126),
"IDXW_FLOATING_CAP" FLOAT(126),
"IDXW_YIELD_VALUE" FLOAT(126),
"IDXW_DURATION" FLOAT(126),
"IDXW_MODIF_DURATION" FLOAT(126),
"IDXW_MATURITY" FLOAT(126),
"IDXW_CONVEXITY" FLOAT(126),
"IDXW_DELTA" FLOAT(126),
"IDXW_CAPI_INCLUSION_FACTOR" FLOAT(126),
"IDXW_SHARE_NUM" FLOAT(126),
"IDXW_FIF" FLOAT(126),
"REC_CREATION_DATE" TIMESTAMP (6) DEFAULT SYSDATE,
"REC_MODIF_DATE" TIMESTAMP (6) DEFAULT SYSDATE,
"PAYDOWN_RETURN" FLOAT(126),
"IDXW_INSTR_REPORT_WEIGHT" FLOAT(126),
CONSTRAINT "PK_TEST_INDEX_WEIGHTINGS" PRIMARY KEY ("INSTR_ID", "INDEX_ID", "IDXW_DATE")
)

Lamprey
Flowing Fount of Yak Knowledge

4614 Posts

Posted - 06/26/2013 :  17:21:18  Show Profile  Reply with Quote
There are so many issues with what you posted I'm not sure where to start. What are you tryign to do or how did you generate that "code?"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 06/27/2013 :  00:50:02  Show Profile  Reply with Quote
This is not t-sql. Are you sure your RDBMS is SQL Server?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

R00t
Starting Member

4 Posts

Posted - 06/27/2013 :  12:34:17  Show Profile  Reply with Quote

I was just told that this is for Oracle - I guess I need to convert that to MS SQL - Anyone can guide me?
Thanks in advance.

Rudy,
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 06/27/2013 :  12:56:28  Show Profile  Reply with Quote

CREATE TABLE "TEST_INDEX_WEIGHTINGS" (
"INSTR_ID" INT NOT NULL DEFAULT -1,
"INDEX_ID" INT NOT NULL DEFAULT -1 NOT NULL,
"IDXW_DATE" DATETIME NOT NULL,
"IDXW_INSTR_WEIGHT" FLOAT NOT NULL,
"IDXW_CE" FLOAT,
"IDXW_SPLIT_CE" FLOAT,
"IDXW_GROSS_CE" FLOAT,
"IDXW_INST_QUOTE_DATE" DATETIME,
"IDXW_PRICE" FLOAT,
"IDXW_ACCRUED_INTEREST" FLOAT,
"IDXW_FX_RATE" FLOAT,
"IDXW_RETURN" FLOAT,
"IDXW_BASE_RETURN" FLOAT,
"IDXW_RETURN_BEGIN_DATE" DATETIME,
"IDXW_MARKET_CAP" FLOAT,
"IDXW_MARKET_CAP_INSTR_CUR" FLOAT,
"IDXW_FLOATING_CAP" FLOAT,
"IDXW_YIELD_VALUE" FLOAT,
"IDXW_DURATION" FLOAT,
"IDXW_MODIF_DURATION" FLOAT,
"IDXW_MATURITY" FLOAT,
"IDXW_CONVEXITY" FLOAT,
"IDXW_DELTA" FLOAT,
"IDXW_CAPI_INCLUSION_FACTOR" FLOAT,
"IDXW_SHARE_NUM" FLOAT,
"IDXW_FIF" FLOAT,
"REC_CREATION_DATE" DATETIME DEFAULT GETDATE(),
"REC_MODIF_DATE" DATETIME DEFAULT GETDATE(),
"PAYDOWN_RETURN" FLOAT,
"IDXW_INSTR_REPORT_WEIGHT" FLOAT,
CONSTRAINT "PK_TEST_INDEX_WEIGHTINGS" PRIMARY KEY ("INSTR_ID", "INDEX_ID", "IDXW_DATE")
)
GO


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

R00t
Starting Member

4 Posts

Posted - 06/27/2013 :  16:20:08  Show Profile  Reply with Quote
Thanks visakh16.

I am getting error: "Multiple NULL constraints were specified for column 'INDEX_ID', table 'TEST_INDEX_WEIGHTINGS'

Go to Top of Page

R00t
Starting Member

4 Posts

Posted - 06/27/2013 :  17:06:47  Show Profile  Reply with Quote

Got it.
I removed the NOT NULL from "INDEX_ID" INT NOT NULL DEFAULT -1 NOT NULL."

Thanks again.

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 06/28/2013 :  00:46:41  Show Profile  Reply with Quote
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000