Tuesday, 26 May 2015

Insert default values all columns of table by serverku

We can insert all the default values in tables without specifying values while insert in table, how? See here we have tables defined all columns by default,
CREATE TABLE defaultval(
id int default 0,
name varchar(10) default 'test',
cdate datetime default getdate()
);

INSERT defaultval DEFAULT VALUES;
Did you ever get used to it?

No comments:

Post a Comment

Please Use Good Leanguage