BUG:Table-Level Default Constraint in CREATE TABLE Gives ErrorLast reviewed: March 20, 1997Article ID: Q141665 |
6.00
WINDOWS
kbusage kbdocerr kberrmsg kbbug6.00
The information in this article applies to:
BUG# NT: 12551 (6.00)
SYMPTOMSIf you include a table-level default constraint in a CREATE TABLE statement, you will receive the following error:
Msg 170; Severity 15; State 1: Incorrect syntax near 'for' WORKAROUNDUse column-level default constraints. For example, rewrite the above SQL statement as: create table tbldef (x int not null constraint cdef default 999, y int) go
STATUSMicrosoft has confirmed this to be a problem in SQL Server version 6.0. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONSQL Server "Books Online" and the "Transact-SQL Reference" manual (page 67) mention that table-level default constraints can be defined inside a CREATE TABLE statement. This is a documentation error. The following statement will give a syntax error: create table tbldef (x int not null, y int, constraint cdef default 999 for x) go
|
Additional reference words: SQL6 6.00 winnt
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |