Click here to Skip to main content
15,913,722 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Here is my table name contacts
Column name             Datatype            (? tree view tickboxes ?(RD sp))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
contacttypedetailid	int	             Unchecked
contactid	        char(6)	             Checked
contacttypecode	        char(3)	             Checked
Applicable	        char(1)	             Checked
TargetAmount	        decimal(18, 0)       Checked

The query:
select * from contacts

output:
contacttypedetailid	contactid	contacttypecode	  Applicable	  TargetAmount
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~	        
1	                     1     	    01 	             T	               0
2	                     1     	    02               T	               0
3	                     2     	    01 	             T	               0

while ("deleting") running procedure, I am getting error.

(The Deleting Procedure):
create PROCEDURE [dbo].[SP_DeleteContacttypeDetail]
            @contactid as int
  AS
  BEGIN
    Delete from contacttypedetail where contactid=@contactid 
  END

Here while executing these procedure am getting error.
Posted
Updated 25-Apr-13 5:56am
v4

1 solution

Change your query as shown below
SQL
SELECT * FROM contacts WHERE contactid = '1'
As per your table definition contactid is a string field.

Regards,
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900