generate scripts in sql server

  • I have some doubts related to SQL server 2008 R2 express 'generate scripts' option.

    1)If i select script entire database and all database objects then all objects such as database,permission,table structure,index are created?

    2)If i 'select only select specific database objects', and then select only tables(all tables) then does index is created or only table will be created? Also permissions for tables set?(when i tested clustered index are created with primary key,non clustered are not created. So i am not sure what does this option do)

    3) If i select both table and user in 'select only select specific database objects' then tables and its permissions with users created?

  • Almost everything in scripting is configurable as to whether a result is scripted or skipped;

    spend some time reviewing the many scripting options that are in Tools>>Options;

    As I remember, scripting of permissions or indexes are not selected by default, so if you want them, you have to select those options before scripting.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Hi Lowell

    You are correct.If i select in options then it works.

    But there is an exception.If i am using "script entire database and all database objects" while generating script then all objects are created irrespective of the setting in tools-> options. I think it is because as option says "script entire database and all database objects".

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply