Sign In
Posted By: dazzledesign | Jan 2nd @ 5:03 AM
page 1 of 1
Comments: 6 | Views: 941
Hi,
I am trying to execute following T-SQL query in SQL 2005 Express, but it throws an error 'Incorrect Syntax near GO'

Can anyone please tell why?

SELECT     *
FROM         Integers;
GO

Thanks
Cupiditas
Cupiditas
Chris Hawkins
Why do you have a semi-colon? Remove it and I'm sure you'll find that query runs fine.
Cupiditas
Cupiditas
Chris Hawkins
Well, for that matter, it'll work without the 'Go', as well.
SQL 2005 does recoginize the go command. I use it all the time.

If you look at the Error I think it was throwing a fit with the Semicolon. Oracle I know uses Semi-colons after their statements

I tried a query similar to yours on my Database and it worked fine. Although I was using a SQL 2005 available through Dreamspark.
Cupiditas
Cupiditas
Chris Hawkins

It does recognise Go command, but it's not necessary when you're executing a single select query like that, and if there's an error the first thing you should do is strip extraneous commands from your statement.

I'm with Griffin, the semi-colon must be the problem, and if you think removing it didn't solve anything then I really have no idea.

page 1 of 1
Comments: 6 | Views: 941
Microsoft Communities