Create script in access?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #1

    Create script in access?

    Is there a way to make Access show me the SQL statement necessary to create a table that I have already defined?
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32669

    #2
    I don't believe Access has this feature whereby it will automatically create the SQL to reproduce an object. I know it's done in SQL Server but as far as I'm aware, it's not available in Access.

    Comment

    • MMcCarthy
      Recognized Expert MVP
      • Aug 2006
      • 14387

      #3
      Originally posted by RedSon
      Is there a way to make Access show me the SQL statement necessary to create a table that I have already defined?
      You can't get the SQL from the table. However, you can use the documenter feature to analyse the table structure. You could also recreate the table using the make table query feature. However, the SQL will not be standard SQL.

      One other option is to Upsize the table to MS SQL. This should reproduce most of the required SQL.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32669

        #4
        Originally posted by mmccarthy
        ...
        One other option is to Upsize the table to MS SQL. This should reproduce most of the required SQL.
        That's a neat idea Mary. I didn't think of that :)

        Comment

        • RedSon
          Recognized Expert Expert
          • Jan 2007
          • 4980

          #5
          Originally posted by mmccarthy
          You can't get the SQL from the table. However, you can use the documenter feature to analyse the table structure. You could also recreate the table using the make table query feature. However, the SQL will not be standard SQL.

          One other option is to Upsize the table to MS SQL. This should reproduce most of the required SQL.
          Fortunately it seems the SQL Sever Mobile is based on the Access engine. The automated Access scripts work better then common SQL queries.

          Comment

          • MMcCarthy
            Recognized Expert MVP
            • Aug 2006
            • 14387

            #6
            Originally posted by RedSon
            Fortunately it seems the SQL Sever Mobile is based on the Access engine. The automated Access scripts work better then common SQL queries.
            I think that's very funny :D

            Might not be the same for the CREATE TABLE query though. As Access uses a completely different syntax.

            Comment

            • RedSon
              Recognized Expert Expert
              • Jan 2007
              • 4980

              #7
              Originally posted by mmccarthy
              I think that's very funny :D

              Might not be the same for the CREATE TABLE query though. As Access uses a completely different syntax.
              Hmm, mabye its a mish-mosh of both. I know for sure that using valid SQL join syntax in SQL Server might not work in SQL Mobile. The SQL join scripts that Access produces works flawlessly every time.

              Comment

              • jaxjagfan
                Recognized Expert Contributor
                • Dec 2007
                • 254

                #8
                Access uses "Select Into" method for creating new tables. So as the others have stated no luck there.

                You can use DTS to import from Access to SQL Server to create a table. DTS has some fairly decent GUI tools for this. There may be some posts within our SQL Server forum on the specifics.

                Also try 3rd party tools like "TOAD".

                Comment

                Working...