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 - Script: Remove Spaces in Column Name in All Tables

SQL SERVER – Script: Remove Spaces in Column Name in All Tables

December 26, 2015
Pinal Dave
SQL Tips and Tricks
SQL Column, SQL Scripts, SQL Server

A reader wanted a script to remove spaces from every column name in all tables. Here it is, with a warning first: renaming columns can break your application.

Read More
Hairpins with two metal legs forming each single pin

max_length in sys.columns: Bytes, Not Characters

November 17, 2015
Pinal Dave
SQL Tips and Tricks
SQL Column, SQL Datatype, SQL System Table

Your generated column came out twice as wide as the original. Here is why max_length counts bytes and how to turn it back into a real declaration.

Read More
Adjustable band inside a felt hat beside a cut band and matching insert

Metadata-Only Column Changes: Which ALTER COLUMN Is Instant

July 6, 2014
Pinal Dave
SQL Tips and Tricks
SQL Column, SQL Data Storage, Transaction Log

Six ALTER statements look equally small, but their log cost is not. Here is how to measure each one before the change window.

Read More
Padded sleeve board supporting a jacket sleeve beside an unsupported sleeve

Column Aliases: Where You Can Use Them and Where You Cannot

June 8, 2014
Pinal Dave
SQL Tips and Tricks
SQL Coding Standards, SQL Column, SQL Order By

Why does WHERE say the alias does not exist? Here is the order SQL Server follows, two clean fixes and one quiet trap to avoid.

Read More
A new wooden shelf unit standing on a workshop floor beside a small dish of wooden pegs, one red peg nearby.

Designing Your First Table: Columns, Keys and Data Types

September 1, 2013
Pinal Dave
SQL Tips and Tricks
Primary Key, SQL Column, SQL Constraint and Keys, SQL Datatype, SQL Table Operation

Designing Your First Table gets easier when you decide what it must hold before you write any SQL. This post walks through naming, data types, NULL or NOT NULL, a primary key, a default and a check constraint on a small Customers table. It also shows what to leave for later.

Read More
A wooden seed tray seen from above with rows and columns of small green seedlings, one cell marked with a red stick.

Rows, Columns and Tables: How a Database Holds Information

August 21, 2013
Pinal Dave
SQL Tips and Tricks
Database, SQL Column, SQL Constraint and Keys, SQL Data Storage, SQL Table Operation

Rows, Columns and Tables are the three ideas behind every relational database. A table holds one kind of thing, a column describes one fact about it, and a row records one item. This post builds a small Books table in SQL Server and reads it back by row and by column.

Read More
A hand raising a single vermilion pennant on a flagpole above a harbor full of moored boats.

Adding a NOT NULL Column With a Default to a Big Table

May 1, 2013
Pinal Dave
SQL Tips and Tricks
DBA, SQL Column, SQL Constraint and Keys, SQL Server, SQL Table Operation

Add a NOT NULL column with a default safely, distinguish metadata changes from row updates, and plan a staged Standard edition rollout.

Read More
Previous 1 2 3 4 5 6 7 Next
  • Books
  • Testimonials
  • Privacy Policy

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