I use the code below to delete records from a table called Distribution. The deletion works fine each time. But I need to have an after delete trigger for that table and each time I create the trigger the delete code gives the error:
String or binary data would be truncated.
The statement has been terminated.
Here is the code for the Trigger:
ALTER Trigger [dbo].[DelTicket] on [dbo].[Distribution]
After Delete As
if ((Select count(*) from Deleted) > 1)
Insert Into dbo.ClosedTickets
Select * From
And here is the code for the delete statement:
public void deleteTicket(int selectedID)
SqlConnection con = null;
con = new SqlConnection("Server=PC;;Database=SupportProject;integrated security=True");
SqlCommand comm = new SqlCommand("delete from Distribution where ID=@ID",con);
comm.Parameters["@ID"].Value = selectedID;
// Execute the command