<< < 1 2 3 4 5 6 7 8 9 10 11 > >>   Sort: Rank

NULLIF() - Replacing Given Values with NULL in SQL Server
How To Replace Given Values with NULL using NULLIF() in SQL Server Transact-SQL? Sometime you want to hide certain values by replacing them with NULL values. SQL Server offers you a nice function called NULLIF() to do this: NULLIF(expression, value) -- Returns NULL if "expression" equals to value" -...
2017-01-29, 371👍, 0💬

What Is a Boolean Value in SQL Server
What Is a Boolean Value in SQL Server Transact-SQL? A Boolean value indicates a condition in a state of TRUE or FALSE. In Transact-SQL language, there is not storage data type defined to store a Boolean value. So Boolean values can only exist temporarily as part of the execution of Transact-SQL expr...
2017-01-29, 311👍, 0💬

Boolean Values and Logical Operations in SQL Server Transact-SQL
Where to find answers to frequently asked questions on Boolean Values and Logical Operations in SQL Server Transact-SQL? Here is a list of frequently asked questions and their answers compiled by FYIcenter.com DBA team on Boolean Values and Logical Operations in SQL Server Transact-SQL. Clear answer...
2017-01-29, 308👍, 0💬

CASE - Conditional Expressions in SQL Server
What Are Conditional Expressions in SQL Server Transact-SQL? A conditional expression returns one of the given expressions based a specific condition. SQL Server 2005 offers the CASE operator to present a conditional expression with two syntaxes: 1. CASE with simple conditions CASE test_value WHEN v...
2017-01-29, 303👍, 0💬

What Are Comparison Operations in SQL Server
What Are Comparison Operations in SQL Server Transact-SQL? Comparison operations return Boolean values by comparing the relative positions of two operands. SQL server supports the following comparison operations: = (Equal To): Returns Boolean true, if two operands are equal in value. &gt; (Great...
2017-01-29, 296👍, 0💬

Performing Comparison on Date and Time Values in SQL Server
How To Perform Comparison on Date and Time Values in SQL Server Transact-SQL? Comparison operations on date and time values can be performed in the same way as numeric values. The comparison rule is simple: a date and time value in the future has a greater value than a date and time value in the pas...
2017-01-21, 323👍, 0💬

Performing Comparison on Exact Numbers in SQL Server
How To Perform Comparison on Exact Numbers in SQL Server Transact-SQL? Comparison operations on exact numbers of data types: BIT, INT, NUMERIC, etc., are very easy to understand. Here are some simple examples: -- BIT value comparison DECLARE @x BIT, @y BIT; SET @x = 0; SET @y = 1; SELECT CASE WHEN @...
2017-01-21, 320👍, 0💬

BETWEEN - Testing Value in a Range in SQL Server
What To Test Value Ranges with the BETWEEN Operator in SQL Server Transact-SQL? Sometimes you want to compare a value against a value range. You can do this with two regular comparison operations. But you can also use the special comparison operator BETWEEN to get it done with the following syntaxes...
2017-01-21, 316👍, 0💬

Using Wildcard Characters in LIKE Operations in SQL Server
How To Use Wildcard Characters in LIKE Operations in SQL Server Transact-SQL? Wildcard character '%' can be used in the pattern string for the LIKE operator to match any string of zero or more characters. The following example uses '%Sport% Store' to search all company names that has a partial word ...
2017-01-21, 306👍, 0💬

EXISTS - Testing Subquery Results in SQL Server
How To Test Subquery Results with the EXISTS Operator in SQL Server Transact-SQL? EXISTS is a special operator used to test subquery results. EXISTS can be used in two ways: EXISTS (SELECT ...) -- Returns TRUE if the specified subquery has one or more rows returned. NOT EXISTS (SELECT ...) -- Return...
2017-01-21, 303👍, 0💬

Performing Comparison on Character Strings in SQL Server
How To Perform Comparison on Character Strings in SQL Server Transact-SQL? Comparison operations on character strings are performed based on the associated collation. Each collation defines rules on how characters are ordered, how character cases and accents are treated, etc. The tutorial exercise b...
2017-01-21, 272👍, 0💬

Performing Comparison on Floating Point Numbers in SQL Server
How To Perform Comparison on Floating Point Numbers in SQL Server Transact-SQL? Comparison operations on approximate (floating point) numbers are also easy to understand. Just watch out rounding operations performed during conversions. Here are two examples of floating point number comparisons: -- R...
2017-01-21, 269👍, 0💬

LIKE - Matching a Pattern in a Character String in SQL Server
What To Perform Pattern Match with the LIKE Operator in SQL Server Transact-SQL? Pattern match is a very important operation for search records base on character string columns. SQL Server 2005 offers the LIKE operator to perform pattern match operations in two formats: target_string LIKE pattern --...
2017-01-21, 266👍, 0💬

IN - Testing Value in a Value List in SQL Server
What To Test Value Lists with the IN Operator in SQL Server Transact-SQL? Sometimes you want to test a given value against a list of values. You can do this in a loop with the regular "equal" operator. But you can also use the special comparison operator IN to get it done with the following syntaxes...
2017-01-21, 251👍, 0💬

IN - Testing Values Returned by a Subquery in SQL Server
How To Test Values Returned by a Subquery with the IN Operator in SQL Server Transact-SQL? Normally, the comparison operator IN is used against a list of specified values as in the format of: "test_value IN (value_1, value_2, ..., value_n)". But you can also replace the list of values by a subquery ...
2017-01-21, 242👍, 0💬

What Are Logical/Boolean Operations in SQL Server
What Are Logical/Boolean Operations in SQL Server Transact-SQL? Logical (Boolean) operations are performed on Boolean values with logical operators like 'AND', 'OR', or 'NOT'. Logical operations return Boolean values. SQL Server 2005 supports the following logical operations: AND - Returns TRUE if b...
2017-01-11, 454👍, 0💬

WHILE ... Loops in SQL Server Transact-SQL
How to execute statements in loops in SQL Server Transact-SQL? How to use WHILE ... loops? You can use WHILE ... statements to execute statements in loops in Transact-SQL using these syntaxes: -- Loop with a single statement WHILE condition statement -- Loop with a statement block WHILE condition --...
2017-01-11, 605👍, 0💬

IF ... ELSE Statement in SQL Server Transact-SQL
How to execute statements under given conditions in SQL Server Transact-SQL? How to use IF ... ELSE statements? You can use IF ... ELSE statements to execute statements under given conditions in Transact-SQL using these syntaxes: IF condition statement_1 IF condition statement_1 ELSE statement_2 IF ...
2017-01-11, 520👍, 0💬

Conditional Statements and Loops in SQL Server in SQL Server Transact-SQL
Where to find answers to frequently asked questions on Conditional Statements and Loops in SQL Server Transact-SQL? Here is a list of frequently asked questions and their answers compiled by FYIcenter.com team on Conditional Statements and Loops in SQL Server Transact-SQL. Clear answers are provided...
2017-01-11, 430👍, 0💬

"IF ... ELSE IF ..." Statement Structures in SQL Server
How To Use "IF ... ELSE IF ..." Statement Structures in SQL Server Transact-SQL? "IF ... ELSE IF ..." statement structure is used to select one of the specified statements to be executed based on specified Boolean conditions. Here is the syntax of "IF ... ELSE IF ..." statement structure: IF conditi...
2017-01-11, 355👍, 0💬

BEGIN ... END Statement Blocks in SQL Server Transact-SQL
How to put statements into a statement block in SQL Server Transact-SQL? You can put statements into a statement block with BEGIN and END key words in Transact-SQL using these syntaxes BEGIN statement_1 statement_2 ... END Statement blocks are mainly used with logical conditions and control-of-flow ...
2017-01-11, 341👍, 0💬

CONTINUE to Next Loop Iteration in SQL Server Transact-SQL
How to continue to the next iteration of a WHILE loop in SQL Server Transact-SQL? How to use CONTINUE statements? You can use the CONTINUE statement to continue to the next iteration of a WHILE loop by skipping the rest of statement block of the current iteration using this syntax: WHILE condition B...
2017-01-11, 548👍, 0💬

Using Stored Procedures in SQL Server Transact-SQL
Where to find answers to frequently asked questions on Using Stored Procedures in SQL Server Transact-SQL? Here is a list of frequently asked questions and their answers compiled by FYIcenter.com DBA team on Using Stored Procedures in SQL Server Transact-SQL. Clear answers are provided with tutorial...
2017-01-11, 321👍, 0💬

BREAK of Loop Statement in SQL Server Transact-SQL
How to break a WHILE look statement in SQL Server Transact-SQL? How to use BREAK statements? You can use the BREAK statement to break a WHILE loop inside the statement block in Transact-SQL using this syntax: WHILE condition BEGIN statement_1 statement_2 ... BREAK; statement_n ... END When a BREAK s...
2017-01-11, 314👍, 0💬

<< < 1 2 3 4 5 6 7 8 9 10 11 > >>   Sort: Rank