Hi,
CREATE TABLE #table (col1 INT, col2 INT DEFAULT 0);
INSERT INTO #table VALUES( 1, DEFAULT);
INSERT INTO #table VALUES( 2, 123 );
INSERT INTO #table(col1) VALUES(3);
SELECT * FROM #table
DROP TABLE #table
OUTPUT:
col1 col2
----------- -----------
1 0
2 123
3 0
quote:
Originally posted by ~AsEdu~
Can someone please tell me , what is the use of DEFAULT constraint in sql?
i know that it is used to insert a default value into a column.
But i have to give a value when inserting values into the columns even though i give a default value when creating that particular columns.

pls help..