Link to home
Create AccountLog in
Avatar of epicazo
epicazoFlag for United States of America

asked on

unable to set relationship

I am so new to this.  This is what I have.  I have the main DRSOURCE table and I want to set a one-to-many relationship to DRSOURCECOMPLIANCE.  But I get this error message:
'DRSOURCE' table saved successfully
'DrSourceCompliance' table
- Unable to create relationship 'FK_DrSourceCompliance_DRSOURCE'.  
Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.  Could not create constraint. See previous errors.
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
GO
COMMIT
BEGIN TRANSACTION
GO
ALTER TABLE dbo.DrSourceCompliance
	DROP CONSTRAINT FK_DrSourceCompliance_DrSourceCompliance
GO
ALTER TABLE dbo.DrSourceCompliance ADD CONSTRAINT
	FK_DrSourceCompliance_DrSourceCompliance FOREIGN KEY
	(
	src_number
	) REFERENCES dbo.DRSOURCE
	(
	SRC_NUMBER
	) ON UPDATE  NO ACTION 
	 ON DELETE  NO ACTION 
GO
COMMIT

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Kobe_Lenjou
Kobe_Lenjou
Flag of Belgium image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of epicazo

ASKER

thanks