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 |
|
coreHP418
Starting Member
1 Post |
Posted - 2011-01-27 : 14:40:01
|
| I've got a table.MyTable (oldPK, NewPK, Name)We've recently restructured several of our tables to use a new primary key. I want to be able to select data using the oldPK column but I no longer want to allow inserts into that column.Is there a way to disable the column? I was thinking of marking it as unused however that will remove any chance of selecting / restoring that historical data.Update ** I also thought about maybe trying to make the column ReadOnly.. Can this be done without using a trigger/job? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-01-28 : 01:50:31
|
| One more option is to use a view that excludes oldPK and use that for insertion. To query using oldPK use the actual tableMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|