Top "Sql-server-2005" questions

Use this tag for questions specific to the 2005 version of Microsoft's SQL Server.

SQL update query using joins

I have to update a field with a value which is returned by a join of 3 tables. Example: select im.…

sql sql-server tsql sql-server-2005 sql-update
How to avoid the "divide by zero" error in SQL?

I have this error message: Msg 8134, Level 16, State 1, Line 1 Divide by zero error encountered. What is the best way to …

sql sql-server sql-server-2005 sql-server-2008
How to get Time from DateTime format in SQL?

I want to get only Time from DateTime column using SQL query using SQL Server 2005 and 2008 Default output: AttDate == 2011-02…

sql-server tsql sql-server-2005 datetime
The multi-part identifier could not be bound

I've seen similar errors on SO, but I don't find a solution for my problem. I have a SQL query …

sql sql-server sql-server-2005
Convert a string to int using sql query

How to convert a string to integer using SQL query on SQL Server 2005?

sql sql-server-2005
Insert multiple rows WITHOUT repeating the "INSERT INTO ..." part of the statement?

I know I've done this before years ago, but I can't remember the syntax, and I can't find it anywhere …

sql-server tsql sql-server-2005 insert
SQL Server query to find all permissions/access for all users in a database

I would like to write a query on a sql 2008 that will report all the users that have access to …

sql-server sql-server-2005 sql-server-2008
Best way to do nested case statement logic in SQL Server

I'm writing an SQL Query, where a few of the columns returned need to be calculated depending on quite a …

sql sql-server sql-server-2005 select nested
Cannot truncate table because it is being referenced by a FOREIGN KEY constraint?

Using MSSQL2005, can I truncate a table with a foreign key constraint if I first truncate the child table (the …

sql-server sql-server-2005 tsql truncate foreign-keys
How to check which locks are held on a table

How can we check which database locks are applied on which rows against a query batch? Any tool that highlights …

sql sql-server database performance sql-server-2005