<< < 4 5 6 7 8 9 10 11 12 13 14 > >>   Sort: Rank

Inserting New Line Characters into Strings in SQL Server
How To Insert New Line Characters into Strings in SQL Server Transact-SQL? If you want to break a string into multiple lines, you need to insert new line characters into the string. With some client tools like SQL Server Management Studio, it is not so easy to insert a new line character. One work a...
2017-03-07, 337👍, 0💬

Character String Functions Supported by SQL Server 2005 in SQL Server
What Are the Character String Functions Supported by SQL Server 2005 in SQL Server Transact-SQL? SQL Server 2005 supports 23 character string functions: ASCII(char) - Returning the code value of a non-Unicode character. CHAR(int) - Returning the non-Unicode character of a code value. CHARINDEX(word,...
2017-03-07, 314👍, 0💬

Concatenating Two Binary Strings in SQL Server
How To Concatenate Two Binary Strings Together in SQL Server Transact-SQL? SQL Server 2005 allows to concatenate two binary strings into a single string with the (+) operator. The following tutorial exercise shows you some binary string concatenation examples: -- Concatenating two binary string lite...
2017-03-07, 300👍, 0💬

Converting Binary Strings into Character Strings in SQL Server
Can Binary Strings Be Converted into Character Strings in SQL Server Transact-SQL? Binary strings and character strings are convertible. But there are several rules you need to remember: Binary strings can be converted implicitly to character strings by assignment operations. Binary strings can not ...
2017-02-28, 352👍, 0💬

Using Binary Strings in Arithmetical Operations in SQL Server
Can Binary Strings Be Used in Arithmetical Operations in SQL Server Transact-SQL? Can binary strings be used in arithmetical operations? The answer is yes. But there are two simple rules you need to remember: If an arithmetical operation has one binary string operand and one integer data type operan...
2017-02-28, 347👍, 0💬

Converting Binary Strings into Integers in SQL Server
How To Convert Binary Strings into Integers in SQL Server Transact-SQL? Binary strings and integers are convertible implicitly and explicitly. But there several rules you need to remember: Binary strings will be implicitly converted into an integer data type, if it is involved in an arithmetical ope...
2017-02-28, 343👍, 0💬

Converting Binary Strings into Unicode Character Strings in SQL Server
Can Binary Strings Be Converted into Unicode Character Strings in SQL Server Transact-SQL? Can binary strings be converted into Unicode character strings? The answer is yes. But you need to know how Unicode characters are represented in a binary format. Remember the following simple rules: An ASCII ...
2017-02-28, 326👍, 0💬

Converting Binary Strings into NUMERIC or FLOAT in SQL Server
Can Binary Strings Be Converted into NUMERIC or FLOAT Data Types in SQL Server Transact-SQL? Can binary strings be converted into numeric or float data types? The answer is no. Binary strings can not be converted implicitly or explicitly into NUMERIC, DECIMAL, REAL, or FLOAT data types. The tutorial...
2017-02-28, 308👍, 0💬

AND, OR, XOR, and NOT - Bitwise Operations in SQL Server
What Are Bitwise Operations in SQL Server Transact-SQL? Bitwise operations are binary operations performed on one or two binary strings. SQL Server supports 4 bitwise operations: &amp; (Bitwise AND) - Performing the single bit Boolean operation "AND" on each bit position. | (Bitwise OR) - Perfor...
2017-02-25, 415👍, 0💬

bin2hex - Converting Binary Strings into Hexadecimal Character Strings in SQL Server
How To Convert Binary Strings into Hexadecimal Character Strings in SQL Server? When a query returns a binary string value to the client tool, it will be displayed by the client tool as hexadecimal digits in a character string format. But they are hexadecimal digits on the display window, not in the...
2017-02-25, 386👍, 0💬

Get System Date and Time in SQL Server Transact-SQL
How to get system date and time in SQL Server Transact-SQL? I want a list of functions for getting current system date and time. Here is a comparison of all functions that you can use to get the current date and time from the data base server system: Function Return type Precision ------------------...
2017-02-25, 367👍, 0💬

Date/Time Data Type Comparison in SQL Server Transact-SQL
What are differences between date and time data types in SQL Server Transact-SQL? I want to compare of date and time data types? Here is a comparison table of all date and time data types supported in SQL Server Transact-SQL: Data type Storage size Precision Default Format / (bytes) Value range ----...
2017-02-25, 353👍, 0💬

Date/Time Operations and Functions in SQL Server Transact-SQL
Where to find answers to frequently asked questions on Date/Time Operations and Functions in SQL Server Transact-SQL? Here is a list of frequently asked questions and their answers compiled by FYIcenter.com DBA team on Date/Time Operations and Functions in SQL Server Transact-SQL. Clear answers are ...
2017-02-25, 333👍, 0💬

Verify Time Precision in SQL Server Transact-SQL
How to verify the precession of the server system time in SQL Server Transact-SQL? You can run a WHILE loop to check the precision of server system time in Transact-SQL as shown below: DECLARE @var DATETIME2(7); DECLARE @count INT = 0; WHILE @count&lt;100 BEGIN SET @count = @count + 1; SET @var ...
2017-02-22, 366👍, 0💬

Converting DATETIME and NUMERIC Values in SQL Server
Are DATETIME and NUMERIC Values Convertible in SQL Server Transact-SQL? Are datetime and numeric value convertible? The answer is yes. Here are the main rules on DATATIME and NUMERIC value conversions: During the conversion a DATETIME value will be treated as a NUMERIC value with the number of days ...
2017-02-22, 366👍, 0💬

Converting Date and Time Values into Integers in SQL Server
Can Date and Time Values Be Converted into Integers in SQL Server Transact-SQL? Can date and time values be converted into integers? The answer is yes. The resulting integer will be the number days relative the base date: Jan 1, 1900. The time of the day will be rounded to days. But there several ru...
2017-02-22, 350👍, 0💬

Adding and Removing Days on Date and Time Values in SQL Server
How To Add or Remove Days on Date and Time Values in SQL Server Transact-SQL? SQL Server 2005 only support two operators on data and time values: + (Add): Adding days to a date and time value. - (Subtract): Removing days from a date and time value. Note that to add or subtract days on a date and tim...
2017-02-22, 341👍, 0💬

Converting Integers into Date and Time Values in SQL Server
Can Integers Be Converted into Date and Time Values in SQL Server Transact-SQL? Can integers be converted into date and time values? The answer is yes. The input integer will be used as the number of days relative to the base date: Jan 1, 1900. The time of the day will be set to 0, midnight of the d...
2017-02-22, 284👍, 0💬

DATEADD() Function Usage Examples in SQL Server
How To Use DATEADD() Function in SQL Server Transact-SQL? DATEADD() is a very useful function for manipulating date and time values. The following tutorial exercise shows you some good DATEADD() usage examples: -- Incrementing 1 year on a leap date DECLARE @birth_date DATETIME; SET @birth_date = '20...
2017-02-20, 708👍, 0💬

DATEDIFF() - Calculating DATETIME Value Differences in SQL Server
How To Calculate DATETIME Value Differences Using the DATEDIFF() Function in SQL Server Transact-SQL? If you want to calculate the difference between two date and time values, you can use the DATEDIFF() function in the following format: DATEDIFF(datepart, startdate, enddate) returns INT: "startdate"...
2017-02-20, 408👍, 0💬

Incrementing or Decrementing Parts of DATETIME Values in SQL Server
How To Increment or Decrement Parts of DATETIME Values in SQL Server Transact-SQL? If you want to increment or decrement one part of a date and time value, you can use the DATEADD() function in the following format: DATEADD(datepart, number, date) returns DATETIME: "date" - the input date "number" -...
2017-02-20, 347👍, 0💬

Date and Time Functions Supported by SQL Server 2005 in SQL Server
What Are the Date and Time Functions Supported by SQL Server 2005 in SQL Server Transact-SQL? SQL Server 2005 supports n character string functions: DATEADD(datepart, number, date) - Returning the same date and time value with one part added with the "number". DATEDIFF(datepart, startdate, enddate) ...
2017-02-20, 294👍, 0💬

Subtracting a DATETIME Value from Another DATETIME Value in SQL Server
Can a DATETIME Value Be Subtracted from Another DATETIME Value in SQL Server Transact-SQL? Can a datetime value be subtracted from another datetime value? The answer is yes. The subtract operation can be performed by the subtract operator (-) as: datetime1 - datetime2: Returning a DATETIME value cal...
2017-02-20, 253👍, 0💬

Calculating Age in Days, Hours and Minutes in SQL Server
How To Calculate Age in Days, Hours and Minutes in SQL Server Transact-SQL? On many Web sites, news items or blog articles are displayed with a publishing data and time represented in days, hours and minutes. To do this you can use the DATEDIFF() function with a simple algorithm as shown in the tuto...
2017-02-14, 408👍, 0💬

<< < 4 5 6 7 8 9 10 11 12 13 14 > >>   Sort: Rank