May 29, 2012

sp_MSscriptdatabase (Transact-SQL MetaData) Definition

Please note: that the following source code is provided and copyrighted by Microsoft and is for educational purpose only.
The meta data is from an SQL 2012 Server.

I have posted alot more, find the whole list here.

Goto Definition or MetaData

Definition:

sys.sp_MSscriptdatabase(nvarchar @dbname)

MetaData:

 create procedure sys.sp_MSscriptdatabase  
@dbname nvarchar(258)
as
-- verify --
declare @id int
select @id = dbid from master.dbo.sysdatabases where name = @dbname
if (@id is null)
begin
RAISERROR (15001, -1, -1, @dbname)
return 1
end

-- Ready to get to work --
declare @dbTempname nvarchar(258)
SELECT @dbTempname = REPLACE(@dbname, N']', N']]')
exec (N'[' + @dbTempname + N']' + N'..sp_MSscriptdb_worker ')

No comments:

Post a Comment

Total Pageviews