Hi guys,
In SQL Server 2005, how can I use database_b, do something, then use the old db database_a in TSQL? The following is my code but there is some problem with it. Who can help me to identity the problem? Great thanks.
DECLARE @old_database_name VARCHAR(200)
SET @old_database_name = db_name()
use mydatabase
create table t1(id int identity(1,1))
use @old_database_name