SELECT ordr_num as num, ordr_date as date,
CASE WHEN @status<>'Cancelled' THEN ordr_ship_with ELSE NULL END as shipwith
FROM order
WHERE ordr_num = @ordrNum
Related Contents:
- Function vs. Stored Procedure in SQL Server
- How can I get column names from a table in SQL Server?
- How can I list all foreign keys referencing a given table in SQL Server?
- How to select all records from one table that do not exist in another table?
- OR is not supported with CASE Statement in SQL Server
- What is the meaning of the prefix N in T-SQL statements and when should I use it?
- Select statement to find duplicates on certain fields
- T-SQL Cast versus Convert
- When to use Common Table Expression (CTE)
- How do I create a foreign key in SQL Server?
- How can a LEFT OUTER JOIN return more records than exist in the left table?
- Change Schema Name Of Table In SQL
- How to calculate age (in years) based on Date of Birth and getDate()
- CROSS JOIN vs INNER JOIN in SQL
- Difference between CTE and SubQuery?
- How to report an error from a SQL Server user-defined function
- Getting result of dynamic SQL into a variable for sql-server
- How to assign an exec result to a sql variable?
- unresolved reference to object [INFORMATION_SCHEMA].[TABLES]
- How to force a SQL Server 2008 database to go Offline
- Aggregate function in an SQL update query?
- COALESCE Function in TSQL
- SQL Row_Number() function in Where Clause
- Maximum size for a SQL Server Query? IN clause? Is there a Better Approach [duplicate]
- Declare Variable for a Query String
- SQL Server Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, =
- How do you update a DateTime field in T-SQL?
- ORDER BY items must appear in the select list if SELECT DISTINCT is specified
- Conditional WHERE clause in SQL Server
- SQL Server Invalid Column name after adding new column
- What is the equivalent of the Oracle “Dual” table in MS SqlServer?
- Limit on the WHERE col IN (…) condition
- How to send email from SQL Server?
- Can an INNER JOIN offer better performance than EXISTS
- How do I create a comma-separated list using a SQL query?
- How to retrieve records for last 30 minutes in MS SQL?
- Comparing two bitmasks in SQL to see if any of the bits match
- What’s the SQL national character (NCHAR) datatype really for?
- T-SQL: Selecting Column Based on MAX(Other Column)
- T-SQL split string based on delimiter
- DateTimeOffset.Now in T-SQL
- Where value in column containing comma delimited values
- Using DISTINCT and TOP in the same query
- SQL: How do I use parameter for TOP like in SELECT TOP @amount? [duplicate]
- Query error with ambiguous column name in SQL [duplicate]
- How do I list user defined types in a SQL Server database?
- When to use EXCEPT as opposed to NOT EXISTS in Transact SQL?
- SQL Server Left Join With ‘Or’ Operator
- In SQL Azure how can I create a read only user
- Incorrect syntax near the keyword ‘with’…previous statement must be terminated with a semicolon