.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

T-SQL

Posted By:      Posted Date: September 09, 2010    Points: 0   Category :Sql Server
 
Hi, I am trying to add a foreign key constraint in a table but i am getting the following error The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "horsetahsil". The conflict occurred in database "LstockhhWB", table "dbo.Tahsil_Master". I am posting my table structure below: CREATE TABLE [dbo].[T_Horse](  [user_nm] [varchar](150) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,  [sb_code] [varchar](2) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,  [state_code] [varchar](2) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,  [dist_code] [varchar](2) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,  [tahsil_code] [varchar](4) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,  [village_code] [varchar](8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,  [ward_code] [varchar](4) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,  [HHSno] [varchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,  [hm1] [bigint] NULL,  [hm2] [bigint] NULL,  [hm3] [bigint] NULL,  [hf1] [bigint] NULL,  [hf2] [bigint] NULL,  CONSTRAINT [PK_HORSE] PRIMARY KEY CLUSTERED (  [sb_code] ASC,  [state_code] ASC,  [dist_code] ASC,  [tahsil_code] ASC,  [village_code] ASC,  [ward_code] ASC,  [HHSno] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] and CREATE TABL


View Complete Post


More Related Resource Links

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend