RE: Create DB Users for New Databases
How about this (ker-lunk!) declare @dbname as varchar(100) declare @strSQL as varchar(100) declare @strSQLCommand as varchar(100) set @strSQLCommand='exec sp_adduser ''Victoria'', ''Victoria'', ''db_owner''' set @dbname='Whatever' -- your db loop here set @strsql='USE ' + @dbName + '; ' + @strSQLCommand + ';' exec(@strSQL)
2003-06-19