Originally posted by acoder
I don't think its going to work because it gave me the following error when i tried the new query.An can't mess with any of the sizes of the fields. I tried even deleteing every record i had an redoing it so i know its referring to the field itself.
Msg 1753, Level 16, State 0, Line 1
Column 'dbo.tbl_CS_ser ial.pka_serialN o' is not the same length as referencing column 'tbl_CS_notes_d escr.fk_serialN o' in foreign key 'thefkserial'. Columns participating in a foreign key relationship must be defined with the same length.
Msg 1750, Level 16, State 0, Line 1
Could not create constraint. See previous errors.
how could i make it work the other way because i tried putting it in the following
Code:
<cfset serialList = ArrayToList(serialcheck, ",")> <!---when inserting/updating for serial's table is done it then delete serials not being updated/inserted or was to be deleted on purpose---> <cfloop query="countserials"> <CFSET serialnum = #pka_serialNo#> <!---if the serial is not found in the list it begins deleteing---> <cfif not listFind(serialList,serialnum)> <cfquery name="deleteserialparts" datasource="CustomerSupport"> exec usp_CS_Deleteserialparts <cfqueryparam value="#serialnum#" CFSQLType = "CF_SQL_VARCHAR">, '#Form.pk_ticketID#' </cfquery> <cfquery name="deletedescription" datasource="CustomerSupport"> exec usp_CS_Deletenotesdescription <cfqueryparam value="#serialnum#" CFSQLType = "CF_SQL_VARCHAR">, '#Form.pk_ticketID#' </cfquery> </cfif> </cfloop>
Code:
set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go -- ============================================= -- Author: <Author,,Name> -- Create date: <Create Date,,> -- Description: <Description,,> -- ============================================= ALTER PROCEDURE [dbo].[usp_CS_Deletenotesdescription] -- Add the parameters for the stored procedure here (@fk_serialNo nvarchar(100), @fk_ticketNo nvarchar(100)) as delete from dbo.tbl_CS_notes_descr where (fk_serialNo = @fk_serialNo and fk_ticketNo = @fk_ticketNo)
Thank you,
Rach
Comment