Default Values

Results 1 to 2 of 2

Thread: Default Values

  1. #1
    Join Date
    Dec 1969

    Default Default Values

    How do I Specify a default value in Sql7?<BR>I want to insert a default value of NO unless specified.<BR>I thought it was (NO), is this right?<BR><BR>Thnaks

  2. #2
    Garth Guest

    Default RE: Default Values

    See the script listed below...<BR><BR>Garth<BR><BR><BR>--SQL Script<BR>CREATE TABLE DefaultTest (Col1 int IDENTITY, Col2 varchar(10) DEFAULT &#039;No&#039;)<BR>go<BR>INSERT DefaultTest VALUES (&#039;Yes&#039;)<BR>INSERT DefaultTest VALUES (DEFAULT)<BR><BR>SELECT * FROM DefaultTest<BR><BR>--Results--<BR><BR>Col1 Col2 <BR>----------- ---------- <BR>1 Yes<BR>2 No

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts