[dba-SQLServer]Deleting record (Column Reference Constraint)

David Emerson davide at dalyn.co.nz
Wed Mar 12 16:23:03 CST 2003


When I run this the results grid show 0 rows affected.  This matches with 
the table properties in Access which show no check constraints in the 
properties window.

David

At 12/03/2003, you wrote:
>In QA, I use this script to find constraints on my tables
>
>USE YOURDBNAMEHERE
>Declare @Var as varchar(100)
>SET @Var = 'THE_TABLE_YOUR_TRYING_TO_DELETE_FROM_NAME_HERE'
>
>SELECT constraint_name,
>  column_name,
>  Table_Name,
>  ordinal_position
>FROM information_schema.key_column_usage
>WHERE constraint_catalog = db_name()
>    AND (CONSTRAINT_NAME Like '%' + @Var OR CONSTRAINT_NAME Like '%' + @Var
>+'%')
>    AND LEFT(CONSTRAINT_NAME,2) = 'FK'
>ORDER BY constraint_name, ordinal_position
>
>-Francisco
>http://rcm.netfirms.com
>
>On Wednesday, March 12, 2003 12:30 PM [GMT-8],
>David Emerson <davide at dalyn.co.nz> wrote:
>
>: Thanks for your reply.  Where do I find the definition reference?
>:
>: At 12/03/2003, you wrote:
>:: The only time I've seen this type of error is when a related record
>:: is going to be deleted.  What is the defenition reference for
>:: tblCustInvoiceMeter_FK00?
>::
>:: -Francisco
>:: http://rcm.netfirms.com
>::
>:: David Emerson wrote:
>::: AXP/SQL2K
>:::
>::: I have a subform which causes an error message when I delete a
>::: record from it -
>:::
>::: DELETE statement conflicted with COLUMN REFERENCE constraint
>::: 'tblCustInvoiceMeter_FK00'.
>:::
>::: BOL doesn't seem to help.
>:::
>::: There are no related records to the one I am deleting.  Can anyone
>::: enlighten me on the problem?
>:::
>:::
>::: Regards
>::
>::
>:: _______________________________________________
>:: dba-SQLServer mailing list
>:: dba-SQLServer at databaseadvisors.com
>:: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
>:: http://www.databaseadvisors.com
>:
>: Regards
>:
>: David Emerson
>: DALYN Software Ltd
>: 25b Cunliffe St, Johnsonville
>: Wellington, New Zealand
>: Ph/Fax (877) 456-1205
>:
>: _______________________________________________
>: dba-SQLServer mailing list
>: dba-SQLServer at databaseadvisors.com
>: http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
>: http://www.databaseadvisors.com
>
>
>_______________________________________________
>dba-SQLServer mailing list
>dba-SQLServer at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
>http://www.databaseadvisors.com

Regards

David Emerson
DALYN Software Ltd
25b Cunliffe St, Johnsonville
Wellington, New Zealand
Ph/Fax (877) 456-1205 




More information about the dba-SQLServer mailing list