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

    Sep 15, 2008 · 2059 The CASE statement is the closest to IF in SQL and is supported on all versions of SQL Server.

  2. sql - Limit on the WHERE col IN (...) condition - Stack Overflow

    This is my goto solution. Works well called from javascript, C#. The SQL statement ends up containing multiple INSERTs to the table type instance before the query.

  3. 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 …

  4. SQL query to select dates between two dates - Stack Overflow

    Feb 26, 2011 · I have a start_date and end_date. I want to get the list of dates in between these two dates. Can anyone help me pointing the mistake in my query. select Date,TotalAllowance …

  5. sql - How to use index in select statement? - Stack Overflow

    Jul 6, 2011 · Lets say in the employee table, I have created an index(idx_name) on the emp_name column of the table. Do I need to explicitly specify the index name in select clause …

  6. SQL: IF clause within WHERE clause - Stack Overflow

    Sep 18, 2008 · END ELSE BEGIN SELECT * FROM Table WHERE OrderNumber LIKE '%' + @OrderNumber END 3) Using a long string, compose your SQL statement conditionally, and …

  7. 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 …

  8. How can I introduce multiple conditions in LIKE operator?

    Sep 7, 2009 · Excellent. Exactly what I needed to remove hard-coded values from my code. My string masks are stored in a configuration table. The old code had each one hard-coded. This …

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

    Feb 25, 2010 · 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 other_table …

  10. 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 …