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 - 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 - De-fragmentation of Database at Operating System to Improve Performance

SQL SERVER – De-fragmentation of Database at Operating System to Improve Performance

June 17, 2007
Pinal Dave
SQL Performance
Computer Network, DBA, SQL Index, SQL Scripts

Why does de-fragmentation of database files at the operating system level skip MDF files? SQL Server has them open, so stop the services first.

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 - sp_HelpText for sp_HelpText - Puzzle

SQL SERVER – sp_HelpText for sp_HelpText – Puzzle

June 15, 2007
Pinal Dave
SQL Puzzle
SQL Scripts, SQL Stored Procedure

What happens when you run sp_HelpText on itself? It prints its own code. Plus tips for long lines, encrypted objects and searching object code.

Read More
Gouache painting: a leather sack tipped over a wooden chute pours golden grain into a narrow stoneware crock, which overflows across the bench

SUM Integer Values: Cast Before the Aggregate

June 15, 2007
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts

SUM integer values can exceed int even when each row fits. Cast each input to bigint before aggregation and keep NULL and empty-set behavior visible.

Read More
SQL SERVER - Easy Sequence of SELECT FROM JOIN WHERE GROUP BY HAVING ORDER BY

SQL SERVER – Easy Sequence of SELECT FROM JOIN WHERE GROUP BY HAVING ORDER BY

June 14, 2007
Pinal Dave
SQL Tips and Tricks
Database, DBA, SQL Scripts

The sequence of SELECT, FROM, JOIN, WHERE, GROUP BY, HAVING and ORDER BY that I gave my new hires. Since then they ask me far fewer questions.

Read More
Previous 1 … 344 345 346 347 348 349 350 … 365 Next
  • Books
  • Testimonials
  • Privacy Policy

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