all groups > sql server new users > november 2006 >
You're in the

sql server new users

group:

Default Values - Use of brackets


Default Values - Use of brackets Mark
11/16/2006 1:12:31 PM
sql server new users: For default values in sql server 2000 should I use brackets around default
values? E.g. Is there any difference between GetDate() and (GetDate()) and
0 and (0). Both methods seem to work fine, but is there a correct way?

Thanks

Re: Default Values - Use of brackets Aneesh
11/17/2006 12:00:00 AM
I prefer using brackets, eventhough i haven't foung any difference yet.



[quoted text, click to view]

Re: Default Values - Use of brackets Anthony Thomas
11/19/2006 3:03:38 PM
From Books Online:

<column_definition> ::=
column_name <data_type>
[ COLLATE collation_name ]
[ NULL | NOT NULL ]
[
[ CONSTRAINT constraint_name ] DEFAULT constant_expression ]
| [ IDENTITY [ ( seed ,increment ) ] [ NOT FOR REPLICATION ]
]
[ ROWGUIDCOL ] [ <column_constraint> [ ...n ] ]

"(" and ")" are not referenced.

However, the situation is similar to the filter criterion in the WHERE
clause: the parentheses are optional.

Sincerely,


Anthony Thomas

--

[quoted text, click to view]

AddThis Social Bookmark Button