Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 3rd, 2003, 06:02 PM
Authorized User
 
Join Date: Jun 2003
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default ms sql syntax

Can anyone explain to me what the following alter command does?

Thanks

-------------------------------------------
ALTER TABLE [dbo].[SSR] WITH NOCHECK ADD
    CONSTRAINT [DF_SSRFACC_BAD_DEBTOR_FLAG] DEFAULT ('N') FOR [BAD_DEBTOR_FLAG],
    CONSTRAINT [DF_SSRFACC_DATE] DEFAULT ('1/1/1900') FOR [DATE_FOR_ACTION],
    CONSTRAINT [DF_SSRFACC_DATE_PAID] DEFAULT ('1/1/1900') FOR [DATE_PAID]
GO
 
Old November 3rd, 2003, 06:12 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

It adds default constraints to the table SSR.

A default constraint is a value which is automatically provided to the indicated column if no value is provided on an INSERT query.

These constraints are added with the NOCHECK option, so the defaults will not be applied to any existing data; they will only be in effect for new rows added.

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
How Run .sql Script file in MS SQL Server 2000? aarkaycee SQL Server 2000 5 October 12th, 2009 05:43 AM
Database migration MS Access 2003 to MS SQL 2000 ayazhoda SQL Server 2000 3 April 23rd, 2007 11:38 AM
MS ACCESS 2003 FRONTEND AND MS SQL SERVER 2005 DB mohankumar0709 SQL Server 2005 3 March 23rd, 2007 12:48 AM
Syntax of date function in MS Access krishreddy Access 3 July 25th, 2006 03:42 PM
Syntax to query Date/Time in MS ACCESS chiuyianl Access 4 March 31st, 2005 09:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.