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
A gouache instrument room shows a fitted mechanism tray lifted from one case beside a prepared matching case.

SQL SERVER – T-SQL Script to Attach and Detach Database

August 24, 2007
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Data Storage, SQL Scripts, SQL Server

Detach Database operations remove a database from its instance without deleting its files. I preserve a recoverable backup before moving them.

Read More
SQL SERVER - 2005 - Use of Non-deterministic Function in UDF - Find Day Difference Between Any Date and Today

SQL SERVER – 2005 – Use of Non-deterministic Function in UDF – Find Day Difference Between Any Date and Today

August 23, 2007
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Error Messages, SQL Function, SQL Scripts

I always thought a non-deterministic function was not allowed in a UDF, but GETDATE() works in SQL Server 2005. My UDF finds the day difference from today.

Read More
A CSV file.

SQL SERVER – T-SQL Script to Insert Carriage Return and New Line Feed in Code

August 22, 2007
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL String

Add a carriage return with CHAR(13) and a New Line Feed with CHAR(10) in T-SQL. Handy for formatting output, dynamic SQL with GO, and saving user text.

Read More
A furnished room beside the same room drawn as an empty blueprint, showing shape without contents.

SQL SERVER – 2005 – Create Script to Copy Database Schema and All The Objects – Stored Procedure, Functions, Triggers, Tables, Views, Constraints and All Other Database Objects

August 21, 2007
Pinal Dave
SQL Tips and Tricks
Database, SQL Backup and Restore, SQL Constraint and Keys, SQL Cursor, SQL Download, SQL Function, SQL Index, SQL Scripts, SQL Stored Procedure, SQL Trigger

A step by step tutorial to create a T-SQL script that can copy database schema and all objects, like stored procedures, functions, triggers, tables and views.

Read More
A tangled ball of twine beside the same twine wound neatly onto five spools

Refactoring a Long Stored Procedure Into Readable Steps

August 20, 2007
Pinal Dave
SQL Tips and Tricks
Best Practices, SQL Coding Standards, SQL Server, SQL Stored Procedure

Learn refactoring a long stored procedure with output baselines, named temp tables, dead-code removal, and two-way EXCEPT checks before release.

Read More
SQL SERVER - Find Monday of the Current Week

SQL SERVER – Find Monday of the Current Week

August 20, 2007
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Scripts, SQL Utility

Find Monday of the current week with one line of T-SQL: DATEADD and DATEDIFF with the week part and GETDATE() give you the date.

Read More
Three small plain wooden blocks and a single empty space arranged neatly on an oak tabletop.

The SQL Basics Almost Everybody Skips

August 19, 2007
Pinal Dave
SQL Tips and Tricks
Best Practices, Database, SQL Scripts, SQL Server

Revisit SQL basics that change query results: NULL logic, logical processing order, grouped filters, and the difference between two common counts.

Read More
A paper calendar with the last day of the month circled in red.

SQL SERVER – Find Last Day of Any Month – Current Previous Next

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

Find the last day of any month with DATEADD and DATEDIFF. One script returns the last day of the previous, current and next month in SQL Server.

Read More
SQL SERVER - 2005 - Explanation and Script for Online Index Operations - Create, Rebuild, Drop

SQL SERVER – 2005 – Explanation and Script for Online Index Operations – Create, Rebuild, Drop

August 17, 2007
Pinal Dave
SQL Performance
SQL Index, SQL Scripts, SQL Server DBCC

What are online index operations? SQL Server 2005 Enterprise Edition can create, rebuild and drop indexes without locking tables, and I explain how.

Read More
A stone cairn at a fork in a misty mountain path, its vermilion top stone pointing the way, a distant hiker on that trail.

Writing Clear Error Messages in Procedures

August 16, 2007
Pinal Dave
SQL Tips and Tricks
Best Practices, SQL Error Messages, SQL Server, SQL Stored Procedure

Clear error messages in procedures identify the failed operation, useful keys, and next action without exposing sensitive data.

Read More
Previous 1 … 557 558 559 560 561 562 563 … 588 Next
  • Books
  • Testimonials
  • Privacy Policy

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