I have this query running against 2008R2. tblJoin
is the table in between two tables(tblIncident
and tblPatron
) for many-to-many relationship.
While I am building the query in VS2012, in the Query Builder window when I execute the query it runs fine and gives me the desired results. However in the last step when I click on TestQuery and enter the parameter it gives an error:
"Failed to enable constraints.."
I checked the datatype and they all match against each other against the tables,
SELECT tblIncident.Inci_ID,
_tblJoin.PatronID,
_tblJoin.LName,
_tblJoin.FName,
_tblJoin.MI
FROM tblJoin INNER JOIN
tblIncident ON tblJoin.InciID = tblIncident.Inci_ID AND tblJoin.InciID = tblIncident.Inci_ID
WHERE (tblIncident.Inci_ID = @Inci_ID)