SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


generate scripts in sql server


generate scripts in sql server

Author
Message
IT researcher
 IT researcher
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1744 Visits: 1798
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?
Lowell
Lowell
SSC Guru
SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)

Group: General Forum Members
Points: 75878 Visits: 40999
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!
IT researcher
 IT researcher
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1744 Visits: 1798
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".
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search