Elmo,
All of those things can be scripted, but they will need to be sure to
include all parts. I don't know which version of SQL Server you are on, but
(although there are differences) you can script out from the GUI.
SQL Server 2000 is easier, since the script database has options to choose
all of these things.
SQL Server 2005 is not as encompassing a script.
1. Roles and Users can be selected and scripted.
2. There is no GUI tool to generate role memberships, but here is one
Erland Sommarskog wrote:
SELECT 'EXEC sp_addrolemember ''' + r.name + ''', ''' + u.name + ''''
FROM sys.database_role_members rm
JOIN sys.database_principals u
ON rm.member_principal_id = u.principal_id
JOIN sys.database_principals r
ON rm.role_principal_id = r.principal_id
WHERE u.name <> 'dbo'
3. The create database can be scripted.
4. All Objects (tables, views, stored procedures, etc, (except for encrypted
stored procedures.)) with permissions are scriptable.
Moving data from one database to another is not really scripted, but the
Import and Export wizards work fine, provided you are at an up-to-date
service pack for both the server and the tools.
Or there are tools, such as Red Gate SQL Compare, that can be instructed to
handle all of those issues. (Compare original database to blank database
and get a script of everything that needs to be scripted into the new
database.) I use Red Gate, but there are others and I really recommend that
a SQL Server shop have such tools on hand at all times.
Getting this done this way is obviously a lot more work than just getting a
backup, but it may reduce the concerns for your clients.
RLF
> Thanks Russell
>
[quoted text clipped - 24 lines]
>> > a
>> > text editor?