-
Whyinsert new have must command line "SET IDENTITY_INSERT TableName ON"save in SQL?
I have a few for example insert new records, when the store must have "SET IDENTITY_INSERT TabeleName ON"; and "SET IDENTITY_INSERT TabeleName OFF"; other examples do not need 2 lines ON and OFF, if I wanted to give my 2 lines to adjust what ? you see the code below:
strSQL = "SET IDENTITY_INSERT TabUsername ON ";
strSQL = strSQL + "INSERT INTO TabUsername(USERNAME";
strSQL = ...
strSQL = strSQL + "SET IDENTITY_INSERT TabUsername OFF";
...
SqlCommand cmd = new SqlCommand(strSQL,cnn);
try
{
cmd.ExecuteNonQuery();
cnn.Close();
}
....
Similar Threads
-
Replies: 0
Last Post: 12-01-2007, 03:00 PM
-
By rohan.chandane in forum Java
Replies: 1
Last Post: 03-22-2006, 05:40 PM
-
By rohan.chandane in forum Java
Replies: 2
Last Post: 03-19-2006, 12:38 PM
-
Replies: 3
Last Post: 09-01-2005, 11:48 AM
-
Replies: 2
Last Post: 01-23-2001, 03:23 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|