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

Difference Between GETDATE() and GETUTCDATE() in SQL Server
What Is the Difference Between GETDATE() and GETUTCDATE() in SQL Server Transact-SQL? The difference between GETDATE() and GETUTCDATE() is time zone number of the SQL Server machine. The tutorial exercise below gives you a good example: DECLARE @local_time DATETIME; DECLARE @gmt_time DATETIME; SET @...
2017-02-14, 3775🔥, 0💬

Getting Year, Month and Day Out of DATETIME Values in SQL Server
How To Get Year, Month and Day Out of DATETIME Values in SQL Server Transact-SQL? You can use DATEPART() to get any part of the DATETIME value. But to get year, month and day, you can use 3 specific functions: YEAR(), MONTH() and DAY(). These functions are equivalent to DATEPART() as: YEAR(date) = D...
2017-02-14, 3291🔥, 0💬

Getting Parts of DATETIME Values as Integers in SQL Server
How To Get Parts of DATETIME Values as Integers in SQL Server Transact-SQL? Sometimes, you want to one specific part of a DATETIME value as an integer to be used in your own date and time calculations. This can be done by using the DATEPART() function in the following format: DATENAME(datepart, date...
2017-02-14, 1377🔥, 0💬

Getting Month and Weekday Names from DATATIME Values in SQL Server
How To Get Month and Weekday Names from DATETIME Values in SQL Server Transact-SQL? In DATETIME values, the month part and weekday part have names. You can use the DATENAME() function to get the month name and weekday name from a DATETIME value in the following format: DATENAME(datepart, date) retur...
2017-02-14, 1372🔥, 0💬

CONVERT() - Formatting DATETIME Values to Strings in SQL Server
How To Format DATETIME Values to Strings with the CONVERT() Function in SQL Server Transact-SQL? SQL Server 2005 offers no functions to format DATETIME values in your own format patterns. But it does provide you a number of pre-defined format patterns that you can use with the CONVERT(char_type, dat...
2017-02-08, 3542🔥, 0💬

Formatting Time Zone in +/-hh:mm Format in SQL Server
How To Format Time Zone in +/-hh:mm Format in SQL Server Transact-SQL? From the previous tutorial, you know how to calculate the time zone value by using GETDATE() and GETUTCDATE() functions. But how can you format that time zone value in a nice looking format like +05:45 or -04:00? Unfortunately, S...
2017-02-08, 3259🔥, 0💬

Setting New Values to Parts of a DATETIME Value in SQL Server
How To Set Different Parts of a DATETIME Value in SQL Server Transact-SQL? In SQL Server, you can get different parts of a DATETIME value with the DATEPART() functions. But there is no function that allows you to set different parts to a DATETIME value. For example, you a date_of_birth column as DAT...
2017-02-08, 1903🔥, 0💬

Truncating DATETIME Values to Dates without Time in SQL Server
How To Truncate DATETIME Values to Dates without Time in SQL Server Transact-SQL? Assuming that you have some date and time, DATETIME, values, and you want to work with dates only. You want to truncate them to dates without time, or with time of 00:00:00.000. Again, SQL Server offers no simple solut...
2017-02-08, 1727🔥, 0💬

Working with NULL Values in SQL Server Transact-SQL
Where to find answers to frequently asked questions on Working with NULL Values in SQL Server Transact-SQL? Here is a list of frequently asked questions and their answers compiled by FYIcenter.com DBA team on Working with NULL Values in SQL Server Transact-SQL. Clear explanations and tutorial exerci...
2017-02-08, 1473🔥, 0💬

What Are NULL Values in SQL Server
What Are NULL Values in SQL Server Transact-SQL? A NULL value is a special value that represents an unknown value. SQL Server supports NULL values with the following features: All data types used for table columns support NULL values. In another word, NULL values can be stored in database tables. In...
2017-02-05, 1520🔥, 0💬

Assigning NULL Values to Variables or Columns in SQL Server
How To Assign NULL Values to Variables or Columns in SQL Server Transact-SQL? The rule for assigning NULL values to variables or table columns is simple: Use keyword "NULL" directly as normal values. "NULL" can be used in SET statements to assign NULL values to variables. "NULL" can be used in SET c...
2017-02-05, 1434🔥, 0💬

NULL Values Involved in Arithmetic Operations in SQL Server
What Happens If NULL Values Are Involved in Arithmetic Operations in SQL Server Transact-SQL? If NULL values are involved in arithmetic operations, the result will be numeric NULL values. The following tutorial script shows you some good examples: SELECT 7+NULL; GO ----------- NULL SELECT 10.02*NULL...
2017-02-05, 1416🔥, 0💬

NULL Values Involved in Datetime Operations in SQL Server
What Happens If NULL Values Are Involved in Datetime Operations in SQL Server Transact-SQL? If NULL values are involved in datetime operations, the result will be datetime NULL values. The following tutorial script shows you some good examples: USE FyiCenterData; GO SELECT GETDATE()+NULL; GO -------...
2017-02-05, 1387🔥, 0💬

NULL Values Involved in String Operations in SQL Server
What Happens If NULL Values Are Involved in String Operations in SQL Server Transact-SQL? If NULL values are involved in string operations, the result will be string NULL values. The following tutorial script shows you some good examples: SELECT 'FyiCenter'+NULL; GO ---------- NULL SELECT LEN(NULL);...
2017-02-05, 1305🔥, 0💬

ISNULL() - Replacing NULL Values in Expressions in SQL Server
How To Replace NULL Values in Expressions using ISNULL() in SQL Server Transact-SQL? As you learned from previous tutorials, NULL values presented in expressions will cause the final results to be NULL. Sometimes, you want NULL values to be replaced with some default values, like 0, '', or 'NULL', s...
2017-02-03, 2792🔥, 0💬

NULL Values Involved in Boolean Operations in SQL Server
What Happens If NULL Values Are Involved in Boolean Operations in SQL Server Transact-SQL? If NULL values are involved in Boolean operations, the result will vary depending on the operator type. For AND operator, FALSE takes precedence over NULL. The result can be summarized in a table below: AND TR...
2017-02-03, 1524🔥, 0💬

"IS NULL" - Testing NULL Values in SQL Server
How To Test NULL Values Properly in SQL Server Transact-SQL? From previous tutorials, you learned that comparing expressions with NULL will always result NULL. So you can not use comparison operators to test if an expression represents a NULL value or not. To test expressions for NULL values, you sh...
2017-02-03, 1521🔥, 0💬

NULL Values Involved in Comparison Operations in SQL Server
What Happens If NULL Values Are Involved in Comparison Operations in SQL Server Transact-SQL? If NULL values are involved in comparison operations, the result will be Boolean NULL values. This behavior is very interesting because you would expect a comparison operation returns only one of the two va...
2017-02-03, 1440🔥, 0💬

NULL Values Involved in Bitwise Operations in SQL Server
What Happens If NULL Values Are Involved in Bitwise Operations in SQL Server Transact-SQL? If NULL values are involved in bitwise operations, the result will be binary NULL values. The following tutorial script shows you some good examples: SELECT 1 | NULL; GO ----------- NULL SELECT 707 &amp; N...
2017-02-03, 1406🔥, 0💬

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, 4612🔥, 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, 1660🔥, 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, 1648🔥, 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, 1557🔥, 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, 1453🔥, 0💬

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