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 |
waterduck
Aged Yak Warrior
982 Posts |
Posted - 2011-09-09 : 12:13:06
|
Dear All,Any idea what causes all the foreign key went missing??The only thing i done was restore the same database with a different database name.... |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
waterduck
Aged Yak Warrior
982 Posts |
Posted - 2011-09-15 : 02:30:51
|
Errrr.....no ppl logged into the database other den me.... |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-15 : 02:42:05
|
how did you backup restore the db?did you take scripts and did it?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
waterduck
Aged Yak Warrior
982 Posts |
Posted - 2011-09-15 : 04:47:13
|
Nah....manual backup and restore as another name( both mdf n ldf) at other drive...weird huh? |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-15 : 05:26:09
|
then no chance of it getting dropped unless someone did it intentionally------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
waterduck
Aged Yak Warrior
982 Posts |
Posted - 2011-09-16 : 08:39:23
|
Had to define tat someone is a ghost den....>.< |
 |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2011-09-16 : 09:13:33
|
Two options: 1) The backup that you restored didn't have the foreign keys in2) Someone or some app dropped them after the restoreSQL doesn't just remove objects. I've had 3 other threads like this in the last week (view going missing, index going missing, table going missing). In all cases the OP swore that there were no drop statements and no one was manually dropping the objects. In all three they later found that there were unexpected drop statements in code (in procedure or trigger) that were dropping the objects--Gail ShawSQL Server MVP |
 |
|
Kristen
Test
22859 Posts |
Posted - 2011-09-18 : 03:54:03
|
If you have transaction log backups you could go back and see when the objects were dropped, which could then help you diagnose the cause. |
 |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2011-09-18 : 08:58:44
|
The default trace will show this -- unless you've modified or disabled it. |
 |
|
|
|
|