@id=10
@columnName = Eating
@facebookuser = Derek
Error message:
Conversion failed when converting the nvarchar value 'UPDATE ImageAttributes SET FacebookUser = Derek,[Eating] = 1 where ImageID = ' to data type int.
The datatypes in the database in relation to these parameters are as follows:
ImageID = int
Eating=varchar(50)
FaceBookUser=varchar(50)
Here is the stored procedure:
USE [CatCam] GO /****** Object: StoredProcedure [dbo].[update_imagerecord] Script Date: 06/15/2008 18:33:29 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[update_imagerecord] @id int, @columnName varchar(50), @facebookuser varchar(50) AS DECLARE @command varchar(1000) SET @command= 'UPDATE ImageAttributes SET FacebookUser = ' + @facebookuser + ',' + QUOTENAME(@columnName) + ' = 1 where ImageID = ' + @id + '' EXEC (@command)
Any help or suggestions would be much appreciated.
Thanks

New Topic/Question
Reply



MultiQuote





|