Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
error
must declare the scalar variable @path
how to fix this problem

What I have tried:

declare @path varchar(100)= 'c:\images\'

SELECT [ID]
,@path+[BLOBS] AS Path
FROM [cell].[dbo].[blobs]
Posted
Updated 29-Jul-20 0:37am
v3

1 solution

Not sure that declaration
declare @path varchar(100)= 'c:\images\'
will work as expected .. try
declare @path varchar(100)
set @path = 'c:\images\'
 
Share this answer
 
Comments
Member 12584383 29-Jul-20 6:41am    
not working
same error
Must declare the scalar variable @path
i am using SSIS tool
Garth J Lancaster 29-Jul-20 6:53am    
what is the definition/data-type of the BLOBS column ?
Member 12584383 29-Jul-20 7:05am    
image datatype
above solution worked fine post remove the 'c:\images\' at first line
and worked fine as when mention below statement
but new problem occurred

erro is ---
the declare curser sql construct or statement is not supported

Garth J Lancaster 29-Jul-20 7:06am    
other thing I can think of is this
SELECT [ID]
,@path + CONVERT(varchar(100),[BLOBS]) AS Path
FROM [cell].[dbo].[blobs]
Member 12584383 29-Jul-20 7:21am    
clicking on parse query that successfully parsed
but when we click on build query same error occurred
"the declare curser sql construct or statement is not supported"
my sql server version is 2005
please suggest

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