Um ein SQL 2000 Server Backup in einen SQL-Server einzuspielen gehen Sie bitte wie folgt vor:
/* **************************************************************************************** * PROCEDURE....... Change Schema * DESCRIPTION..... Change schema for all objects from 'ebissuser' to 'dbo' ******************************************************************************************* */
/* Set the following variables as appropriate */
DECLARE @comand varchar(1024)
/* Declare variables and cursor */
declare @objectName varchar(30), @userName varchar(30), @fqon varchar(50)
declare c_objlist cursor static for
select name from sys.tables where schema_id = 6
/* Open cursor and retrieve first record */
OPEN c_objlist
FETCH NEXT FROM c_objlist INTO @objectName
/* Loop through each cursor record */
WHILE @@FETCH_STATUS = 0
BEGIN
/* Display and change the object ownership */
SET @comand = 'ALTER SCHEMA dbo TRANSFER ebissuser.' + @objectName
print @comand
exec (@comand)
/* Retrieve next record */
FETCH NEXT FROM c_objlist INTO @objectName
END
/* Close and deallocate cursor */
CLOSE c_objlist
DEALLOCATE c_objlist