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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Changing database table scheme (Expanding)

Author  Topic 

dotnet2010
Starting Member

7 Posts

Posted - 2012-01-05 : 04:53:29
Hi
I want to add new columns to exists database that works with SSIS,SSRS and asp.net application, I want to do that in the best way without the need to do a lot of changes at SSIS since I know that any change at database will make the SSIS packages stop working.
I thought about adding new tables that extends the exists ones example
Table Original table TBA - new table TBAExtra
Also I have archiving Mechanism that copy the data from TBA to TBAArchive table.

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-01-05 : 05:16:28
What is your question?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2012-01-05 : 05:19:02
"I thought about adding new tables that extends the exists ones example"

You could do that, tends to be a bit of a PITA going forwards though, and the JOIN to get the extra data columns adds "effort" to the CPU etc.

An alternative is to rename the Table Original table TBA - to TBA_V2, and add the extra columns to that, and then create a VIEW, called "TBA", that only has the original columns.

You need to change all INSERT/UPDATE/DELETE to reference the new TBA_V2 table, but in the short term (or for backward compatibility) you can put an INSTEAD OF trigger on the TBA View (personally I have found them troublesome in terms of side effects etc. so if you can easily change ALL references to INSERT/UPDATE/DELETE on the original TBA table to reference TBA_V2 instead my advice would be to go down that route. Add an INSTEAD OF TRIGGER on the View that does RAISERROR so that you at least find out if anything is still trying to DML the original TBA table.
Go to Top of Page
   

- Advertisement -