Hi all,
I’m trying to create a SQL Server T-SQL script that will basically drop and restore certain database on a daily basis. Because the names of databases that need to be restored may vary, the script may also vary. I have a VB Program that creates the script based on some parameters. I would like to use SQL Sever Agent Jobs to create a job that would run my script. I know I can copy and paste my script in one of the steps within the job, but I want it to be dynamic so that I don’t need to copy and paste the script as the database names change everyday (and therefore my script would also change). My question is: is there is a way that I can basically link the job to a T-SQL file (i.e. C:\restore.sql) so that the job would run based on whatever I have in c:\restore.sql file?
I’m trying to create a SQL Server T-SQL script that will basically drop and restore certain database on a daily basis. Because the names of databases that need to be restored may vary, the script may also vary. I have a VB Program that creates the script based on some parameters. I would like to use SQL Sever Agent Jobs to create a job that would run my script. I know I can copy and paste my script in one of the steps within the job, but I want it to be dynamic so that I don’t need to copy and paste the script as the database names change everyday (and therefore my script would also change). My question is: is there is a way that I can basically link the job to a T-SQL file (i.e. C:\restore.sql) so that the job would run based on whatever I have in c:\restore.sql file?