Collections:
DEFAULT - Using Column Default Values in INSERT Statements in SQL Server
How To Use Column Default Values in INSERT Statements in SQL Server?
✍: FYIcenter.com
If a column is defined with a default value in a table, you can use the key word DEFAULT in the INSERT statement to take the default value for that column. The following tutorial exercise gives a good example:
INSERT INTO fyi_links VALUES (102, 'dba.fyicenter.com', NULL, 0, DEFAULT) GO (1 row(s) affected) SELECT * FROM fyi_links GO id url notes counts created 101 dev.fyicenter.com NULL 0 2006-04-30 102 dba.fyicenter.com NULL 0 2007-05-19
The default value, getdate(), is used for "created" column, which gives the current date.
⇒ Providing Column Names in INSERT Statements in SQL Server
⇐ "INSERT INTO" - Inserting a New Row into a Table in SQL Server
2016-11-03, 2805🔥, 0💬
Popular Posts:
How To Connect ASP Pages to Oracle Servers in Oracle? If you are running Windows IIS Web server and ...
How To Escape Special Characters in SQL statements in MySQL? There are a number of special character...
Where to find answers to frequently asked questions on Transaction Management: Commit or Rollback in...
How to change the data type of an existing column with "ALTER TABLE" statements in SQL Server? Somet...
How To End a Stored Procedure Properly in SQL Server Transact-SQL? Where the end of the "CREATE PROC...