Thanks for the quick reply Jochem, but after trying to run the following I
get an error(see below)

<cfquery name="dorestore" datasource="grandRounds">
RESTORE DATABASE [DCCRegistry]
FROM  DISK = N'C:\Program Files\Microsoft SQL
Server\MSSQL\BACKUP\DCCRegistry_db_200806110200.BAK'
WITH  FILE = 1,
NOUNLOAD,
REPLACE,
STATS = 10
</cfquery>


Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'.

The error occurred in D:\WebNew\centers\dump.cfm: line 1

1 : <cfquery name="dorestore" datasource="grandRounds">
2 : RESTORE DATABASE [DCCRegistry]
3 : FROM  DISK = N'C:\Program Files\Microsoft SQL
Server\MSSQL\BACKUP\DCCRegistry_db_200806110200.BAK'

Don't know if it makes any difference here but this MSSQL Server 2k and
running CF Standard 7,0,2,142559

Any ideas?

Bewildered Bob


-----Original Message-----
From: Jochem van Dieten [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 03, 2008 2:34 PM
To: CF-Talk
Subject: Re: Need help with restoring from .bak

Imperial, Robert wrote:
> Scrambling here trying to restore a db on a ms sql server and cannot
> connect with Enterprise Manager (another story). Is there a command line
> utility out there anywhere that will let me restore a db from a .bak
> file on a windows box? Or is there a way to do this from a CF query? TIA

<cfquery ...>
RESTORE DATABASE [database_name] FROM  DISK =
N'path_to_full_backup_file' WITH  FILE = 1,  NOUNLOAD,  REPLACE,  STATS = 10
</cfquery>

Make sure you connect to a database that is not the one you are trying
to restore.

Jochem





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308550
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to