Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

generate scripts in sql server Expand / Collapse
Author
Message
Posted Monday, June 17, 2013 4:39 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: 2 days ago @ 11:58 PM
Points: 270, Visits: 1,745
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?
Post #1464067
Posted Monday, June 17, 2013 5:23 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 1:11 PM
Points: 12,905, Visits: 32,161
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

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1464093
Posted Monday, June 17, 2013 6:47 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: 2 days ago @ 11:58 PM
Points: 270, Visits: 1,745
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".
Post #1464118
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse