Re: script database

Re: script database

 

  

Hi Albert,

Execute this code from Query Analyzer to script all 'Northwind' database objects:
--------------------------------------------------------------------------------
declare @cmd nvarchar(1000), @dbname sysname, @DBScript nvarchar(257)
set @dbname = 'Northwind'
set @DBScript = 'c:\temp\'+@dbname+'.sql'
set @cmd = '"C:\Program Files\Microsoft SQL Server\MSSQL\Upgrade\scptxfr.exe" /s '
+ @@servername +' /I /d ' + @dbname + ' /f ' + @DBScript
exec master..xp_cmdshell @cmd, no_output
-- check script
exec sp_readerrorlog 1, @DBScript
--------------------------------------------------------------------------------

Best Regards,
Vladimir


----- Original Message -----
From: "Albert Frazer " <mssqldba-ezmlmshield-x13361137.[Email address protected]
To: "LazyDBA Discussion" <[Email address protected]
Sent: Wednesday, January 31, 2007 10:40
Subject: script database


I'm not sure if somebody already asked for it, but is there a way to
script the entire database (objects, roles, logins, users) not using EM
in SQL Server 2000?



Thanks,



Albert Frazer

Home Decor Products, Inc

www.hdpi.com <http://www.hdpi.com>

732-593-3637 (office)

732-570-4465 (cell)





---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html




MS Sql Server LazyDBA home page