Top "Tsql" questions

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

How can I group by date time column without taking time into consideration

I have a bunch of product orders and I'm trying to group by the date and sum the quantity for …

sql sql-server tsql sql-server-2008
Update query using Subquery in Sql Server

I have a simple table Structure like this: Table tempData ╔══════════╦═══════╗ ║ NAME ║ MARKS ║ ╠══════════╬═══════╣ ║ Narendra ║ 80 ║ ║ Ravi ║ 85 ║ ║ Sanjay ║ 90 ║ ╚══════════╩═══════╝ And I also have another …

sql sql-server tsql sql-update
How to select only the first rows for each unique value of a column

Let's say I have a table of customer addresses: CName | AddressLine ------------------------------- John Smith | 123 Nowheresville Jane Doe | 456 Evergreen Terrace John …

sql sql-server tsql select unique
Correct use of transactions in SQL Server

I have 2 commands and need both of them executed correctly or none of them executed. So I think I need …

sql sql-server database tsql transactions
How to check if a database exists in SQL Server?

What is the ideal way to check if a database exists on a SQL Server using TSQL? It seems multiple …

sql-server database tsql
Recover unsaved SQL query scripts

How to recover the unsaved scripts if the SSMS crashes / unsaved tab gets accidentally closed?

sql sql-server tsql sql-server-2012 ssms
SQL Server PRINT SELECT (Print a select query result)?

I am trying to print a selected value, is this possible? Example: PRINT SELECT SUM(Amount) FROM Expense

sql-server tsql select-query
GRANT EXECUTE to all stored procedures

Does the following command effectively give the user, "MyUser," permission to execute ALL stored procedures in the database? GRANT EXECUTE …

sql sql-server tsql sql-server-2008 permissions
Unpivot with column name

I have a table StudentMarks with columns Name, Maths, Science, English. Data is like Name, Maths, Science, English Tilak, 90, 40, 60 Raj, 30, 20, 10 …

sql sql-server sql-server-2008 tsql unpivot
varbinary to string on SQL Server

How to convert a column value from varbinary(max) to varchar in human-readable form?

sql sql-server sql-server-2005 tsql