locked
Copy DB, DB-Tables, SPs, Triggers, Views RRS feed

  • Question

  • Hi,

    I want to copy only the table structures from Test environment to Prod environment, not data.

    We have triggers on some tables, few SPs & Views. I tried 'Generate Script' option but its not having the feature to Copy SP & View queries.

    Do anyone know if we can get a solution for the above ?

    Thanks !


    --------------------------- Radhai Krish | Golden Age is no more far | --------------------------

    Monday, April 1, 2013 6:08 AM

Answers

All replies

  • If you dio this frequently there is great tool from www.red-gate.com named SQL Compare. There is  builtin function as well

    From Management Studio Right-click on your database. Tasks -> Generate Scripts.


    Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/

    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Blog: Large scale of database and data cleansing
    Remote DBA Services: Improves MS SQL Database Performance

    • Marked as answer by Radhai Monday, April 1, 2013 8:13 AM
    Monday, April 1, 2013 6:30 AM
  • If you dio this frequently there is great tool from www.red-gate.com named SQL Compare. There is  builtin function as well

    From Management Studio Right-click on your database. Tasks -> Generate Scripts.


    Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/

    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Blog: Large scale of database and data cleansing
    Remote DBA Services: Improves MS SQL Database Performance

    Yes i tried that 'Generate Scripts'. But that is not having feature to select SPs, only so thought to ask help here..

    i wont need any tool for that is a single time migration.

    Please let me know if we have any options in SQL interface itself..

    Thanks !


    --------------------------- Radhai Krish | Golden Age is no more far | --------------------------

    Monday, April 1, 2013 7:10 AM
  • I'm not sure why you think that the Generate Scripts wizard does not have option to select Stored Procedures.

    Right click the database > Tasks > Generate Scripts ...

    The second screen of the wizard has this option.


    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers.
    Thanks!
    Aalam | Blog (http://aalamrangi.wordpress.com)

    • Marked as answer by Radhai Monday, April 1, 2013 8:13 AM
    Monday, April 1, 2013 7:34 AM
  • Thank you both...actually i was trying with the dummy DB which has got NO SPs, views , etc ..so i didn't get these options while i go on 'Generate Script'.

    Thank you Aalam  very much for your screen shot..which really helped me to think other way !! THanks !


    --------------------------- Radhai Krish | Golden Age is no more far | --------------------------

    Monday, April 1, 2013 8:15 AM