About 2,730,000 results
Open links in new tab
  1. 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 '%' + @

  2. How do I perform an IF...THEN in an SQL SELECT?

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

  3. SQL - Select first 10 rows only? - Stack Overflow

    Dec 12, 2009 · How do I select only the first 10 results of a query? I would like to display only the first 10 results from the following query: SELECT a.names, COUNT(b.post_title) AS num FROM

  4. sql - Incorrect syntax near '' - Stack Overflow

    I'm trying to run the following fairly simple query in SQL Server Management Studio: SELECT TOP 1000 * FROM master.sys.procedures as procs left join master.sys.parameters as params on p...

  5. Remove all spaces from a string in SQL Server - Stack Overflow

    May 3, 2012 · What is the best way to remove all spaces from a string in SQL Server 2008? LTRIM(RTRIM(' a b ')) would remove all spaces at the right and left of the string, but I also need to …

  6. SQL to find the number of distinct values in a column

    SQL to find the number of distinct values in a column Asked 17 years, 1 month ago Modified 2 years, 7 months ago Viewed 825k times

  7. Search text in stored procedure in SQL Server - Stack Overflow

    Feb 5, 2013 · I want to search a text from all my database stored procedures. I use the below SQL: SELECT DISTINCT o.name AS Object_Name, o.type_desc FROM sys.sql_modules m INNER JOIN ...

  8. How do I rename a column in a database table using SQL?

    Oct 6, 2008 · 155 If I wish to simply rename a column (not change its type or constraints, just its name) in an SQL database using SQL, how do I do that? Or is it not possible? This is for any database …

  9. SQL Server tables: what is the difference between @, # and

    Feb 8, 2010 · In SQL Server, what is the difference between a @ table, a # table and a ## table?

  10. Convert Month Number to Month Name Function in SQL

    Oct 9, 2008 · SQL Server nowadays can get the ordinalnummer of a comma separated value of values, using the STRING_SPLIT function Also the names of the month are already stored in SQL Server …