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
Sage and slate-blue ceramic beads, a small vermilion spacer and an empty ring on a braided cord.

CONCAT_WS: Keep NULL and Empty Strings Separate

July 5, 2007
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL NULL, SQL Server, SQL String

CONCAT_WS joins values with a separator, but NULL and empty strings have different effects. These examples keep the original fields beside the combined text and byte length.

Read More
LAST_VALUE window frame illustration, two wooden trays holding smooth stones beside a brass divider.

LAST_VALUE: Set the Window Frame for the Final Row

July 5, 2007
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Order By, SQL Server

LAST_VALUE changes with its window frame. Compare implicit and whole-partition frames, order tied rows and preserve a final NULL.

Read More
Three long shallow trays of blue ceramic pebbles beside a small square tray of six ochre and rust beads.

BIT_COUNT: Count Set Bits Without Changing Integer Width

July 4, 2007
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Server, SQL Server 2022

BIT_COUNT counts active positions in a typed value. Keep integer width visible and distinguish a missing mask from a zero count.

Read More
SQL SERVER - Explanation of WITH ENCRYPTION clause for Stored Procedure and User Defined Functions

SQL SERVER – Explanation of WITH ENCRYPTION clause for Stored Procedure and User Defined Functions

July 1, 2007
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Server Encryption, SQL Stored Procedure

Use WITH ENCRYPTION to hide the code of a stored procedure or UDF, but keep a copy of the script. Once encrypted, there is no simple way to decrypt it.

Read More
SQL SERVER - Fix : Error : Server: Msg 131, Level 15, State 3, Line 1 The size () given to the type 'varchar' exceeds the maximum allowed for any data type (8000)

SQL SERVER – Fix : Error : Server: Msg 131, Level 15, State 3, Line 1 The size () given to the type ‘varchar’ exceeds the maximum allowed for any data type (8000)

June 30, 2007
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL String

Msg 131 says the size given to varchar exceeds the maximum allowed (8000). Use VARCHAR(8000), or VARCHAR(MAX) in SQL Server 2005 as the TEXT replacement.

Read More
SQL SERVER - Recompile All The Stored Procedure on Specific Table

SQL SERVER – Recompile All The Stored Procedure on Specific Table

June 29, 2007
Pinal Dave
SQL Tips and Tricks
Best Practices, SQL Stored Procedure

After BCP or DTS mass inserts, stored procedures can slow down. I use sp_recompile to recompile all the stored procedure on a table, or just one procedure.

Read More
Gouache painting: on a bakery bench a narrow stoneware crock holds risen dough that has been sliced flat at its rim by a bench scraper

REPLACE Return Limits: Cast the Input to max

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

REPLACE return limits can truncate text at 8,000 bytes. Cast the searched input to max first, then compare Unicode and non-Unicode byte lengths.

Read More
Previous 1 … 546 547 548 549 550 551 552 … 570 Next
  • Books
  • Testimonials
  • Privacy Policy

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