Top "Tsql" questions

T-SQL (Transact Structured Query Language) is the extension of SQL functionality supported by Sybase ASE and Microsoft SQL Server.

Should I use != or <> for not equal in T-SQL?

I have seen SQL that uses both != and <> for not equal. What is the preferred syntax and why? …

sql sql-server tsql
Getting only Month and Year from SQL DATE

I need to access only Month.Year from Date field in SQL Server.

sql sql-server tsql
Convert Month Number to Month Name Function in SQL

I have months stored in SQL Server as 1,2,3,4,...12. I would like to display them as January,February etc. Is there …

sql sql-server tsql sql-server-2005
SQL Server query - Selecting COUNT(*) with DISTINCT

In SQL Server 2005 I have a table cm_production that lists all the code that's been put into production. The …

sql sql-server sql-server-2005 tsql
Sql Server string to date conversion

I want to convert a string like this: '10/15/2008 10:06:32 PM' into the equivalent DATETIME value in Sql Server. In Oracle, …

sql-server tsql datetime sql-server-2005 string-to-datetime
Update a table using JOIN in SQL Server?

I want to update a column in a table making a join on other table e.g.: UPDATE table1 a …

sql-server tsql join sql-update
How to calculate percentage with a SQL statement

I have a SQL Server table that contains users & their grades. For simplicity's sake, lets just say there are 2 …

sql sql-server tsql
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
Best way to get identity of inserted row?

What is the best way to get IDENTITY of inserted row? I know about @@IDENTITY and IDENT_CURRENT and SCOPE_…

sql sql-server tsql
How to select all records from one table that do not exist in another table?

table1 (id, name) table2 (id, name) Query: SELECT name FROM table2 -- that are not in table1 already

sql sql-server tsql