I'm confused the SQL Server was 2005 or 2014
Very different version numbers, but both have one thing in common: Out-of-support!
There is no syntax failure in your SQL, there must be something else in your Query Window.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
select name, EDI_code, perdose, perday, howlongday, count(*) AS frequencies from prescriptions_pharmacy group by name, EDI_code, perdose, perday, howlongday
When I execute above query in Server Management Studio Express, Incorrect syntax near '' error is shown. between '', there is nothing.
I'm confused the SQL Server was 2005 or 2014. At this time, I have to use SQL2005 Server.
Please kindly advise me.
Thank you !
Edited-
2 Screenshots are attached, And the Korean language '' 근처의 구문이 잘못되었습니다 is incorrect syntax near ''
According to my records, this query succeeded in March, 2023 for the last time.
The Sql Server Management Studio Express version was 2005, and I change it to 2014 but as you might expect well, change the version of Management Studio didn't solve the problem.
In case of normal situation, normal syntax, of course I try my best to find the answer on my own, but for this case, it seems really strange and so I ask here.
I'm confused the SQL Server was 2005 or 2014
Very different version numbers, but both have one thing in common: Out-of-support!
There is no syntax failure in your SQL, there must be something else in your Query Window.
Hi @Kay_Lee
It seems to me that there is no syntax error.
Try to select the whole query with the mouse and then click the Execute button.
Or open another query widow and try again?
Best regards,
Cosmog
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
The reason is like to be due to that one of the spaces in the string is a hard space, Unicode character 160. Up to SQL 2008, SQL Server did not recognise the hard space as a white-space character, and would yield a syntax error if it encountered one.
Try deleting all spaces and re-inserting them.
I think this is some bug(?) of SQL Server 2005 (20 years old..)
I tried a basic way like 'select xxx from table' (the minimum structure) and it worked fine.
And I added the rest branches like where, group by, having and it also worked.