automating a database backup, restore and stored proc call
BACKUP DATABASE [Database A]
TO DISK = 'C:\Temp\DatabaseA.bak' WITH FORMAT
GO
use master
GO
RESTORE DATABASE [Database X]
FROM  DISK = N'C:\Temp\DatabaseA.bak'
,  MOVE N'DataFile' TO N'C:\Foo\DatabaseX.mdf'
,  MOVE N'LogFile' TO N'C:\Bar\DatabaseX.ldf'
,  NOUNLOAD,  REPLACE,  STATS = 10

GO
use [Database X]
GO
exec StoredProcedureName...
GO
use master
GO
DBCC ShrinkDatabase( [Database X] )