Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

You receive a script error message when you use the Web Deployment Tool (Web Deploy) dbFullSql provider to execute a database script


Symptoms

When you execute a SQL Script by using Web Deploy, you may receive an error message similar to the following:
  

An error occurred during execution of the database script. The approximate location of the error was between lines 'x’ and 'y' of the script.

 

The exact text of the error message will vary depending on the failure. Following are some examples:

 

Example A

Error: An error occurred during execution of the database script. The approximate location of the error was between lines '3' and '8' of the script. The verbose log may have more information about the error.
The command started with:

/****** Object:  Database [AdventureWorks]
http://go.microsoft.com/fwlink/?LinkId=178587
Error: DROP DATABASE statement cannot be used inside a user transaction.
Error count: 1.

 

Example B

Error: An error occurred during execution of the database script. The approximate location of the error was between lines '1' and '3' of the script. The verbose log may have more information about the error.
The command started with:

USE [master]  InvalidScript
http://go.microsoft.com/fwlink/?LinkId=178587
Error: Incorrect syntax near 'InvalidScript'.
Error count: 1.

 

↑ Back to the top


Cause

The cause of the issue will depend on the text of the error.  For example, permissions to perform a specific operation might be missing, or there might be syntax errors within the script.

 

↑ Back to the top


Resolution

The resolution will depend on the text of the error message.  The following steps can be used to help debug the script.

  • If you use the –verbose switch when executing the Web Deploy command, the output will indicate the exact line on which the error occurred. An example follows.

 

Verbose: Executing the following database command (lines 1 to 3 of the script):
USE [master]
Verbose: Executing the following database command (lines 3 to 8 of the script):
/****** Object:  Database [AdventureWorks]    Script Date: 03/31/2010 10:06:31 *
*****/
IF  EXISTS (SELECT name FROM sys.databases WHERE name = N'AdventureWorks') DROP DATABASE [AdventureWorks]

 

 

 

↑ Back to the top


Keywords: vkball, kb

↑ Back to the top

Article Info
Article ID : 2023856
Revision : 1
Created on : 1/8/2017
Published on : 4/20/2010
Exists online : False
Views : 214