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 |
|
CLages
Posting Yak Master
116 Posts |
Posted - 2005-10-19 : 16:48:47
|
| hi, where is my mistake if i run this taken from BOL, @@error return 547USE pubsGOUPDATE authors SET au_id = '172 32 1176'WHERE au_id = '172-32-1176'IF @@ERROR = 547 print 'I got a Error' But if i change au_id to a Invalid key i get no Erros in @@error @@error return 0does any body knows why?tksC. Lages USE pubsGOUPDATE authors SET au_id = '172 32 1176'WHERE au_id = 'xxx-32-1176'IF @@ERROR = 547 print 'I got a Error' |
|
|
nathans
Aged Yak Warrior
938 Posts |
Posted - 2005-10-19 : 16:53:19
|
| Because you didnt update anything.select count(*) from authors where au_id = '172-32-1176'select count(*) from authors where au_id = 'xxx-32-1176'Nathan Skerl |
 |
|
|
rockmoose
SQL Natt Alfen
3279 Posts |
Posted - 2005-10-19 : 16:53:48
|
Because no rows are updated for : 'xxx-32-1176'Thus no foreign key violation (547) occurs. |
 |
|
|
|
|
|