SQL Server Error : 164, Severity: 15. Each GROUP BY expression must contain at

SQL Server Error : 164 Details

SQL Server Error: 164 Severity: 15 Event Logged or not: No Description: Each GROUP BY expression must contain at least one column that is not an outer reference. Severity 15 Description: Indicates syntax errors in the Transact-SQL command.

Solution for Resolving the Error

SQL Server does not know positional arguments in group by part of the statement.

So, the column name needs repeatetion in group by part.

The positional syntax is  only permitted for order by like 1,2 etc.

In general it is better to use column names in the order by clause as well to be clear.

Some … Read the rest

SQL Server Error : 126, Error with SQL Server Linked Server

SQL Server Error : 126 Details

SQL Server Error: 126 Error with SQL Server Linked Server Event Logged or not: No Description: SQL Server Error : 126, Error with SQL Server Linked Server.

 Description: “System error 126” thrown when creating linked server from SQL Server Management Studio or using the Salesforce driver through any Windows service.
The test connect is successful using the ODBC Administrator.

Cannot initialize the data source object of OLE DB provider “NewSQL” for linked server “Newone”, OLE DB provider “New SQL” for linked server “Newone” returned message “Specified driver could not be loaded due to system error 126: The specified module could not be found (DataDirect 7.1 Salesforce, C:\Program Files\Progress\DataDirect\Connect_for_ODBC_71\Drivers\ivsfrc27.dll).”. (Microsoft SQL Server, error: 7303)

Cannot … Read the rest

SQL Server Error : 123, Severity: 15. Batch/procedure exceeds maximum length o

SQL Server Error : 123 Details

SQL Server Error: 123 Severity: 15 Event Logged or not: No Description: Batch/procedure exceeds maximum length of %d characters. Severity 15 Description: Indicates syntax errors in the Transact-SQL command. The length of the variable or column value exceeds maximum allowed length.

Solution for Resolving the Error

Make Sure the number of characters length is matching that the char length of variable or column to value being inserted or trying to be updated.

 

For Example:

declare one varchar(10)

set one = ‘1234567891011’

SQL Server Error Code and solution summary

SQL Server Error: 123 Severity: 15 Event Logged or not: No Description: Batch/procedure exceeds maximum length of %d characters.

 

Make Sure the number of … Read the rest

SQL Server Error : 117, Severity: 15. The %S_MSG name ‘%.*ls’ contains more th

SQL Server Error : 117 Details

SQL Server Error: 117 Severity: 15 Event Logged or not: No Description: The %S_MSG name ‘%.*ls’ contains more than the maximum number of prefixes. The maximum is %d. Severity 15 Description: Indicates syntax errors in the Transact-SQL command.

 

This error can be encountered in the process of moving a database from one hosting provider to another. The current provider incorporates the domain name into the user name. The domain extension is .co.uk. As a result, some database objects have the fully qualified name [email protected] for example.

But, attempting to change the schema of these objects in order to insert them into a dbo schema by using:

ALTER SCHEMA dbo TRANSFER [email protected]

you get … Read the rest

SQL Server Error : 111, Severity: 15. ‘%ls’ must be the first statement in a q

SQL Server Error : 111 Details

SQL Server Error: 111 Severity: 15 Event Logged or not: No Description: ‘%ls’ must be the first statement in a query batch. Severity 15 Description: Indicates syntax errors in the Transact-SQL command.

 

Cause for Resolving the Error

Example below of some code that would cause this error:
DROP VIEW IF EXISTS vOne;

CREATE VIEW vOne AS
SELECT * FROM table1;

Msg 111, Level 15, State 1, Line 3
‘CREATE VIEW’ must be the first statement in a query batch.

Above, we are executing two statements: a DROP VIEW and a CREATE VIEW.

The CREATE VIEW command cannot be coupled with other statements in the same batch, according to T-SQL batch restrictions.

In other … Read the rest

SQL Server Error : 110, Severity: 15. There are fewer columns in the INSERT st

SQL Server Error : 110 Details

SQL Server Error: 110 Severity: 15 Event Logged or not: No Description: There are fewer columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT 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 Read the rest

SQL Server Error : 109, Severity: 15. There are more columns in the INSERT statement

SQL Server Error : 109 Details

SQL Server Error: 109 Severity: 15 Event Logged or not: No Description: There are more columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement. 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 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] … Read the rest

SQL Server Error : 106, Severity: 16. Too many table names in the query. The m

SQL Server Error : 106 Details

SQL Server Error: 106 Severity: 16 Event Logged or not: No Description: Too many table names in the query. The maximum allowable is %d. Severity 16 Description: Indicates general errors that can be corrected by the user.

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

The parameters for XP_READERRRORLOG … Read the rest

How to fix database SQL server error 4060?

How do I resolve database error 4060 in SQL Server?

If you use a SQL database, you may encounter SQL Error 4060 following a database migration. This is one of the many SQL Errors that administrators must deal with. SQL Error 4060 occurs on the server. As a result, the client has little control over the situation. You require an immediate solution. We’ll show you how to fix SQL Error 4060 here.

Errors include

  1. sql server error 4060 cannot open database
  2. sql state 08004 sql server error 4060 or sql state 08004 error 4060
  3. fatal sql error 4060 occurred during company login
  4. unable to open the specified server database 4060
  5. error number 4060 state 1 class 11 or error number:4060,state:1,class:11
Read the rest

How to fix SQL server error 772?

SQL server error 772

SQL server error 772 occurs frequently when an application or ODBC connects to the SQL server. The main causes of the error are the use of an old ODBC driver and the client’s encryption methods.
As part of our Server Management Services, we assist our customers on a regular basis in resolving SQL-related errors.
Here, we’ll look at what’s causing this error and how to fix it.

 

What is the source of SQL server error 772?

As previously stated, SQL error 772 occurs when an application or ODBC connects to a SQL server. The following is an example of an error message:

Microsoft SQL Server Login
Connection failed:
SQLState: ‘0100’
SQL Server Error: 772
[Microsoft][ODBC … Read the rest