<< < 34 35 36 37 38 39 40 41 42 43 44 > >>   ∑:1243  Sort:Rank

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, 1710🔥, 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, 1562🔥, 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, 1552🔥, 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, 1457🔥, 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, 1432🔥, 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, 1415🔥, 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, 1402🔥, 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, 1372🔥, 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, 1333🔥, 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, 1329🔥, 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, 2196🔥, 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, 4619🔥, 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, 3736🔥, 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, 3358🔥, 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, 3222🔥, 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, 2826🔥, 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, 11081🔥, 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, 2094🔥, 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, 1766🔥, 0💬

What Are Stored Procedures in SQL Server
What Are Stored Procedures in SQL Server Transact-SQL? A stored procedure is a collection of Transact-SQL statements that stored in the SQL Server. A stored procedure can be executed later with an EXEC statement. SQL Server supports stored procedures with the following features: 1. Stored procedures...
2017-01-11, 1447🔥, 0💬

sys.procedures - Listing All Stored Procedures in SQL Server
How To List All Stored Procedures in the Current Database in SQL Server Transact-SQL? If you want to see a list of stored procedures in your current database, you can use the system view, sys.procedures as shown in this tutorial exercise: USE FyiCenterData; GO SELECT * FROM sys.procedures; GO Name o...
2017-01-05, 5997🔥, 0💬

"CREATE PROCEDURE" - Creating Simple Stored Procedures in SQL Server
How To Create a Simple Stored Procedure in SQL Server Transact-SQL? If you want to create a simple stored procedure with no input and output parameters, you can use the "CREATE PROCEDURE" command with a statement batch in a simple format as shown in below: CREATE PROCEDURE procedure_name AS statemen...
2017-01-05, 2640🔥, 0💬

EXECUTE - Executing Stored Procedures in SQL Server
How To Execute a Stored Procedure in SQL Server Transact-SQL? If you want execute a stored procedure created previously, you can use the EXECUTE statement in the following formats: EXEC procedure_name; EXECUTE procedure_name; The key word EXEC is actually optional. So you can execute a stored proced...
2017-01-05, 2113🔥, 0💬

Creating Stored Procedures with Statement Blocks in SQL Server
How To Create a Stored Procedure with a Statement Block in SQL Server Transact-SQL? If you are creating a stored procedure with multiple statements, it's better to use "BEGIN ... END" to group all statements into a single statement block. The tutorial exercise below shows you some good examples: USE...
2017-01-05, 1787🔥, 0💬

<< < 34 35 36 37 38 39 40 41 42 43 44 > >>   ∑:1243  Sort:Rank