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. C#
  4. Generate SQL Script of databases with data through an exe

Generate SQL Script of databases with data through an exe

Scheduled Pinned Locked Moved C#
databasesysadmintools
4 Posts 4 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.
  • H Offline
    H Offline
    honeyashu
    wrote on last edited by
    #1

    Hi, I have to develop an exe module to generates a script text file for all the databases exist on a server(in my case SQL Server2008) with all its objects, data, triggers,etc.. I know this can be achieved by Generate Scrip for Task menu in SQL Server2008 but this is manual & needed to work for each database with explicitly defining its properties selection, thus making it long hours task. Any sample project would be appreciated Regards Ashish

    L P H 3 Replies Last reply
    0
    • H honeyashu

      Hi, I have to develop an exe module to generates a script text file for all the databases exist on a server(in my case SQL Server2008) with all its objects, data, triggers,etc.. I know this can be achieved by Generate Scrip for Task menu in SQL Server2008 but this is manual & needed to work for each database with explicitly defining its properties selection, thus making it long hours task. Any sample project would be appreciated Regards Ashish

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Following link might be useful to you. http://stackoverflow.com/questions/1695738/programmatically-generate-script-for-all-objects-in-a-database Hope this help!

      Peace ON In Simple Sense... Start Shining Stories We Live...

      1 Reply Last reply
      0
      • H honeyashu

        Hi, I have to develop an exe module to generates a script text file for all the databases exist on a server(in my case SQL Server2008) with all its objects, data, triggers,etc.. I know this can be achieved by Generate Scrip for Task menu in SQL Server2008 but this is manual & needed to work for each database with explicitly defining its properties selection, thus making it long hours task. Any sample project would be appreciated Regards Ashish

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

        There's this: Library for scripting SQL Server database objects with examples[^] Also SqlPubWiz, which is what I use.

        1 Reply Last reply
        0
        • H honeyashu

          Hi, I have to develop an exe module to generates a script text file for all the databases exist on a server(in my case SQL Server2008) with all its objects, data, triggers,etc.. I know this can be achieved by Generate Scrip for Task menu in SQL Server2008 but this is manual & needed to work for each database with explicitly defining its properties selection, thus making it long hours task. Any sample project would be appreciated Regards Ashish

          H Offline
          H Offline
          Henry Minute
          wrote on last edited by
          #4

          The previous replies should enable you to complete your task but in case you are still having problems, try these: Scripting database objects using SMO[^], Generate scripts for database objects with SMO for SQL Server[^] or Using PowerShell and SMO to script SQL Server database objects[^] if you feel adventurous/like PowerShell. These were all from the first page of a google search on script database objects with smo

          Henry Minute Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” I wouldn't let CG touch my Abacus! When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is. Cogito ergo thumb - Sucking my thumb helps me to think.

          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