Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
nkpriya
Starting Member
34 Posts |
Posted - 2011-07-20 : 14:43:11
|
| Desgined a table with identity 'Yes' for autogenerating a column. It is working fine. As per my desired functionality, I need to drop that table and create it in the process. But, I need same values to be generated/retained for that column. Is there a way to do so?Eg:There is a test table:ID Name1 Ex12 Ex23 Ex3Id field is autogenerated.I am deleting all rows in the test table and inserting new rows. when I am inserting new rows, test table is generating values as 4,5,6. But, I need test table to generate the very first ID's like 1,2,3. Any ideas? Thanks |
|
|
robvolk
Most Valuable Yak
15732 Posts |
|
|
nkpriya
Starting Member
34 Posts |
Posted - 2011-07-20 : 15:04:52
|
| Thank you. I have a question though.I am deleting all rows of a table in SSIS package using OLEDB command and then inserting values in the table from another source. How can I achieve the identity_insert functionality in this process? Please let me know. Thanks |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2011-07-20 : 15:25:56
|
| On the OLE DB Destination Editor panel, under the Connection Manager pane, there's a checkbox for Keep Identity. Check that and you'll enable SET IDENTITY_INSERT on that destination table. |
 |
|
|
|
|
|