I have received following question nearly 10 times in last week though emails. Many users have received following error while connecting to the database. This error happens when database is dropped for which is default for some of the database user. When user try to login and their default database is dropped following error shows [...]
Archive for the ‘SQL Error Messages’ Category
SQL SERVER - Fix : Error: 4064 - Cannot open user default database. Login failed. Login failed for user
Posted in Author Pinal, SQL, SQL Authority, SQL Error Messages, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology on November 4, 2008 | 1 Comment »
SQL SERVER - Fix : Error : Login failed for user ‘UserName’. The user is not associated with a trusted SQL Server connection
Posted in Author Pinal, SQL, SQL Authority, SQL Error Messages, SQL Query, SQL Security, SQL Server, SQL Tips and Tricks, T SQL, Technology on November 2, 2008 | 2 Comments »
Recently I have got two desktop computers at home and both of them are very powerful machine.
Machine 1 : Windows Vista SP1 with SQL Server 2008
Machine 2 : Windows 2003 with SQL Server 2005 with SP2
When I was trying to connect from SQL Server 2008 to SQL Server 2005 using Windows Authentication I was getting [...]
SQL SERVER - Fix : Error : Incorrect syntax near . You may need to set the compatibility level of the current database to a higher value to enable this feature. See help for the stored procedure sp_dbcmptlevel
Posted in SQL, SQL Authority, SQL Error Messages, SQL Query, SQL Security, SQL Server, SQL Stored Procedure, SQL Tips and Tricks, T SQL, Technology on October 21, 2008 | No Comments »
I have seen developer confused many times when they receive following error message.
Msg 325, Level 15, State 1, Line 7
Incorrect syntax near . You may need to set the compatibility level of the current database to a higher value to enable this feature. See help for the stored procedure sp_dbcmptlevel.
The reason for this error is [...]
SQL SERVER - 2008 - Fix Connection Error with Visual Studio 2008 - Server Version is not supported
Posted in Author Pinal, Database, SQL, SQL Authority, SQL Download, SQL Error Messages, SQL Query, SQL Server, SQL Tips and Tricks, SQLAuthority, Software Development, T SQL, Technology on September 21, 2008 | 5 Comments »
While attending conference SQLAuthority Author Visit - Microsoft Student Partner Conference, some developers informed me that SQL SERVER 2008 cannot be connected to Visual Studio 2008 and error displays as MS does not support SQL Server version. I was surprised initially as I could not believe that two MS products are not compatible. When trying myself [...]
SQL SERVER - 2008 - Interview Questions and Answers Complete List Download
Posted in Author Pinal, Database, SQL, SQL Authority, SQL Constraint and Keys, SQL Cursor, SQL Data Storage, SQL DateTime, SQL Documentation, SQL Download, SQL Error Messages, SQL Function, SQL Index, SQL Interview Questions and Answers, SQL Joins, SQL Performance, SQL Query, SQL Scripts, SQL Security, SQL Server, SQL Server DBCC, SQL Stored Procedure, SQL Tips and Tricks, SQL Trigger, SQL Utility, SQL XML, SQLAuthority, T SQL, Technology on September 20, 2008 | 12 Comments »
Download SQL Server 2008 Interview Questions and Answers Complete List
Interview is very important event for any person. A good interview leads to good career if candidate is willing to learn. I always enjoy interview questions and answers series. This is my very humble attempt to write SQL Server 2008 interview questions and answers. SQL Server [...]
SQL SERVER - 2008 - Interview Questions and Answers - Part 7
Posted in Author Pinal, Database, Main, SQL, SQL Authority, SQL Error Messages, SQL Interview Questions and Answers, SQL Query, SQL Scripts, SQL Security, SQL Server, SQL Tips and Tricks, SQL Utility, SQLAuthority, T SQL, Technology on September 18, 2008 | No Comments »
SQL SERVER - 2008 - Interview Questions and Answers Complete List Download
How can we rewrite sub-queries into simple select statements or with joins?
Yes we can write using Common Table Expression (CTE). A Common Table Expression (CTE) is an expression that can be thought of as a temporary result set which is defined within the execution [...]
SQL Server - Error : Fix : SharePoint Stop Working After Changing Server (Computer) Name
Posted in Author Pinal, SQL, SQL Authority, SQL Documentation, SQL Error Messages, SQL Query, SQL Server, SQL Tips and Tricks, Software Development, T SQL, Technology, tagged SharePoint on September 9, 2008 | 1 Comment »
If Microsoft Office SharePoint Server (MOSS) and your database (MS SQL Server) are running together on same physical server, changing the name of the server (computer) using operating system may create non-functional SharePoint website.
When you change the physical server name the SharePoint is already connected to the SQL instance of old computer name (OldServerName/SQLInstance) and [...]
SQL SERVER - FIX : ERROR : Could Not Connect to SQL Server - TDSSNIClient initialization failed with error 0×7e, status code 0×60
Posted in Author Pinal, SQL, SQL Authority, SQL Error Messages, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology on August 30, 2008 | No Comments »
This is a very common error faced by so many people and I get lots of questions regarding this error. This error occurs due to many reasons and I have already posted few solutions on this error, see if you can find your solution here
SQL SERVER - Fix : Error : 40 - could [...]
SQL SERVER - Fix : Error : 40 - could not open a connection to SQL server - Fix Connection Problems of SQL Server
Posted in Author Pinal, SQL, SQL Authority, SQL Error Messages, SQL Query, SQL Scripts, SQL Security, SQL Server, SQL Tips and Tricks, T SQL, Technology on August 24, 2008 | 2 Comments »
Everyday I get lots of question regarding error :
An error has occurred while establishing a connection to the server when connecting to SQL server 2005, this failure may be caused by the fact that under default settings SQL server does not allow remote connection. ( provider: Named Pipes Provider, error: 40 - could not open [...]
SQL SERVER - Detailed Explanation of Transaction Lock, Lock Type, Avoid Locks
Posted in Author Pinal, SQL, SQL Authority, SQL Documentation, SQL Error Messages, SQL Performance, SQL Query, SQL Scripts, SQL Security, SQL Server, SQL Tips and Tricks, T SQL, Technology, tagged SQL Locks, SQL Transactions on August 18, 2008 | 9 Comments »
Loyal reader of this blog and “Great SQL Expert” Imran Mohammed always have good attitude towards any problem. Many times his answers very interesting to read and details are very accurate. I came across his two interesting comment on this blog and I would like to share this all of you.
Priyank asked following question.
Can u [...]
SQL SERVER - Fix : Error : 1326 Cannot connect to Database Server Error: 40 - Could not open a connection to SQL Server
Posted in Author Pinal, Database, SQL, SQL Authority, SQL Error Messages, SQL Query, SQL Security, SQL Server, SQL Tips and Tricks, T SQL, Technology on August 9, 2008 | 9 Comments »
If you are receiving following error:
TITLE: Connect to Server
——————————
Cannot connect to Database Server.
——————————
ADDITIONAL INFORMATION:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: [...]
SQL SERVER - FIX - ERROR : 9004 An error occurred while processing the log for database. If possible, restore from backup. If a backup is not available, it might be necessary to rebuild the log.
Posted in SQL, SQL Authority, SQL Backup and Restore, SQL Data Storage, SQL Error Messages, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology on July 21, 2008 | 2 Comments »
ERROR : 9004 An error occurred while processing the log for database.
If possible, restore from backup.
If a backup is not available, it might be necessary to rebuild the log.
If you receive above error it means you are in great trouble. This error occurs when database is attempted to attach and it does not get attached. [...]
SQL Server - Fix - Error : 9692 The _MSG protocol transport cannot listen on port because it is in use by another process.
Posted in SQL, SQL Authority, SQL Error Messages, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology, tagged Service Broker on July 19, 2008 | No Comments »
If you face following error the solution of this is very simple.
Error : 9692 The _MSG protocol transport cannot listen on port because it is in use by another process.
Above error comes up with Service Broker. Service Broker is used to send Database Emails. Read more about SQL SERVER - Introduction to Service Broker.
Solution/Fix/WorkAround:
Option 1:
Run [...]
SQL SERVER - Orphaned MS DTC Transaction Information
Posted in SQL, SQL Authority, SQL Documentation, SQL Error Messages, SQL Performance, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology on May 14, 2008 | 3 Comments »
Few days ago, one of our application was crashing IIS application pool because of unhandled exception. After researched we figured out the case of it was orphaned MS DTC transaction.
When multiple connections are operating over one MS DTC transaction, this problem sometime shows up. As many connection are working none of them try to roll [...]
SQL SERVER - FIX : Error 7311 - You may receive an error message when you try to run distributed queries from a 64-bit SQL Server 2005 client to a linked 32-bit SQL Server 2000 server or to a linked SQL Server 7.0 server
Posted in SQL, SQL Authority, SQL Error Messages, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology on May 9, 2008 | 1 Comment »
Following email is received from SQL Server Expert Roy Cheung. He faced issue of creating and running distributed queries from a 64-bit SQL Server 2005 client to a linked 32-bit SQL Server 2000 server. He has found solution and would like to share with SQLAuthority Blog Readers.
Hi Pinal,
Recently, I’ve a problem on create and [...]
SQL SERVER - FIX : Error : 3702 Cannot drop database because it is currently in use - Part 2
Posted in Author Pinal, SQL, SQL Authority, SQL Error Messages, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology on March 13, 2008 | No Comments »
Following error is very generic error and I have previously written SQL SERVER - FIX : Error : 3702 Cannot drop database because it is currently in use.
Msg 3702, Level 16, State 3, Line 2
Cannot drop database “DataBaseName” because it is currently in use.
One of the reader Dave have posted additional information in comments. [...]
SQLAuthority News - 500th Post - An Interesting Journey with SQL Server
Posted in About Me, Author Pinal, Best Practices, DBA, Data Warehousing, Database, SQL, SQL Add-On, SQL Authority, SQL Backup and Restore, SQL Coding Standards, SQL Constraint and Keys, SQL Cursor, SQL Data Storage, SQL DateTime, SQL Documentation, SQL Download, SQL Error Messages, SQL Function, SQL Humor, SQL Index, SQL Interview Questions and Answers, SQL Joins, SQL Performance, SQL Query, SQL Scripts, SQL Security, SQL Server, SQL Server DBCC, SQL Stored Procedure, SQL Tips and Tricks, SQL Trigger, SQL Utility, SQLAuthority, SQLAuthority Author Visit, SQLAuthority Book Review, SQLAuthority News, SQLAuthority Website Review, Software Development, T SQL, Technology on March 7, 2008 | 9 Comments »
I am very pleased to write my 500th post. After 500 posts, I still have same feeling when I wrote first post on this blog. I would like to thank my family for their continuous support in writing this blog. Most of all I want to thank all of YOU for being wonderful readers of [...]
SQL SERVER - Dynamic Case Statement - FIX : ERROR 156 : Incorrect syntax near the keyword
Posted in Author Pinal, SQL, SQL Authority, SQL Error Messages, SQL Performance, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology on February 28, 2008 | 1 Comment »
One of my friend sent me query asking me how to generate dynamic case statements in SQL. Everytime he tries to run following query he is getting Error 156 : Incorrect syntax near the keyword. He was frustrated with following two queries. There are two different ways to solve the problem when user want to
Incorrect [...]
SQL SERVER - 2005 - FIX: Error message when you run a query against a table that does not have a clustered index in SQL Server 2005: “A severe error occurred on the current command”
Posted in SQL, SQL Authority, SQL Error Messages, SQL Index, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology on February 19, 2008 | 1 Comment »
In SQL Server 2005 while testing Indexes I had created a table with one non clustered index only. I did not create any clustered index on table. After that I ran SELECT statement, it gave me following error. I was very surprised when I looked at error. It says Msg 0, what it means is [...]
SQL SERVER - How to Escape Single Quotes - Fix: Error: 105 Unclosed quotation mark after the character string ‘
Posted in Author Pinal, SQL, SQL Authority, SQL Error Messages, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology on February 17, 2008 | 2 Comments »
Jr. Developer asked me other day how to escape single quote?
User can escape single quote using two single quotes (NOT double quote).
Following T-SQL Script will give error
USE AdventureWorks
GO
SELECT *
FROM Person.Address
WHERE City = ‘Villeneuve-d’Ascq’
GO
Resultset:
Error: 105 Unclosed quotation mark after the character string ‘
To fix the error mentioned above, escape single quotes with two single quotes [...]
-
About Pinal Dave
Pinalkumar Dave is Microsoft SQL Server MVP and author of over 700 SQL Server articles. He has five years experience as Principal Database Administrator in MS SQL Server 2008/2005, .NET (C#) and ColdFusion MX. He has a Masters of Science degree in Computer Networks, along with MCDBA, MCAD(.NET) and ColdFusion Advanced MX Certifications.
MVP Profile

-
Blog Stats
- 5,224,271 Readers
-
SQLAuthority Links

My Homepage
My Resume
My Other Blog
SQL Server Mag Articles
--------------------
SQLAuthority
Best Articles
Favorite Articles
SQL Script Bank
Top Downloads
--------------------
SQL Interview Q & A
SQL Coding Standards
SQL FAQ Download
--------------------
SQL Random Article
Search SQLAuthority
Subscribe Email Update
SQLAuthority Feed
Translate SQLAuthority
--------------------
Jobs @ SQLAuthority
Find Your IP
Categories
- About Me (35)
- Author Pinal (509)
- Best Practices (39)
- Data Warehousing (25)
- Database (226)
- DBA (198)
- Main (67)
- Outsourcing Technology (4)
- Software Development (73)
- SQL (777)
- SQL Add-On (65)
- SQL Authority (777)
- SQL Backup and Restore (48)
- SQL Coding Standards (84)
- SQL Constraint and Keys (45)
- SQL Cursor (63)
- SQL Data Storage (19)
- SQL DateTime (33)
- SQL DMV (1)
- SQL Documentation (280)
- SQL Download (419)
- SQL Error Messages (360)
- SQL Function (96)
- SQL Humor (21)
- SQL Index (67)
- SQL Interview Questions and Answers (57)
- SQL Joins (357)
- SQL MVP (20)
- SQL Performance (406)
- SQL Puzzle (7)
- SQL Query (777)
- SQL Scripts (512)
- SQL Security (365)
- SQL Server (777)
- SQL Server DBCC (253)
- SQL Stored Procedure (131)
- SQL Tips and Tricks (777)
- SQL Trigger (40)
- SQL User Group (11)
- SQL Utility (55)
- SQL XML (2)
- SQLAuthority (17)
- SQLAuthority Author Visit (32)
- SQLAuthority Book Review (29)
- SQLAuthority News (149)
- SQLAuthority Website Review (18)
- T SQL (777)
- Technology (777)
-
Top Posts
- SQL SERVER - Insert Data From One Table to Another Table - INSERT INTO SELECT - SELECT INTO TABLE
- SQL SERVER - Insert Multiple Records Using One Insert Statement - Use of UNION ALL
- SQL SERVER - 2005 - Create Script to Copy Database Schema and All The Objects - Stored Procedure, Functions, Triggers, Tables, Views, Constraints and All Other Database Objects
- SQL SERVER - Import CSV File Into SQL Server Using Bulk Insert - Load Comma Delimited File Into SQL Server
- SQL SERVER - Retrieve Current Date Time in SQL Server CURRENT_TIMESTAMP, GETDATE(), {fn NOW()}
- SQL SERVER - Restore Database Backup using SQL Script (T-SQL)
- SQL Server Interview Questions and Answers Complete List Download
- SQL SERVER - Convert Text to Numbers (Integer) - CAST and CONVERT
- SQL SERVER - 2005 List All Tables of Database
- SQL SERVER - TRIM() Function - UDF TRIM()
- SQL SERVER - Fix : Error: 18452 Login failed for user '(null)'. The user is not associated with a trusted SQL Server connection.
- SQL SERVER - Shrinking Truncate Log File - Log Full
-
Recent Posts
- SQL SERVER - Simple Use of Cursor to Print All Stored Procedures of Database Including Schema
- SQLAuthority News - SQL Server White Paper: SQL Server 2008 Compliance Guide
- SQL SERVER - Simple Use of Cursor to Print All Stored Procedures of Database
- SQLAuthority News - Author Visit - South Asia MVP Open Day 2008 - Goa - Group Photo
- SQLAuthority News - Author Visit - South Asia MVP Open Day 2008 - Goa - Day 3
- SQLAuthority News - Author Visit - South Asia MVP Open Day 2008 - Goa - Day 2
- SQLAuthority News - Author Visit - South Asia MVP Open Day 2008 - Goa - Day 1
- SQLAuthority News - Author Visit - South Asia MVP Open Day 2008 - Goa - Link List
- SQLAuthority News - Author Visit - South Asia MVP Open Day 2008 - Goa
- SQLAuthority News - RML Utilities - Usage and Additional Help
- SQLAuthority News - Download RML Utilities for SQL Server
- SQL SERVER - Delete Backup History - Cleanup Backup History
- SQL SERVER - Check Database Integrity for All Databases of Server
- SQLAuthority News - SQL Server 2008 Book Online Updated in October 2008
- SQL SERVER 2008 - Connect Visual Studio 2005 Patch Download
-
Recent Comments
- Bob Zagars on SQL SERVER - Better Performance - LEFT JOIN or NOT IN?
- COBRASoft on SQL SERVER - 2005 - Database Table Partitioning Tutorial - How to Horizontal Partition Database Table
- SQL SERVER - Simple Use of Cursor to Print All Stored Procedures of Database Including Schema Journey to SQL Authority with Pinal Dave on SQL SERVER - Simple Use of Cursor to Print All Stored Procedures of Database
- Steve Hatchard on SQL SERVER - Difference between DISTINCT and GROUP BY - Distinct vs Group By
- Igor on SQL SERVER - FIX : Error 945 Database cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server error log for details
- Rosales on SQL SERVER - Retrieve Current Date Time in SQL Server CURRENT_TIMESTAMP, GETDATE(), {fn NOW()}
- Kunal Kumar on Contact Me
- Lutz Mueller on SQL SERVER - SELECT 1 vs SELECT * - An Interesting Observation
- Steve Walker on SQL SERVER - 2005 - Create Script to Copy Database Schema and All The Objects - Stored Procedure, Functions, Triggers, Tables, Views, Constraints and All Other Database Objects
- Rahul on SQL SERVER - 2005 - Display Fragmentation Information of Data and Indexes of Database Table
- Rahul on SQL SERVER - 2005 - Display Fragmentation Information of Data and Indexes of Database Table
- Makarov on Contact Me
- babu on SQL SERVER - Do Not Store Images in Database - Store Location of Images (URL)
- paresh13 on SQL SERVER - 2005 List All Tables of Database
- Manish on SQL SERVER - 2005 - Create Script to Copy Database Schema and All The Objects - Stored Procedure, Functions, Triggers, Tables, Views, Constraints and All Other Database Objects
Archives
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
-
Pages
-
Latest Articles
-
pinaldave
- SQL SERVER - Simple Use of Cursor to Print All Stored Procedures of Database Including Schema
- SQLAuthority News - SQL Server White Paper: SQL Server 2008 Compliance Guide
- SQL SERVER - Simple Use of Cursor to Print All Stored Procedures of Database
- SQLAuthority News - Author Visit - South Asia MVP Open Day 2008 - Goa - Group Photo
- SQLAuthority News - Author Visit - South Asia MVP Open Day 2008 - Goa - Day 3
- SQLAuthority News - Author Visit - South Asia MVP Open Day 2008 - Goa - Day 2
- SQLAuthority News - Author Visit - South Asia MVP Open Day 2008 - Goa - Day 1
- SQLAuthority News - Author Visit - South Asia MVP Open Day 2008 - Goa - Link List
- SQLAuthority News - Author Visit - South Asia MVP Open Day 2008 - Goa
- SQLAuthority News - RML Utilities - Usage and Additional Help
-
-
Click Cloud
About Me Author Pinal Best Practices Database Data Warehousing DBA Main Outsourcing Technology Software Development SQL SQL Add-On SQLAuthority SQL Authority SQLAuthority Author Visit SQLAuthority Book Review SQLAuthority News SQLAuthority Website Review SQL Backup and Restore SQL Coding Standards SQL Constraint and Keys SQL Cursor SQL Data Storage SQL DateTime SQL DMV SQL Documentation SQL Download SQL Error Messages SQL Function SQL Humor SQL Index SQL Interview Questions and Answers SQL Joins SQL MVP SQL Performance SQL Puzzle SQL Query SQL Scripts SQL Security SQL Server SQL Server DBCC SQL Stored Procedure SQL Tips and Tricks SQL Trigger SQL User Group SQL Utility SQL XML Technology T SQL


