This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
SQL SERVER - Repeate String N Times Using String Function REPLICATE

SQL SERVER – Repeate String N Times Using String Function REPLICATE

June 25, 2007
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL String

REPLICATE repeats a string N times. I found this T-SQL string function while searching for replication, and it is handy when you need repeated text.

Read More
Two identical white enamel jugs side by side on a shelf, one completely empty and one holding a single measure of water.

SQL SERVER – Explanation and Comparison of NULLIF and ISNULL

June 22, 2007
Pinal Dave
SQL Tips and Tricks
DBA, SQL Function, SQL NULL, SQL Scripts, SQL Server

NULLIF returns NULL when two expressions are equal and the first one when they are not. Here is how it compares with ISNULL and the matching CASE expression.

Read More
A clock showing current date and time.

SQL SERVER – Retrieve Current DateTime in SQL Server CURRENT_TIMESTAMP, GETDATE(), {fn NOW()}

June 21, 2007
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server

There are three ways to retrieve the current datetime in SQL SERVER.
CURRENT_TIMESTAMP, GETDATE(), {fn NOW()}

Read More
SQL SERVER - Find Length of Text Field

SQL SERVER – Find Length of Text Field

June 20, 2007
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts

LEN works for VARCHAR but not for TEXT. To find the length of text field data, use DATALENGTH(textfield). A one line example shows how.

Read More
SQL SERVER - Delay Function - WAITFOR clause - Delay Execution of Commands

SQL SERVER – Delay Function – WAITFOR clause – Delay Execution of Commands

June 18, 2007
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts

The WAITFOR clause delays a batch, stored procedure or transaction until a set time or for an interval. I use it daily after restores. DELAY and TIME examples.

Read More
SQL SERVER - 2005 - UDF - User Defined Function to Strip HTML - Parse HTML - No Regular Expression

SQL SERVER – 2005 – UDF – User Defined Function to Strip HTML – Parse HTML – No Regular Expression

June 16, 2007
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server, SQL String

A simple SQL Server function to parse HTML and keep only the text, with no regular expressions needed. Copy the UDF and try it on your own data.

Read More
SQL SERVER - LEN and DATALENGTH of NULL Simple Example

SQL SERVER – LEN and DATALENGTH of NULL Simple Example

June 12, 2007
Pinal Dave
SQL Performance
SQL Function, SQL NULL, SQL Scripts

A common mistake is checking LEN(@var) = 0 for a NULL value. LEN and DATALENGTH of NULL both return NULL, not zero, as this simple example shows.

Read More
Previous 1 … 44 45 46 47 48 49 50 … 52 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com