TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Nirav Prabtani
NA
215
3.3k
How to maintain identity column value during SQL bulk copy t
Nov 1 2014 6:12 AM
Hi,
I am doing sqlbulkcopy from one table to another table.
There are so many tables to do that.
I am copying data with for loop for each tables.
But, i am facing with an issue, whenever i copy data from source table to destination table than identity column value is getting changed.
Suppoose there is value like this in identity column of a source table
301
305
605
but when i copy data than it will imported in destination table like that
1
2
3
1) I have tried,
set identity_insert [tablename] ON
//COPY Data from source to destination
set identity_insert [tablename] OFF
2) I have also set SqlBulkCopyOption.KeepIdentity
Any solution will be highly appriciable.
Reply
Answers (
1
)
sub report
I want your help to finish my project