Top "Tsql" questions

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

Function vs. Stored Procedure in SQL Server

I've been learning Functions and Stored Procedure for quite a while but I don't know why and when I should …

sql sql-server tsql stored-procedures sql-function
How can I list all foreign keys referencing a given table in SQL Server?

I need to remove a highly referenced table in a SQL Server database. How can I get a list of …

sql sql-server tsql
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
Truncate (not round) decimal places in SQL Server

I'm trying to determine the best way to truncate or drop extra decimal places in SQL without rounding. For example: …

sql sql-server tsql rounding
SQL Server: Difference between PARTITION BY and GROUP BY

I've been using GROUP BY for all types of aggregate queries over the years. Recently, I've been reverse-engineering some code …

sql-server tsql aggregate-functions window-functions
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
How do I find a stored procedure containing <text>?

I need to search a SQL server 2008 for stored procedures containing where maybe the name of a database field or …

sql-server sql-server-2008 tsql stored-procedures
Query to list all stored procedures

What query can return the names of all the stored procedures in a SQL Server database If the query could …

sql-server tsql
How to write a foreach in SQL Server?

I am trying to achieve something along the lines of a for-each, where I would like to take the Ids …

sql-server tsql
How can foreign key constraints be temporarily disabled using T-SQL?

Are disabling and enabling foreign key constraints supported in SQL Server? Or is my only option to drop and then …

sql-server tsql foreign-keys constraints