Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 sp_executesql problem

Author  Topic 

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2005-03-22 : 08:40:00
Hi!!!!

I'm trying to use this Sql Server command in my asp.net page but it doesn't seem to work...

I want to insert a binary value on a data table, and it doesn't give me an error but when I make a response.write of the field i entered it has nithing

heres is the statement:

CREATE PROCEDURE InsertBinary
@tableName varchar(255),
@id varchar(255),
@fieldName varchar(255),
@dataBinary binary
AS


DECLARE @BinaryVariable binary
DECLARE @SQLString NVARCHAR(500)
DECLARE @ParmDefinition NVARCHAR(500)

/* Build the SQL string once.*/
SET @SQLString =
N'UPDATE ' + @tableName + ' set ' + @fieldName + '= @data WHERE id = ' + @id

SET @ParmDefinition = N'@data binary'

/* Execute the string with the first parameter value. */
SET @BinaryVariable = @dataBinary
EXECUTE sp_executesql @SQLString, @ParmDefinition,
@data = @BinaryVariable
GO

Can anyone tell me if this is wrong ??
Thanks in advance

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-03-22 : 08:43:07
so you want a binary output to the page?
use Response.BinaryWrite

Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -