September 11, 2012 at 9:39 am
I mean I do not need any data, but all objects in a database.
Many thanks for all inputs in advance.
September 11, 2012 at 9:45 am
In Object Explorer, right click on the database, select Tasks, then Generate Scripts, then follow along with the wizard.
September 11, 2012 at 9:47 am
probably the easiest way is to use the Scripting wizard in SSMS;
right click on the database in question, Choose "Tasks", then "Generate Scripts"
follow the wizard prompts;
you might need to go to Tools>>Options and make some changes there under Scripting options to make sure all teh elements you want appear.
Lowell
December 21, 2012 at 11:39 am
What is the lowest level of permissions that a user has to have to use the script wizard?
Have not been able to find that. I thought if the user is a ddladmin it would work, but it does not.
December 21, 2012 at 12:07 pm
According to BOL it should be db_ddladmin.
http://msdn.microsoft.com/en-us/library/bb895179.aspx
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
December 21, 2012 at 12:40 pm
I think the issue is SSMS itself tends to require higher level permissions than you'd think would be required. if you access SMO directly(like from powershell) , ddl_admin or even VIEW DATABASE/VIEW ANY DATABASE is sufficient, but SSMS, since it's using a wizard that plans on the ability to script everything possible , wants to assume you have dbo access so that it doesn't need to check permissions.
Lowell
December 21, 2012 at 4:14 pm
Ellen-477471 (12/21/2012)
What is the lowest level of permissions that a user has to have to use the script wizard?Have not been able to find that. I thought if the user is a ddladmin it would work, but it does not.
Oooo... bad news. First, I'd ask the question, why would you allow a user to do this?
Second, be very aware of the incredible power hidden in the ddladmin role. It can drop tables, create tables, and do all sorts of other asty stuff. I would't let a user have these privs unless it were on a Development box.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply