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

Billy Pang tuxedo_man at hotmail.com
Wed Mar 19 14:39:14 CST 2003


just wondering, this database, did you upsize it from Access using upsizing 
wizard?

also, try running the following in QA:
EXEC SP_fkeys @pktable_name = 
'THE_TABLE_YOU_ARE_TRYING_TO_DELETE_RECORDS_FROM'

Look in the FKTABLE_NAME column for the child tables related to the parent 
table.

HTH

Billy





>From: David Emerson <davide at dalyn.co.nz>
>Reply-To: dba-sqlserver at databaseadvisors.com
>To: dba-sqlserver at databaseadvisors.com
>Subject: Re: [dba-SQLServer]Deleting record (Column Reference   Constraint)
>Date: Thu, 13 Mar 2003 11:23:03 +1300
>
>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
>
>_______________________________________________
>dba-SQLServer mailing list
>dba-SQLServer at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
>http://www.databaseadvisors.com


_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail




More information about the dba-SQLServer mailing list