Re: [WiX-users] Restoring SQL Database with Sqlstring in WiX v3

2009-01-29 Thread Eric Latendresse
Thanks David. I got this to work! Seems that putting "USE master;" in
front of the script did the trick. Which makes complete sense now. So
sending your code helped! I appreciate your time! 

Eric 



-Original Message-
From: David Reed [mailto:david.r...@microsoft.com] 
Sent: Thursday, January 29, 2009 11:39 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Restoring SQL Database with Sqlstring in WiX v3

I've done restores successfully this way. Profiler will help determine
the call(s) made and more details about why they failed.

Eric, assuming that you're using integrated security, are you sure that
your installer is running elevated at the point where the restore is
attempted?

We've since abandoned BAK files, but here's an example component from
the original RTM AdventureWorks2008 installer from last year:


  
  

  
  
  






-Original Message-
From: Rob Mensching [mailto:rob.mensch...@microsoft.com]
Sent: Thursday, January 29, 2009 09:05
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Restoring SQL Database with Sqlstring in WiX v3

Not much that is helpful.  When I've had really hard SQL issues, I've
always used the SQL profiler to dig through all the calls and find the
one that is failing.

Note: I have seen successful attaches of database files but never tried
to do a restore from backup.  I always have issues restoring from
backup.

-Original Message-
From: Eric Latendresse [mailto:elatendre...@optimum-solutions.com]
Sent: Thursday, January 29, 2009 08:15
To: General discussion for Windows Installer XML toolset.
Subject: [WiX-users] Restoring SQL Database with Sqlstring in WiX v3

Anyone have any suggestions on how to debug this? I have checked the SQL
server logs and there is nothing there pertaining to this WiX error.
Thank you in advance for your help with this.

This is the exact error:
Error -2147217900: failed to execute SQL string, error detail: RESTORE
DATABASE is terminating abnormally., SQL key: RestoreDB SQL string:
RESTORE DATABASE Suite FROM DISK = 'G:\Database\SuiteBlank

This is the WiX code. Creating the database works fine. the error
happens within the SQL String. Running the SQL string in SQL Query
analyzer works as well.






















Eric



-Original Message-
From: Eric Latendresse [mailto:elatendre...@optimum-solutions.com]
Sent: Wednesday, January 28, 2009 9:11 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Creating SQL Database with WiX v3

Is it possible the Sql Database is locked after it creates it? The .mdf
and .ldf file DO get created before the .msi is finished, but maybe
because the .msi isn't complete the files are locked? Just a thought. If
this is the case is there a way around this? TO create the blanks sql
Database, unlock it, then run the restore script?

Eric Latendresse



-Original Message-
From: Eric Latendresse [mailto:elatendre...@optimum-solutions.com]
Sent: Wednesday, January 28, 2009 8:59 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Creating SQL Database with WiX v3

Still getting the error and no way to debug? Are there any other
options? This way of restoring a database SHOULD work, right?

Eric


-Original Message-
From: Eric Latendresse [mailto:elatendre...@optimum-solutions.com]
Sent: Tuesday, January 27, 2009 8:32 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Creating SQL Database with WiX v3

Yes, The sql server is local. It creates the blank database correctly
and I can see the .mdf and .ldf files at the time of the error. The
backup file is there as well. The problem must be with the restore
script. I can run the script manually and it works fine. Is there
anything that would cause WiX to read the sqlstring wrong? Maybe the
single quotes aren't coming through as they should? Is there a WiX log
or a way to add one so that I can get a more detailed message?

Eric



-Original Message-
From: David Reed [mailto:david.r...@microsoft.com]
Sent: Monday, January 26, 2009 3:34 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Creating SQL Database with WiX v3

That's often a 404-equivalent. There's usually more info in the server
error log.

Error -2147217900
Cannot open backup device ''.
Device error or device off-line. See the SQL Server error log
for more details.

Make sure the SQL Server p

Re: [WiX-users] Restoring SQL Database with Sqlstring in WiX v3

2009-01-29 Thread David Reed
I've done restores successfully this way. Profiler will help determine the 
call(s) made and more details about why they failed.

Eric, assuming that you're using integrated security, are you sure that your 
installer is running elevated at the point where the restore is attempted?

We've since abandoned BAK files, but here's an example component from the 
original RTM AdventureWorks2008 installer from last year:


  
  

  
  
  






-Original Message-
From: Rob Mensching [mailto:rob.mensch...@microsoft.com]
Sent: Thursday, January 29, 2009 09:05
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Restoring SQL Database with Sqlstring in WiX v3

Not much that is helpful.  When I've had really hard SQL issues, I've always 
used the SQL profiler to dig through all the calls and find the one that is 
failing.

Note: I have seen successful attaches of database files but never tried to do a 
restore from backup.  I always have issues restoring from backup.

-Original Message-
From: Eric Latendresse [mailto:elatendre...@optimum-solutions.com]
Sent: Thursday, January 29, 2009 08:15
To: General discussion for Windows Installer XML toolset.
Subject: [WiX-users] Restoring SQL Database with Sqlstring in WiX v3

Anyone have any suggestions on how to debug this? I have checked the SQL
server logs and there is nothing there pertaining to this WiX error.
Thank you in advance for your help with this.

This is the exact error:
Error -2147217900: failed to execute SQL string, error detail: RESTORE
DATABASE is terminating abnormally., SQL key: RestoreDB SQL string:
RESTORE DATABASE Suite FROM DISK = 'G:\Database\SuiteBlank

This is the WiX code. Creating the database works fine. the error
happens within the SQL String. Running the SQL string in SQL Query
analyzer works as well.






















Eric



-Original Message-
From: Eric Latendresse [mailto:elatendre...@optimum-solutions.com]
Sent: Wednesday, January 28, 2009 9:11 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Creating SQL Database with WiX v3

Is it possible the Sql Database is locked after it creates it? The .mdf
and .ldf file DO get created before the .msi is finished, but maybe
because the .msi isn't complete the files are locked? Just a thought. If
this is the case is there a way around this? TO create the blanks sql
Database, unlock it, then run the restore script?

Eric Latendresse



-Original Message-
From: Eric Latendresse [mailto:elatendre...@optimum-solutions.com]
Sent: Wednesday, January 28, 2009 8:59 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Creating SQL Database with WiX v3

Still getting the error and no way to debug? Are there any other
options? This way of restoring a database SHOULD work, right?

Eric


-Original Message-
From: Eric Latendresse [mailto:elatendre...@optimum-solutions.com]
Sent: Tuesday, January 27, 2009 8:32 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Creating SQL Database with WiX v3

Yes, The sql server is local. It creates the blank database correctly
and I can see the .mdf and .ldf files at the time of the error. The
backup file is there as well. The problem must be with the restore
script. I can run the script manually and it works fine. Is there
anything that would cause WiX to read the sqlstring wrong? Maybe the
single quotes aren't coming through as they should? Is there a WiX log
or a way to add one so that I can get a more detailed message?

Eric



-Original Message-
From: David Reed [mailto:david.r...@microsoft.com]
Sent: Monday, January 26, 2009 3:34 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Creating SQL Database with WiX v3

That's often a 404-equivalent. There's usually more info in the server
error log.

Error -2147217900
Cannot open backup device ''.
Device error or device off-line. See the SQL Server error log
for more details.

Make sure the SQL Server process has permissions to that path and that
the file actually exists there.

You are trying to restore to a local server instance, right? Not a
remote server?



-Original Message-
From: Eric Latendresse [mailto:elatendre...@optimum-solutions.com]
Sent: Monday, January 26, 2009 13:21
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Creating SQL Database with WiX v3

I tried to restore the database from a backup fi

Re: [WiX-users] Restoring SQL Database with Sqlstring in WiX v3

2009-01-29 Thread Rob Mensching
Not much that is helpful.  When I've had really hard SQL issues, I've always 
used the SQL profiler to dig through all the calls and find the one that is 
failing.

Note: I have seen successful attaches of database files but never tried to do a 
restore from backup.  I always have issues restoring from backup.

-Original Message-
From: Eric Latendresse [mailto:elatendre...@optimum-solutions.com]
Sent: Thursday, January 29, 2009 08:15
To: General discussion for Windows Installer XML toolset.
Subject: [WiX-users] Restoring SQL Database with Sqlstring in WiX v3

Anyone have any suggestions on how to debug this? I have checked the SQL
server logs and there is nothing there pertaining to this WiX error.
Thank you in advance for your help with this.

This is the exact error:
Error -2147217900: failed to execute SQL string, error detail: RESTORE
DATABASE is terminating abnormally., SQL key: RestoreDB SQL string:
RESTORE DATABASE Suite FROM DISK = 'G:\Database\SuiteBlank

This is the WiX code. Creating the database works fine. the error
happens within the SQL String. Running the SQL string in SQL Query
analyzer works as well.






















Eric



-Original Message-
From: Eric Latendresse [mailto:elatendre...@optimum-solutions.com]
Sent: Wednesday, January 28, 2009 9:11 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Creating SQL Database with WiX v3

Is it possible the Sql Database is locked after it creates it? The .mdf
and .ldf file DO get created before the .msi is finished, but maybe
because the .msi isn't complete the files are locked? Just a thought. If
this is the case is there a way around this? TO create the blanks sql
Database, unlock it, then run the restore script?

Eric Latendresse



-Original Message-
From: Eric Latendresse [mailto:elatendre...@optimum-solutions.com]
Sent: Wednesday, January 28, 2009 8:59 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Creating SQL Database with WiX v3

Still getting the error and no way to debug? Are there any other
options? This way of restoring a database SHOULD work, right?

Eric


-Original Message-
From: Eric Latendresse [mailto:elatendre...@optimum-solutions.com]
Sent: Tuesday, January 27, 2009 8:32 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Creating SQL Database with WiX v3

Yes, The sql server is local. It creates the blank database correctly
and I can see the .mdf and .ldf files at the time of the error. The
backup file is there as well. The problem must be with the restore
script. I can run the script manually and it works fine. Is there
anything that would cause WiX to read the sqlstring wrong? Maybe the
single quotes aren't coming through as they should? Is there a WiX log
or a way to add one so that I can get a more detailed message?

Eric



-Original Message-
From: David Reed [mailto:david.r...@microsoft.com]
Sent: Monday, January 26, 2009 3:34 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Creating SQL Database with WiX v3

That's often a 404-equivalent. There's usually more info in the server
error log.

Error -2147217900
Cannot open backup device ''.
Device error or device off-line. See the SQL Server error log
for more details.

Make sure the SQL Server process has permissions to that path and that
the file actually exists there.

You are trying to restore to a local server instance, right? Not a
remote server?



-Original Message-
From: Eric Latendresse [mailto:elatendre...@optimum-solutions.com]
Sent: Monday, January 26, 2009 13:21
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Creating SQL Database with WiX v3

I tried to restore the database from a backup file during the initial
install and am getting this error below. Is there WiX log or something
where I can get some more info on how to debug this? Below is my code
and I think this should work. Anyone have any ideas? Thanks in advance
for you help.





















Error -2147217900: failed to execute SQL string, error detail: RESTORE
DATABASE is terminating abnormally., SQL key: RestoreDB SQL string:
RESTORE DATABASE Suite FROM DISK = 'G:\Database\SuiteBla