Sunday, February 19, 2012

Cannot insert a foreign key

SQLCE database being replicated. I have 3 tables where I'm getting an
exception on Inserts and I've isolated the issue to the foreign key (I can
do an Insert on those tables if I leave the FK null).
I have no constraints on any of these tables (except the PK), and I've
dropped all relationships. Why in the world can I not just shove ANY integer
into the FK?
can you post your schema here?
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Earl" <brikshoe@.newsgroups.nospam> wrote in message
news:e3%239cm4VFHA.3076@.TK2MSFTNGP12.phx.gbl...
> SQLCE database being replicated. I have 3 tables where I'm getting an
> exception on Inserts and I've isolated the issue to the foreign key (I can
> do an Insert on those tables if I leave the FK null).
> I have no constraints on any of these tables (except the PK), and I've
> dropped all relationships. Why in the world can I not just shove ANY
integer
> into the FK?
>
|||CREATE TABLE [dbo].[ProspectResults] (
[ProspectResultID] [int] IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL ,
[ProspectID] [int] NULL ,
[Result] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[EmpID] [int] NULL ,
[EvtDateTime] [datetime] NULL ,
[PocketPCID] [int] NULL ,
[Notes] [nvarchar] (2000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[ProspectResult_rowguid] uniqueidentifier ROWGUIDCOL NOT NULL
) ON [PRIMARY]
GO
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:eo4Mfp6VFHA.1044@.TK2MSFTNGP10.phx.gbl...
> can you post your schema here?
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "Earl" <brikshoe@.newsgroups.nospam> wrote in message
> news:e3%239cm4VFHA.3076@.TK2MSFTNGP12.phx.gbl...
> integer
>

No comments:

Post a Comment