Sign in
Google apps
Main menu
Post a Comment On:
Blogpad
"Default Field Value at Table Creation Time"
No comments yet. -
1 – 0 of 0
Syntax:
[FieldName] type CONSTRAINT [constraint_name] DEFAULT default_value
Example:
CREATE TABLE [Clients]
(
ClientID bigint NOT NULL IDENTITY(1,1) CONSTRAINT [PK_Clients] PRIMARY KEY,
CreatedOn datetime NOT NULL CONSTRAINT [DF_Clients_CreatedOnUtc] DEFAULT GETDATE()
...
)
And for an already created table:
ALTER TABLE Clients
ADD CONSTRAINT [DF_Clients_CreatedOn] DEFAULT GETDATE() FOR CreatedOn
posted by fc at
7:17 AM
on Jul 31, 2011
Leave your comment
You can use some HTML tags, such as
<b>, <i>, <a>
This blog does not allow anonymous comments.
Google Account
You will be asked to sign in after submitting your comment.
Please prove you're not a robot
"Default Field Value at Table Creation Time"
No comments yet. -