MS-SQL Error Message Replacement
| From: | ryan dot sinn at usbank dot com | Date: | Wed, 24 Jan 2001 19:21:37 +0000 |
| Subject: | MS-SQL Error Message Replacement | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-6143@lists.php.net to get a copy of this message | ||
I'm working with MS-SQL 7 and IIS 4 as well as PHP4.0.4 ---
My question is that when a message is received while attempting to delete a
row in [table x] while it is tied to [table y.column a] by a foreign key
relationship [see below]
Warning: MS SQL message: DELETE statement conflicted with COLUMN REFERENCE
constraint 'FK_COMPONENT_INDEX_page'. The conflict occurred in database
'corplan', table 'COMPONENT_INDEX', column 'pid'. (severity 16) in
D:
\Inetpub\wwwroot\admin\intranet.php on line 122
Warning: MS SQL: Query failed in D:\Inetpub\wwwroot\admin\intranet.php on
line 122
How can I put in my own custom message when these errors occur? Should I
be looking for a failed query message and then acting on that? I like the
protection that the foreign key relationship enables, because you can't
delete "parent" objects without removing the children first.
I'm sure this really isn't a difficult question, I'm looking for for
suggestions on how I should approach this.
Thanks,
Ryan Sinn
US Bank