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.
Designing Your First Table: Columns, Keys and Data Types
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.
Rows, Columns and Tables: How a Database Holds Information
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.
Adding a NOT NULL Column With a Default to a Big Table
Add a NOT NULL column with a default safely, distinguish metadata changes from row updates, and plan a staged Standard edition rollout.
How to Add Column at Specific Position in SQL Server
To add column at specific position in SQL Server, you have three tested options, because ALTER TABLE always adds the column last. This post shows a SELECT list, a view for loads and reports, and a full table rebuild. It also explains what the rebuild costs.
Rename a Column or Table in SQL Server Safely
To rename a column in SQL Server, call sp_rename with the table and column name, the new name and the word COLUMN. This post tests the rename on a demo database and shows what it leaves behind: a broken view, an old constraint name and permissions that stay. It ends with a safe way to swap two column names.
Renaming a Column Safely Everywhere It Is Used
Renaming a column safely requires finding SQL and application references, applying sp_rename, refreshing modules, and testing every consumer.







