Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 IF Exists

Author  Topic 

Kurmanc
Yak Posting Veteran

92 Posts

Posted - 2007-12-21 : 12:22:57
I do not manage to get this fixed:

IF exists
(SELECT 1
FROM tTableX WITH (READCOMMITTED)
WHERE id in
(
111,
222,
333
)
)
... More code...

I get this error message:
Incorrect syntax near ')'.

Any ideas?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2007-12-21 : 12:33:54
I cant find any syntactical error in this construct.can you give stub of rest of code please?
Go to Top of Page

Kurmanc
Yak Posting Veteran

92 Posts

Posted - 2007-12-21 : 12:40:26
I found the problem...

I had more than 100 id's. My nvarchar was only declared to 500 --> nvarchar(500). So I didn't catch all 100 id's in my "where in (...)"

Thanks anyway.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2007-12-21 : 12:43:32
Cool.Please feel free to come back if you face any more probs.cheers.
Go to Top of Page
   

- Advertisement -