Home » SQL Server » Page 3

SQL Server

SQL Server Error : 134, Severity: 15. The variable name ‘%.*ls’ has already be

SQL Server Error : 134 Details

SQL Server Error: 134 Severity: 15 Event Logged or not: No Description: The variable name ‘%.*ls’ has already been declared. Variable names must be unique within a query batch or stored procedure. Severity 15 Description: Indicates syntax errors in the Transact-SQL command.

Solution:

Make sure the label for variables and tables are unique in a batch or Stored procedure.

Example:

declare one varchar(10)

declare one varchar(40)

SQL Server Error Code and solution summary

SQL Server Error: 134 Severity: 15 Event Logged or not: No Description: The variable name ‘%.*ls’ has already been declared. Variable names must be unique within … Read the rest

SQL Server Error : -2 Severity: 0. Timeout expired. The timeout period elap

SQL Server Error : -2 Details

SQL Server Error: -2 Severity: 0 Event Logged or not: No Description: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. (Microsoft SQL Server, Error: -2). Severity 0 Description: Informational messages that return status information or report errors that are not severe. The Database Engine does not raise system errors with severities of 0 through 9.

Solution for Resolving the Error

The query timeout to execute. Either the server is not responding or query is very large/big to execute within timeout limit.

Increase time out in Server properties

 

SQL Server Error Code and solution summary

SQL Server Error: -2 … Read the rest

SQL Server Error : 121, Severity: 15. The select list for the INSERT statement

SQL Server Error : 121 Details

SQL Server Error: 121 Severity: 15 Event Logged or not: No Description: The select list for the INSERT statement contains more items than the insert list. The number of SELECT values must match the number of INSERT columns. Severity 15 Description: Indicates syntax errors in the Transact-SQL command.

Solution for Resolving the Error

Cause for the Error

This issue happens when the number of values supplied in the VALUES clause is less than the number of columns specified in an INSERT to a table using the INSERT INTO… VALUES format, as described in the error message.

The following INSERT statement, for example, will result in an error:

INSERT Into [Alpha] ( [Name],  [Gender] )Read the rest

SQL Server Error : 116, Severity: 15. Only one expression can be specified in

SQL Server Error : 116 Details

SQL Server Error: 116 Severity: 15 Event Logged or not: No Description: Only one expression can be specified in the select list when the subquery is not introduced with EXISTS. Severity 15 Description: Indicates syntax errors in the Transact-SQL command.

Example:

SELECT [ID], [Date], [Description], [Count] FROM [dbo].[Order] WHERE [ID] NOT IN (SELECT [ID], [NumberofStock] FROM [dbo].[Stock]) Msg 116, Level 16, State 1, Line 4 Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.

This error usually occurs when a sub-query is used in conjunction with the IN or NOT IN logical operator. The IN logical operator checks to see if a given value matches … Read the rest

SQL Server Error : 119, Severity: 15. Must pass parameter number %d and subseq

SQL Server Error : 119 Details

SQL Server Error: 119 Severity: 15 Event Logged or not: No Description: Must pass parameter number %d and subsequent parameters as ‘@name = value’. After the form ‘@name = value’ has been used, all subsequent parameters must be passed in the form ‘@name = value’. Severity 15 Description: Indicates syntax errors in the Transact-SQL command.

One of the most commonly used objects in SQL Server is the stored procedure. The error message we’ll be discussing in this article is related to a stored procedure and its parameters. Let me explain the error message and how to resolve it.

EXECUTE sys.sp_one 'One', @Table_Owner = two, 'three'

Msg 119, Level 15, State 1, Line 1
Must 
Read the rest

SQL Server Error : 120, Severity: 15. The select list for the INSERT statement

SQL Server Error : 120 Details

SQL Server Error: 120 Severity: 15 Event Logged or not: No Description: The select list for the INSERT statement contains fewer items than the insert list. The number of SELECT values must match the number of INSERT columns. Severity 15 Description: Indicates syntax errors in the Transact-SQL command.

Cause for the Error

This issue happens when the number of values supplied in the VALUES Select Statement is less than the number of columns specified in an INSERT to a table using the INSERT INTO… VALUES format, as described in the error message.

The following INSERT statement, for example, will result in an error:

INSERT Into [Alpha] ( [Name], [LastName], [Gender] )
select name, lastname
Read the rest

SQL Server Error : 163, Severity: 15. The compute by list does not match the o

SQL Server Error : 163 Details

SQL Server Error: 163 Severity: 15 Event Logged or not: No Description: The compute by list does not match the order by list. Severity 15 Description: Indicates syntax errors in the Transact-SQL command.

Solution:

Make sure compute by list of columns matches the order by list at the bottom.

Indicates syntax errors in the Transact-SQL command.

SQL Server Error Code and solution summary

SQL Server Error: 163 Severity: 15 Event Logged or not: No Description: The compute by list does not match the order by list.… Read the rest

SQL Server Error : 162, Severity: 15. Invalid expression in the TOP clause.

SQL Server Error : 162 Details

SQL Server Error: 162 Severity: 15 Event Logged or not: No Description: Invalid expression in the TOP clause. Severity 15 Description: Indicates syntax errors in the Transact-SQL command.

Cause:

Setup the import file to use the current file path and In the control flow diagram there is a step called “import data “

The ssis package creates a temp table named temp, imports the records from the excel workbook worksheet named “Sheet1”. Then queries to match the following “names” with appropriate id’s of table

we can run this import temp data into real table and run again.

Once those id’s have been found/updated then it takes the records from the temp table and copies Read the rest

SQL Server Error : 112, Severity: 15. Variables are not allowed in the %ls sta

SQL Server Error : 112 Details

SQL Server Error: 112 Severity: 15 Event Logged or not: No Description: Variables are not allowed in the %ls statement. Severity 15 Description: Indicates syntax errors in the Transact-SQL command.

Reading sql server error log location from SQL Query

Identifying SQL Server Error Log File used by SQL Server Database Engine can be done by reading SQL Server Error Logs. DBA can execute the XP_READERRORLOG extended stored procedure to read the SQL Server Error Log and search for its location used by the instance of SQL Server.

USE master
Go
xp_readerrorlog 0, 1, N'Logging SQL Server messages in file', NULL, NULL, N'asc'
Go

Solution:

A maintenance plan does not overwrite the old backup file … Read the rest

SQL Server Error : 114, Severity: 15. Browse mode is invalid for a statement t

SQL Server Error : 114 Details

SQL Server Error: 114 Severity: 15 Event Logged or not: No Description: Browse mode is invalid for a statement that assigns values to a variable. Severity 15 Description: Indicates syntax errors in the Transact-SQL command.

Cause

NetBackup VMware backups using SQL Server application protection fails showing unimplemented sql server error code 114(114)

Credentials used for starting (Log on as) the SQL VSS Writer service on SQL Server are not part of the sysadmin role in SQL Server.

Normally the SYSTEM account is part of Built-in Administrators group on the server but if it is not removed due to security hardening.

Solution

Grant sysadmin permissions to the System account (NT AUTHORITY\SYSTEM) on all SQL Server … Read the rest