locked
generate table script of sql azure RRS feed

  • Question

  • Is there anyway that I can generate the create table(s) script off the tables on sql azure.  I accidently delete my scripts and now need to create them over if I cannot generate scripts for these tables.  Thanks for your help.
    • Moved by edhickey Friday, July 30, 2010 11:14 PM (From:.NET 3.0/3.5 Windows Workflow Foundation)
    • Moved by Brian AurichMicrosoft employee Wednesday, September 29, 2010 6:45 AM migration (From:SQL Azure - Archive)
    Friday, July 30, 2010 7:03 PM

Answers

  • Right click table in Object explorer with your SQL Azure database open
    Choose Script Table as from the drop-down menu.
    You have three options,
    Choose Create To |File or Clipboard or New Query window

    mysorian
    Saturday, July 31, 2010 12:58 PM
  • Hello Chad,

    The script generation for SQL Azure only works in SQL Server Management Studio 2008 R2. And it works. However tou have to choose "Generate Scripts..." (right clickong on the Database, not the table) but not "Script table as" (by right clicking on the table). It will open a dialog to let you choose database objects you want to script. On the next screen you must chose the "Script for Database engine type" -> "SQL Azure" !

    Another (better in my opinion) option is to use SQL Azure Migration Wizard. It will script full database for you. This is a "must-have" tool for any SQL Azure developer :)

    Thursday, September 30, 2010 6:55 PM
  • Anton,

    Thank you for your feed back.  The sql azure migration wizard tool works great.

    • Marked as answer by chad0399 Monday, October 11, 2010 5:21 PM
    Monday, October 11, 2010 5:21 PM

All replies

  • Right click table in Object explorer with your SQL Azure database open
    Choose Script Table as from the drop-down menu.
    You have three options,
    Choose Create To |File or Clipboard or New Query window

    mysorian
    Saturday, July 31, 2010 12:58 PM
  • Thank you for the quick replied.  I'm not follow on how you would do that.  I am assuming you are talking about generate this scripts off SQL SMS.  I cannot connect to the SQL Azure database through Object exporer but only through new query and then run script against the Azure database.  I installed sql sms and sms r2 on my PC and still could not connect using object exporer.  If you have a different version or other tool please let me know.  Any tips and/or example will be most appreciated.

    Monday, August 2, 2010 8:49 PM
  • Please install and use SQL Server 2008 R2, in which has a useful feature to generate and publish the script that helps to transfer the database schema between SQL Server and SQL Azure. for the details, please refer to the following links:

    http://www.mssqltips.com/tip.asp?tip=1898

    http://blogs.msdn.com/b/sqlazure/archive/2010/05/24/10014071.aspx 

    Good luck!

     

     


    Qiong Wu - MSFT
    Monday, August 16, 2010 9:45 AM
  • After creating the query which you say you can


    Click View | Object Explorer. Object Explorer tab will be added.


    Now right click an empty area in your query and choose 'Open server in Object explorer'

    You should be able to see your server in the Object Explorer.


    mysorian
    Monday, August 16, 2010 9:21 PM
  • Thank you jayaram for getting to me.  I i followed your instruction,  and get "Error connecting to ' sql azure server name' a exception occurred while executing a transact-sql statement or batch. invalid object name 'sys.configurations'
    Tuesday, September 28, 2010 11:58 PM
  • Hello Chad,

    The script generation for SQL Azure only works in SQL Server Management Studio 2008 R2. And it works. However tou have to choose "Generate Scripts..." (right clickong on the Database, not the table) but not "Script table as" (by right clicking on the table). It will open a dialog to let you choose database objects you want to script. On the next screen you must chose the "Script for Database engine type" -> "SQL Azure" !

    Another (better in my opinion) option is to use SQL Azure Migration Wizard. It will script full database for you. This is a "must-have" tool for any SQL Azure developer :)

    Thursday, September 30, 2010 6:55 PM
  • Anton,

    Thank you for your feed back.  The sql azure migration wizard tool works great.

    • Marked as answer by chad0399 Monday, October 11, 2010 5:21 PM
    Monday, October 11, 2010 5:21 PM
  • SQL Azure Migration Wizard is not working for me. always getting error

    TITLE: Microsoft.SqlServer.Smo
    ------------------------------

    Index was outside the bounds of the array.

    ------------------------------
    BUTTONS:

    OK
    ------------------------------

    is there any security settings in sql azure?

    Sunday, October 21, 2012 5:58 PM