Top "Sql-server-2005" questions

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

How to get first character of a string in SQL?

I have a SQL column with a length of 6. Now want to take only the first char of that column. …

sql sql-server sql-server-2005
How to select date without time in SQL

When I select date in SQL it is returned as 2011-02-25 21:17:33.933. But I need only the Date part, that …

sql sql-server sql-server-2005
Check if a string contains a substring in SQL Server 2005, using a stored procedure

I've a string, @mainString = 'CATCH ME IF YOU CAN'. I want to check whether the word ME is inside @mainString. …

sql-server string tsql stored-procedures sql-server-2005
How to calculate age (in years) based on Date of Birth and getDate()

I have a table listing people along with their date of birth (currently a nvarchar(25)) How can I convert that …

sql-server sql-server-2005 select date
sql query to return differences between two tables

I am trying to compare two tables, SQL Server, to verify some data. I want to return all the rows …

sql sql-server sql-server-2008 sql-server-2005
How do I fix the error 'Named Pipes Provider, error 40 - Could not open a connection to' SQL Server'?

I can't seem to connect to my database from a site. I get this error: Named Pipes Provider, error: 40 - …

sql-server sql-server-2005 database-connectivity
Get top 1 row of each group

I have a table which I want to get the latest entry for each group. Here's the table: DocumentStatusLogs Table |…

sql tsql sql-server-2005 group-by greatest-n-per-group
INSERT statement conflicted with the FOREIGN KEY constraint - SQL Server

I am getting the following error. Could you please help me? Msg 547, Level 16, State 0, Line 1 The INSERT statement conflicted with …

sql sql-server sql-server-2005 foreign-keys
How do I check if a Sql server string is null or empty

I want to check for data, but ignore it if it's null or empty. Currently the query is as follows... …

sql-server-2005