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 - Backup and Restore Database Using Command Prompt - SQLCMD

SQL SERVER – Backup and Restore Database Using Command Prompt – SQLCMD

February 8, 2013
Pinal Dave
SQL Video
SQL Backup and Restore, SQL in Sixty Seconds, SQL Scripts, SQL Server, sqlcmd

Good DBAs automate the boring work. Here is a simple script to run Backup and Restore of a database from the command prompt with SQLCMD.

Read More
Gouache painting of colored beads spilling from a wooden scoop into a shallow brass-railed tray.

Generate Random Values in SQL Server: SQL in Sixty Seconds #042

February 6, 2013
Pinal Dave
SQL Video
SQL Function, SQL in Sixty Seconds, SQL Random, SQL Scripts

To generate random values in SQL Server, pick the function by the job: RAND for one value, CHECKSUM(NEWID()) for a value on every row, CRYPT_GEN_RANDOM for tokens. The tests here count 100,000 draws and show where the common formulas go wrong.

Read More
Gouache painting of a frayed woven strip held between wooden guides beside red scissors and trimmed fibers.

TRIM Function in SQL Server: SQL in Sixty Seconds #040

January 23, 2013
Pinal Dave
SQL Video
SQL Function, SQL in Sixty Seconds, SQL Server 2017, SQL Server 2022, SQL String

The TRIM function removes spaces from the ends of a string, and SQL Server has had it since 2017. The tests here show which characters TRIM leaves behind, the LEADING and TRAILING keywords, and a WHERE clause that read 884 pages against 3.

Read More
Gouache painting of a sealed envelope travelling along a wooden rail into an open blue mailbox.

Configure Database Mail in SQL Server: SQL in Sixty Seconds #039

January 16, 2013
Pinal Dave
SQL Video
Database Mail, SQL in Sixty Seconds, SQL Server Agent, SQL Server Configuration

To configure Database Mail, you need an SMTP account, a profile and permission to use it. The tests here build all three with T-SQL on SQL Server 2025, show the exact errors for missing access, and follow a failed send through the mail log.

Read More
Gouache painting of one long cream paper ribbon folding back and forth in neat even rows to fit inside a slate blue frame, with a vermilion bookmark at the first fold.

Wrap SQL Code in SSMS: SQL in Sixty Seconds #038

January 2, 2013
Pinal Dave
SQL Video
SQL in Sixty Seconds, SQL Server Configuration, SQL Server Management Studio, SQL Shortcut

You can wrap SQL code in SSMS so long lines fit the window and you never scroll sideways. This post gives the exact menu path, what each option on that page does, a long query to test it with and a shortcut for switching it on and off.

Read More
Gouache painting of a wooden pantry shelf with a row of identical cream jars, three of them crowded together and only one wearing a vermilion lid.

Delete Duplicate Records in SQL Server: SQL in Sixty Seconds #036

December 19, 2012
Pinal Dave
SQL Video
Duplicate Records, SQL Delete, SQL in Sixty Seconds, SQL Index

To delete duplicate records safely, look at them first. The tests here find the duplicates, preview the rows that will go, delete all but the newest copy inside one transaction and add a unique index so they cannot return. Every query ran on SQL Server 2025.

Read More
Gouache painting of three colored ribbons feeding through a brass guide and joining into one braided cord.

Concat Strings in SQL Server: SQL in Sixty Seconds #035

December 5, 2012
Pinal Dave
SQL Video
SQL in Sixty Seconds, SQL NULL, SQL Scripts, SQL String

To concat strings in SQL Server, use the + operator or the CONCAT function. The tests here show what each one does with NULL, numbers and dates, how the 8000 character limit cuts a result, and when CONCAT_WS or STRING_AGG is the better tool.

Read More
Previous 1 … 18 19 20 21 22 23 24 25 Next
  • Books
  • Testimonials
  • Privacy Policy

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