About 2,520,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: 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 …

  3. sql - Copy data into another table - Stack Overflow

    How to copy/append data from one table into another table with same schema in SQL Server? Edit: let's say there is a query select * into table1 from table2 where 1=1 which creates table1 …

  4. How to set variable from a SQL query? - Stack Overflow

    I'm trying to set a variable from a SQL query: declare @ModelID uniqueidentifer Select @ModelID = select modelid from models where areaid = 'South Coast' Obviously I'm not doing this right …

  5. sql server - SQL MAX of multiple columns? - Stack Overflow

    Mar 8, 2012 · How do you return 1 value per row of the max of several columns: TableName [Number, Date1, Date2, Date3, Cost] I need to return something like this: [Number, …

  6. sql - Efficiently convert rows to columns - Stack Overflow

    I'm looking for an efficient way to convert rows to columns in SQL Server, I heard that PIVOT is not very fast, and I need to deal with lot of records. This is my example: Id Value ColumnName …

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

  8. Login to Microsoft SQL Server Error: 18456 - Stack Overflow

    Jul 8, 2016 · I am getting this error while trying to connect to the SQL Server. Microsoft SQL Server Error: 18456 Can anybody tell me what the error code means?

  9. sql - Find all tables containing column with specified name - Stack ...

    @Revious INFORMATION_SCHEMA views included in SQL Server comply with the ISO standard definition for the INFORMATION_SCHEMA., sys.columns, sys.tables is Microsoft Sql Server …

  10. sql - Selecting COUNT (*) with DISTINCT - Stack Overflow

    In SQL Server 2005 I have a table cm_production that lists all the code that's been put into production. The table has a ticket_number, program_type, program_name and push_number …