How to define a parameter to insert Date in SQL Server?
I mean I want to create a table in SQL server which contain a column for birth date of customer so I want to know which parameter I must use in SQL server to distinguish that I want to insert date in record. Please guide me.

Joe WilsonPosted Feb 18, 2015, 12:13 AM
Jignesh TrivediPosted Feb 17, 2015, 11:15 PM
Hi,
You can apply Identity column on the column which has numeric data type like int, bigint etc....
and only one identity column possible with one table
If you are user of SQL 2012 that you can also use sequence please refer my article.
http://www.c-sharpcorner.com/UploadFile/ff2f08/sequence-in-sql-server-2012/
hope this will help you.
Joe WilsonPosted Feb 17, 2015, 11:58 AM
Vikrant MorePosted Feb 17, 2015, 10:16 AM
Joe WilsonPosted Feb 17, 2015, 8:13 AM
Joe WilsonPosted Feb 17, 2015, 8:12 AM
Saumitr SharmaPosted Feb 17, 2015, 1:05 AM
Jignesh TrivediPosted Feb 17, 2015, 12:34 AM
Hi,
It is not default value...
we cannot update the value of identity column.
Please refer below link to know more about identity column
https://technet.microsoft.com/en-us/library/aa933196(v=sql.80).aspx
http://www.sqlteam.com/article/understanding-identity-columns
hope this will help you.
Joe WilsonPosted Feb 17, 2015, 12:28 AM
Jignesh TrivediPosted Feb 16, 2015, 11:31 PM
Identity is used for auto increment value so no need to pass the value in this column SQL server automatic add incremental number in this column.
If you are user of SQL server 2008 and above so you can use DATE datatype to define birth date because in birth date we don't required time.
hope this will help you.
Joe WilsonPosted Feb 16, 2015, 12:25 PM
CustomerID INT and I want to use male and female in gender column in order to just choose one of male or female instead of typing one of them.
Vikrant MorePosted Feb 16, 2015, 11:36 AM
Lets see below create table statement,
CREATE TABLE CUSTOMER
(
CustomerID INT IDENTITY(1,1),
FirstName VARCHAR(100),
LastName VARCHAR(100),
DateOfBirth DATE
)
INSERT INTO CUSTOMER(FirstName,LastName,DateOfBirth) VALUES('Vikrant','More','1984-10-11')