liamlaurent
IS-IT--Management
Good day everyone,
I am having trouble exporting an SQL server database to another database on the same server - but with a different name. Whenever I export the DB the stored procedures maintain their references to the original database name. Is there a way that I can export the DB and make the stored procedures reference the new DB's name.
(ex) I wanna export the DB called db_HelloWorld to db_GoodByeWorld. There is a stored procedure in db_HelloWorld that reads as follows:
CREATE PROCEDURE [delete_tb_photo_1]
(@id_1 [int])
AS DELETE [db_HelloWorld].[dbo].[tb_photo]
WHERE
( [id] = @id_1)
GO
Can I export it so that it will automatically read:
CREATE PROCEDURE [delete_tb_photo_1]
(@id_1 [int])
AS DELETE [db_GoodByeWorld].[dbo].[tb_photo]
WHERE
( [id] = @id_1)
GO
Any help would be appreciated.
Liam
I am having trouble exporting an SQL server database to another database on the same server - but with a different name. Whenever I export the DB the stored procedures maintain their references to the original database name. Is there a way that I can export the DB and make the stored procedures reference the new DB's name.
(ex) I wanna export the DB called db_HelloWorld to db_GoodByeWorld. There is a stored procedure in db_HelloWorld that reads as follows:
CREATE PROCEDURE [delete_tb_photo_1]
(@id_1 [int])
AS DELETE [db_HelloWorld].[dbo].[tb_photo]
WHERE
( [id] = @id_1)
GO
Can I export it so that it will automatically read:
CREATE PROCEDURE [delete_tb_photo_1]
(@id_1 [int])
AS DELETE [db_GoodByeWorld].[dbo].[tb_photo]
WHERE
( [id] = @id_1)
GO
Any help would be appreciated.
Liam