February 17, 2017 at 11:53 pm
HI,
CREATE TABLE #T(I IMAGE)
INSERT INTO #T VALUES(CAST(N'CREATE PROCEDURE SP1
@I IMAGE
AS
BEGIN
SELECT ''δΈδΊ''
END
' AS VARBINARY(MAX)))
declare @s-2 NVARCHAR(MAX)
SET @s-2 = (SELECT TOP 1 CAST(CAST(I AS varbinary(MAX)) AS NVARCHAR(MAX)) FROM #T)
EXEC (@S)
DROP TABLE #T
--I want to put storedproc's text in image col , then i want to get the text and excute them in database.
is conversion and execuation is correct , that is,is there any thing i am missing?
-- SHOULD I USE SP_EXCUTE insted of exec,BUT I NOTICED I DO NOT HAVE ANY PARAMS.
pls suggest ?
--we are planning to change image type but for now , this is the option.
February 18, 2017 at 2:18 am
Out of curiosity, why do you want to do this?
π
February 21, 2017 at 10:20 am
Eirikur Eiriksson - Saturday, February 18, 2017 2:18 AMOut of curiosity, why do you want to do this?
π
it is a sync of ddl, from one database to other database.
but answer can be given.
February 21, 2017 at 10:43 am
Image is a deprecated data type. Why do you want to use it instead of varbinary(max)?
February 21, 2017 at 12:03 pm
rajemessage 14195 - Tuesday, February 21, 2017 10:20 AMEirikur Eiriksson - Saturday, February 18, 2017 2:18 AMOut of curiosity, why do you want to do this?
πit is a sync of ddl, from one database to other database.
but answer can be given.
As you chose NOT to effectively answer the question, I can't really justify even looking into whether or not this is practical. To be honest, this looks more like hacking research... to learn how an attack vector might be easily hidden. I can't even come up with one single benefit of doing this that doesn't involve hacking research. Until you can be more forthcoming, I'm not even remotely interested.
Steve (aka sgmunson) π π π
Rent Servers for Income (picks and shovels strategy)
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply