About 12,200,000 results
Open links in new tab
  1. How do I perform an IF...THEN in an SQL SELECT?

    Sep 15, 2008 · The CASE statement is the closest to IF in SQL and is supported on all versions of SQL Server. SELECT CAST( CASE WHEN Obsolete = 'N' or InStock = 'Y' THEN 1 ELSE 0 …

  2. t sql - What is the use of GO in SQL Server Management Studio ...

    The GO command isn't a Transact-SQL statement, but a special command recognized by several MS utilities including SQL Server Management Studio code editor. The GO command is used …

  3. SQL query to insert datetime in SQL Server - Stack Overflow

    SQL query to insert datetime in SQL Server Asked 13 years ago Modified 2 years, 7 months ago Viewed 1.5m times

  4. When should I use semicolons in SQL Server? - Stack Overflow

    While checking some code on the web and scripts generated by SQL Server Management Studio I have noticed that some statements are ended with a semicolon. So when should I use it?

  5. How do I UPDATE from a SELECT in SQL Server? - Stack Overflow

    Feb 25, 2010 · 4339 In SQL Server, it is possible to insert rows into a table with an INSERT.. SELECT statement: INSERT INTO Table (col1, col2, col3) SELECT col1, col2, col3 FROM …

  6. What is the use of the square brackets [] in sql statements?

    Whatever word becomes colourful in your SQL management studio, should be surrounded by brackets if you want to use them as column / table / sp / etc. names. In MySQL angled single …

  7. Combining "LIKE" and "IN" for SQL Server - Stack Overflow

    Combining "LIKE" and "IN" for SQL Server [duplicate] Asked 15 years, 10 months ago Modified 1 year, 8 months ago Viewed 1.4m times

  8. SQL Server - stop or break execution of a SQL script

    Mar 19, 2009 · Is there a way to immediately stop execution of a SQL script in SQL server, like a "break" or "exit" command? I have a script that does some validation and lookups before it …

  9. SQL Server CASE .. WHEN .. IN statement - Stack Overflow

    May 18, 2011 · On SQL server 2005 I am trying to query this select statement SELECT AlarmEventTransactionTableTable.TxnID, CASE AlarmEventTransactions.DeviceID WHEN …

  10. sql - Exclude a column using SELECT * [except columnA] FROM …

    FROM TableA This very powerful SQL syntax avoids a long list of columns that must be constantly updated due to table column name changes. This functionality is missing in the …