Davidmc555
Programmer
Hi.
I'm sorry if this has been asked before but I couldn't find anywhere on the tek-tips site or Books online that explained how to do what I'm trying to do.
I'm trying to make up a script that restore a database. This database will be a preconfigured blank version that our product uses. I want to make an executible file that takes the script and restore the file onto the user's SQL server.
That's what I have thus far. I'd rather not have the D:\ part as the .bak file will be zipped up with the executible.
Am I making sense? Cheers for any help in advance.
I'm sorry if this has been asked before but I couldn't find anywhere on the tek-tips site or Books online that explained how to do what I'm trying to do.
I'm trying to make up a script that restore a database. This database will be a preconfigured blank version that our product uses. I want to make an executible file that takes the script and restore the file onto the user's SQL server.
Code:
ALTER DATABASE tmBase
SET SINGLE_USER WITH ROLLBACK AFTER 15 SECONDS
RESTORE DATABASE tmBase
FROM DISK = 'D:\live.bak'
GO
That's what I have thus far. I'd rather not have the D:\ part as the .bak file will be zipped up with the executible.
Am I making sense? Cheers for any help in advance.