Click here to Skip to main content
15,883,606 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)

I m trying to execute the following statement

Select Max(ImageID) From DA-SMART.dbo.DAScannedImages

it gives me error

Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near -

While the following statement works fine

Select au_id From pubs.dbo.authors

is there a limitation that database names cannot include '-'. I m doing it on sqlserver 2000.
__TR__ 14-Nov-12 2:49am    
Select Max(ImageID) From [DA-SMART].dbo.DAScannedImages
Herman<T>.Instance 15-Nov-12 9:16am    
i'll count is as an answer
Zafar248 14-Nov-12 3:37am    
Thanks TR, cant believe that i missed such a simple thing.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900