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. Database & SysAdmin
  3. Database
  4. Generating SQL Table and Insert statements

Generating SQL Table and Insert statements

Scheduled Pinned Locked Moved Database
databasequestionsql-serversysadminhosting
3 Posts 2 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.
  • B Offline
    B Offline
    Brendan Vogt
    wrote on last edited by
    #1

    Hi, I am working with SQL Server 2005. I have a created a database on my local machine, and would like to upload it to my hosting company. In the past the incrementing fields loose their IDENTITY so I had to go and manually set this property to be incremented by 1 each a new record is added. So what I was thinking, maybe it is better if I just generated the SQL script of the tables, and run the script on the database online?? But then all of my records and data on the local machine isn't added into this script that generates the tables. How do I create INSERT statements that will take my current data and add it to the SQL Server at the hosting company. This is the only way of doing it, is there maybe other ways?? Regards ma se

    Z 1 Reply Last reply
    0
    • B Brendan Vogt

      Hi, I am working with SQL Server 2005. I have a created a database on my local machine, and would like to upload it to my hosting company. In the past the incrementing fields loose their IDENTITY so I had to go and manually set this property to be incremented by 1 each a new record is added. So what I was thinking, maybe it is better if I just generated the SQL script of the tables, and run the script on the database online?? But then all of my records and data on the local machine isn't added into this script that generates the tables. How do I create INSERT statements that will take my current data and add it to the SQL Server at the hosting company. This is the only way of doing it, is there maybe other ways?? Regards ma se

      Z Offline
      Z Offline
      zhengdong jin
      wrote on last edited by
      #2

      SET IDENTITY_INSERT table on insert select SET IDENTITY_INSERT table off

      B 1 Reply Last reply
      0
      • Z zhengdong jin

        SET IDENTITY_INSERT table on insert select SET IDENTITY_INSERT table off

        B Offline
        B Offline
        Brendan Vogt
        wrote on last edited by
        #3

        Hi, I have no idea what you are trying to say here. I have a database on my local machine and I want to generate a script file that creates the tables and inserts the current values to the new database as well. I hope you understand. Regards, ma se

        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