Solved

T-SQL : Field Property

Posted on 2003-12-11
1
204 Views
Last Modified: 2006-11-17
Using T-SQL how is the property NOT NULL added to an existing table field ?
0
Comment
Question by:caracalla
1 Comment
 
LVL 69

Accepted Solution

by:
ScottPletcher earned 100 total points
ID: 9921304
ALTER TABLE yourTableName
ALTER COLUMN columnName datatype NOT NULL


I believe you will have to change any NULL values in that column to a non-NULL value first for this to work.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now