tagged [tsql]

How to convert Seconds to HH:MM:SS using T-SQL

How to convert Seconds to HH:MM:SS using T-SQL The situation is you have a value in Seconds (XXX.XX), and you want to convert to HH:MM:SS using T-SQL. Example: -

11 Aug at 19:46

Execute a SQL Stored Procedure and process the results

Execute a SQL Stored Procedure and process the results In VB.NET, how do I do the following? 1. Execute a Stored Procedure 2. Read through the DataTable returned

GRANT EXECUTE to all stored procedures

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

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

Should I use != or for not equal in T-SQL? I have seen `SQL` that uses both `!=` and `` for . What is the preferred syntax and why? I like `!=`, because `` reminds me of `Visual Basic`.

26 Mar at 09:48

COALESCE Function in TSQL

COALESCE Function in TSQL Can someone explain how the COALESCE function in TSQL works? The syntax is as follows > COALESCE(x, y) The MSDN document on this function is pretty vague

13 Nov at 18:25

How do I get list of all tables in a database using TSQL?

How do I get list of all tables in a database using TSQL? What is the best way to get the names of all of the tables in a specific database on SQL Server?

7 Dec at 02:36

Query to list all 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 exclude system stored procedures, that would be even more h...

27 May at 16:14

Adding a month to a date in T SQL

Adding a month to a date in T SQL How can I add one month to a date that I am checking under the where clause?

16 Aug at 11:35

SQL Query with NOT LIKE IN

SQL Query with NOT LIKE IN Please help me to write a sql query with the conditions as 'NOT LIKE IN' Getting error.

22 Feb at 10:55

Find a value anywhere in a database

Find a value anywhere in a database Given a number, how do I discover in what table and column it could be found within? I don't care if it's fast, it just needs to work.

26 Apr at 14:25

How to find column names for all tables in all databases in SQL Server

How to find column names for all tables in all databases in SQL Server I want to find all column names in all tables . Is there a query that can do that for me?

How to wait for 2 seconds?

How to wait for 2 seconds? How does one cause a delay in execution for a specified number of seconds? This doesn't do it: What is the correct format?

25 Apr at 15:37

SqlDataReader executing TSQL is faster than management studio executing TSQL

SqlDataReader executing TSQL is faster than management studio executing TSQL If i run a TSQL Statement in management studio and run the same the query through SqlDataReader, the latter gives the resul...

12 Mar at 16:48

How do I move a table into a schema in T-SQL

How do I move a table into a schema in T-SQL I want to move a table into a specific Schema using T-SQL? I am using SQL Server 2008.

Why do you create a View in a database?

Why do you create a View in a database? When and Why does some one decide that they need to create a View in their database? Why not just run a normal stored procedure or select?

14 Aug at 15:26

Using Stored Procedure into Select (T-SQL)

Using Stored Procedure into Select (T-SQL) I need to access the result of a stored procedure within a select statement, i.e.: in SQL_Server 2005.

What is the best way to store a money value in the database?

What is the best way to store a money value in the database? I need to store a couple of money related fields in the database but I'm not sure which data type to use between and .

25 Apr at 14:26

How do I make a composite key with SQL Server Management Studio?

How do I make a composite key with SQL Server Management Studio? How do I make a composite key with SQL Server Management Studio? I want two columns to form the identity (unique) for a table

3 Sep at 07:48

T-SQL Substring - Last 3 Characters

T-SQL Substring - Last 3 Characters Using T-SQL, how would I go about getting the characters of a varchar column? So the column text is `IDS_ENUM_Change_262147_190` and I need `190`

30 Nov at 21:10

How can I do a Union all in Entity Framework LINQ To Entities?

How can I do a Union all in Entity Framework LINQ To Entities? I came across a scenario where I had to use Union all, how can I achieve so in LINQ to entities ?

Convert date to YYYYMM format

Convert date to YYYYMM format I want to select value = `201301` it returns `20131` what is the normal way to do this?

9 Nov at 05:24

What are the use cases for selecting CHAR over VARCHAR in SQL?

What are the use cases for selecting CHAR over VARCHAR in SQL? I realize that CHAR is recommended if all my values are fixed-width. But, so what? Why not just pick VARCHAR for all text fields just to ...

4 Dec at 23:11

How do you change the datatype of a column in SQL Server?

How do you change the datatype of a column in SQL Server? I am trying to change a column from a `varchar(50)` to a `nvarchar(200)`. What is the SQL command to alter this table?

Subtract two dates in SQL and get days of the result

Subtract two dates in SQL and get days of the result ``` Select I.Fee From Item I WHERE GETDATE() - I.DateCreated

2 Jan at 09:19

SQL Server Regular expressions in T-SQL

SQL Server Regular expressions in T-SQL Is there any regular expression library written in T-SQL (no CLR, no extended `SP`, pure T-SQL) for SQL Server, and that should work with shared hosting? Edit: ...

20 Nov at 18:37