We all know about setting Identity to a column of a table.
By setting identity to a column, we mean that the column should be populated automatically by incrementing numbers based on the seed and increment option we give.
But all these days, i was setting the identity to a column of a table which had more than 2 columns.
Just think of having a table with only one column and setting identity to that Column.
Create Table IdentityTest
(Slno int identity(1,1))
When you run this query, it will create a table named IdentityTest with the column Slno with identity on it.
What next????
The next question would be, how to insert data to this table?
Any idea, on how to insert data to this table?
Here is how you insert data to this table..
Insert Into IdentityTest Default Values
And now after reading this post, you are now familiar with inserting data to a table which has only one column and identity set on it. :)
2 comments:
hey i didn't know that.. rather i didn't think of it.. good post.. :)
Aivivu đại lý vé máy bay, tham khảo
vé máy bay đi Mỹ giá bao nhiêu
chuyến bay thẳng từ mỹ về việt nam
chuyến bay từ frankfurt đến hà nội
ve may bay tu nga ve viet nam
vé máy bay từ anh về việt nam
các chuyến bay từ châu âu về việt nam
chuyến bay chuyên gia
Post a Comment