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. Script/tool to update schema of my database when the latest_schema script is provided

Script/tool to update schema of my database when the latest_schema script is provided

Scheduled Pinned Locked Moved Database
databasetoolssql-servervisual-studiosysadmin
1 Posts 1 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.
  • P Offline
    P Offline
    PrashantJ
    wrote on last edited by
    #1

    Hi All, I want to write a script/tool which would update the schema of the existing database (in SQL Server 2005) i.e Add/drop a table, column, constraint etc. on a ongoing basis. The input to my tool would be the latest_schema script which creates the database with all the latest tables, columns, constraints etc. So the tool that I am going to write should perform a schema-diff with my db Vs the script provided and add/drop the tables, cols, constraints on my database. I have a couple of solutions in my mind but feel that they are not very efficient. 1. Create a new database running the provided script, write a stored procedure to loop thro all the tables to figure out the diff between the existing db and the current db and update the current db: Problem here is my current db has data and lots of constraints, which might pose a problem. 2. Use some third party tools to generate the sync script and execute it against my current db but I am not sure about the free tools available out there. Can somebody please provide me some guidelines/tips on how to go ahead about this. Thanks in advance. PJ

    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