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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Issue with Identity function
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

atlachar123456
Starting Member

USA
33 Posts

Posted - 11/23/2011 :  11:53:05  Show Profile  Reply with Quote
I had created a temp table with id column as identity,its giving error as incorrect syntax near '('
CREATE TABLE #temp --11182011_2
(
posid INT IDENTITY(1,1) NULL,
position SMALLINT NULL,
superId INT NULL
)
can anyone tell me where is teh error..

atlaaaaaaaa

tkizer
Almighty SQL Goddess

USA
37296 Posts

Posted - 11/23/2011 :  12:16:04  Show Profile  Visit tkizer's Homepage  Reply with Quote
I can't reproduce your error, but you'll need to use NOT NULL for posid. I've only got SQL 2005 and 2008 to test with, both error about the NULL on posid and work fine with NOT NULL on posid. I do not get an incorrect syntax on either.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

nigelrivett
Flowing Fount of Yak Knowledge

United Kingdom
3383 Posts

Posted - 11/23/2011 :  12:43:08  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
Are you sure you're executing the whole statement - and only the whole statement?
I suspect the error is not coming from this.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

atlachar123456
Starting Member

USA
33 Posts

Posted - 11/23/2011 :  14:04:00  Show Profile  Reply with Quote
I am not executing only this statemnet,its just a part in my procedure
when i am executing the entire procedure for me its getting error on this line number incorrect syntax near '('

atlaaaaaaaa
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
37296 Posts

Posted - 11/23/2011 :  16:03:56  Show Profile  Visit tkizer's Homepage  Reply with Quote
You'll need to post the whole thing then.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Kristen
Test

United Kingdom
22431 Posts

Posted - 11/24/2011 :  03:00:47  Show Profile  Reply with Quote
Long shot: Make sure that any existing #TEMP is dropped before you create the Sproc (to prevent delayed name resolution fouling up by virtue of #TEMP actually being present)

But I don't think that would give you "Syntax Error"
Go to Top of Page

nigelrivett
Flowing Fount of Yak Knowledge

United Kingdom
3383 Posts

Posted - 11/24/2011 :  06:12:54  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
Maybe a missing "end" for a conditional?

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
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.09 seconds. Powered By: Snitz Forums 2000