Answered generate table script of sql azure

  • Friday, July 30, 2010 7:03 PM
     
     
    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.

All Replies

  • Saturday, July 31, 2010 12:58 PM
     
     Answered
    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
  • Monday, August 02, 2010 8:49 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 16, 2010 9:45 AM
     
     Proposed Answer

    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
    • Proposed As Answer by Anton StaykovMVP Thursday, September 30, 2010 6:55 PM
    •  
  • Monday, August 16, 2010 9:21 PM
     
     

    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
  • Tuesday, September 28, 2010 11:58 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'
  • Thursday, September 30, 2010 6:55 PM
     
     Answered

    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 :)

  • Monday, October 11, 2010 5:21 PM
     
     Answered

    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
    •  
  • Sunday, October 21, 2012 5:58 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?