Search  Search  

Alter Table, Alter Column in MS SQL Server 2008
  More Programming ... on Twitter on YouTube on flickr on Pinterest on Facebook on Google+ on Tumblr on LinkedIn

Free wallpapers of the hottest girls of the 2014 Winter Olympics

Complete guide for Euro 2012’, about 300 hundred pages filled with comprehensive information about Euro 2012

Euro 12 - teams, managers, players, fixtures, referees, the brand new ‘Tango 12’ Adidas ball and much, much more. Few hundreds amazing photos.

E-books, free e-books, Euro 2012 e-books

Auckland events in photos at

1 500 photos of fun-run 'Ports of Auckland Round the Bays 2012' at

Ocean swim - more than 1 500 photos of State King of the Bays Forums forums Forums - articles, news, links Forums - articles, news, links 

Photos of State King of the Bays event at

‘Complete guide for Euro 2012’: Given profile all 368 footballers with their photos.

‘Complete guide for Euro 2012’: Read about star players of each squad. Find out who is the key player of each team. What Pele expects of Euro 2012?

‘Complete guide for Euro 2012’: Compare annual salary of coaches participating in the Euro-2012 - and how it happened that the team of the most paid coach finished the last in their group?

‘Complete guide for Euro 2012’: Euro 2012 footballers: who are the most expensive players? Who are the Rising stars at Euro 2012?

E-books, free e-books, Euro 2012 e-books
 Rating: 4      Rate this article   31 
 13 Apr 2012

Alter Table, Alter Column in MS SQL Server 2008


The Alter Column statement can modify the data type and the Nullable attribute of a column. The syntax is the same for SQL Server 2005 and SQL Server 2008 except 2008 allows the sparse attribute to be changed.

For the example below, we will begin by creating a sample table, then we will modify the columns.

CREATE TABLE dbo.Customer
FirstName VARCHAR(50) NULL,
LastName VARCHAR(50) NULL,

-- Change the datatype to support 100 characters and make NOT NULL

ALTER TABLE dbo.Customer

-- Change datatype and allow NULLs for Address

ALTER TABLE dbo.Customer

-- Set SPARSE columns for Address (sql server 2008 only)

ALTER TABLE dbo.Employee

Columns can be altered in place using alter column statement.

• Only the datatype, sparse attribute (2008) and the Nullable attribute of a column can be changed.
• You cannot add a NOT NULL specification if NULL values exist.
• In order to change or add a default value of a column, you need to use Add/Drop Constraint.
• In order to rename a column, you must use sp_rename.

More similar topics with SQL tips:

GUID formats and length.

Sparse Columns in SQL Server 2008

Oracle database - How to select several random records from a table

Database DB2 - How to select several random records from a table

MySQL database - How to select several random records from a table

PostgreSQL - How to select several random records from a table

Microsoft SQL Server - How to select several random records from a table

  More similar links:

How to Link to SQL Server data in MS Access 2013


PostgreSQL - How to select several random records from a table.

Adding and Remowing Connections to Microsoft SQL server

Microsoft SQL Server – General Info.

Microsoft SQL Server: the Difference between SSRS, SSIS and SSAS explained.


GUID formats and length.

MS SQL server – connections and Connection Pooling

 Rate this article from 1 to 5 

        Add comment
Your name:
Your comment:
 Tags: SoftFern Tutorials, SoftFern Programming Tutorials, SQL Server 2008, SQL tips, stored procedures, Microsoft SQL server tips, SQL server solutions, SQL databases solutions, Alter Column, Alter Column statement, modify the data type, modify Nullable attribute, SQL Server 2005, sparse attribute to be changed
   More Programming ...

  Home page Weird We sell Programming Windows
  News Our Photos Photoshop and Photography SQL server Microsoft Office
  Tech News Our Portfolio iPad Misc Web sites development
  Videos Archive Androids Graphic design Software development
  Auckland and New Zealand About Us Tablet PCs CD/DVD presentation Play games online
  Football Contact us Round the Bays 2012 photos Ocean Swim 2012 photos Auckland Events
  Sport Our Portfolio Stock Images Stock Photos Links Exchange
  Hot Girls Our clients On Twitter Add link Site Map
  Our Twitters’ gadget Site Map Google+ Site Grid
  Health and Beauty Site Grid Pinterest Natalia Soft Fern forums
  Misc News Web pages Facebook Photos, images Hair & Beauty
  On YouTube CD/DVD presentaton Tumblr Daily Motion Flickr
  YouTube - 2 Graphics LinkedIn Live Journal Stumble Upon
  Vimeo - videos Tutorials - Videos Tutorials - Weird Most Popular on Internet Yahts, boats, Tall Ships

SoftFern (New Zealand LTD). 
Design and development by SoftFern 2003 - 2014 Graphics supplied by