About 14,900,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.

  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 to group …

  3. Difference between a statement and a query in SQL

    Jan 8, 2016 · An SQL-statement is a string of characters that conforms to the format and syntax rules specified in this international standard. A query is a statement that returns a recordset (possibly empty).

  4. sql server - PRINT statement in T-SQL - Stack Overflow

    Nov 6, 2008 · Why does the PRINT statement in T-SQL seem to only sometimes work? What are the constraints on using it? It seems sometimes if a result set is generated, it becomes a null function, I …

  5. SQL use CASE statement in WHERE IN clause - Stack Overflow

    Oct 9, 2013 · SQL use CASE statement in WHERE IN clause Asked 12 years, 2 months ago Modified 5 years, 1 month ago Viewed 189k times

  6. SQL Case Expression Syntax? - Stack Overflow

    Aug 7, 2008 · Search conditions are detailed in the Transact-SQL User’s Guide. then precedes the expression that specifies a result value of case. expression is a column name, a constant, a function, …

  7. python - How do I get a raw, compiled SQL query from a SQLAlchemy ...

    SQLAlchemy’s facilities to coerce Python values into direct SQL string values are not secure against untrusted input and do not validate the type of data being passed. Always use bound parameters …

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

    Sep 18, 2008 · Is it possible to use an IF clause within a WHERE clause in MS SQL? Example: WHERE IF IsNumeric(@OrderNumber) = 1 OrderNumber = @OrderNumber ELSE OrderNumber LIKE '%' + @

  9. How to test an SQL Update statement before running it?

    Jun 13, 2012 · 138 In some cases, running an UPDATE statement in production can save the day. However a borked update can be worse than the initial problem. Short of using a test database, what …

  10. sql server - sql use statement with variable - Stack Overflow

    I'm trying to switch the current database with a SQL statement. I have tried the following, but all attempts failed: -- 1 USE @DatabaseName -- 2 EXEC sp_sqlexec @Sql -- where @Sql = 'USE [' + @