Access verses SQL Server [modified]
-
Hi there, I'm trying to execute a SQL command that works perfect with an Access DB, but it gives me an 'Incorrect syntax near the keyword 'COLUMN'' error if I use it on a SQL Server Database. Why is that? Here is my code: ALTER TABLE Staff ADD COLUMN [MaxDisc] single SQL Server does not support 'single' as a data type and I’ve changed it to the following: ALTER TABLE Staff ADD COLUMN [MaxDisc] real Any help would be appreciated. Regards, Werries -- modified at 10:03 Tuesday 15th May, 2007
A programmer's life is good... or is it?? Ek dink nie so nie!
-
Hi there, I'm trying to execute a SQL command that works perfect with an Access DB, but it gives me an 'Incorrect syntax near the keyword 'COLUMN'' error if I use it on a SQL Server Database. Why is that? Here is my code: ALTER TABLE Staff ADD COLUMN [MaxDisc] single SQL Server does not support 'single' as a data type and I’ve changed it to the following: ALTER TABLE Staff ADD COLUMN [MaxDisc] real Any help would be appreciated. Regards, Werries -- modified at 10:03 Tuesday 15th May, 2007
A programmer's life is good... or is it?? Ek dink nie so nie!
Easy. You've already found out that TSQL and Access's version of it are not the same. Access only supports a subset of TSQL and adds it's own "flavor" to some of what would be considered normal for other implementations of SQL. If you wanted to support different database engines, you'd have to implement different data layers in your application to support them. For instance, SQL Server supports batch queries, where Access does not. You'd have to implement the missing functionality in your own code instead of relying on the database engine to do it for you.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Hi there, I'm trying to execute a SQL command that works perfect with an Access DB, but it gives me an 'Incorrect syntax near the keyword 'COLUMN'' error if I use it on a SQL Server Database. Why is that? Here is my code: ALTER TABLE Staff ADD COLUMN [MaxDisc] single SQL Server does not support 'single' as a data type and I’ve changed it to the following: ALTER TABLE Staff ADD COLUMN [MaxDisc] real Any help would be appreciated. Regards, Werries -- modified at 10:03 Tuesday 15th May, 2007
A programmer's life is good... or is it?? Ek dink nie so nie!
ALTER TABLE dbo.Staff ADD MaxDisk real NULL
Apparently it's not OK to start a bonfire of Microsoft products in the aisles of CompUSA even though the Linuxrulz web site says so