About 13,700,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 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, …

  5. How can I do something like: USE @databaseName

    Sep 24, 2010 · You'd have to use dynamic SQL if you want to do it dynamically like that. Would mean anything you want to execute under the context of that DB, you'd need to include in the dynamic SQL …

  6. How to put more than 1000 values into an Oracle IN clause

    Dec 30, 2008 · a list of ids is extracted from the database, and then used in a subsequent SQL statement (perhaps later or on another server or whatever). In this case, the answer is to never …

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

    Sep 7, 2009 · 60 Oracle 10g has functions that allow the use of POSIX-compliant regular expressions in SQL: REGEXP_LIKE REGEXP_REPLACE REGEXP_INSTR REGEXP_SUBSTR See the Oracle …

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

  9. 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 [' + @

  10. 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 '%' + @