Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Access verses SQL Server [modified]

Access verses SQL Server [modified]

Scheduled Pinned Locked Moved Visual Basic
databasehelpsql-serversysadminquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Werries
    wrote on last edited by
    #1

    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!

    D P 2 Replies Last reply
    0
    • W Werries

      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!

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • W Werries

        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!

        P Offline
        P Offline
        Polymorpher
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups