Click here to Skip to main content
14,608,087 members
Rate this:
Please Sign up or sign in to vote.
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

Rate this:
Please Sign up or sign in to vote.

Solution 1

Not sure that declaration
declare @path varchar(100)= 'c:\images\'
will work as expected .. try
declare @path varchar(100)
set @path = 'c:\images\'
   
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
Member 12584383 30-Jul-20 0:57am
   
any help on above query
Garth J Lancaster 30-Jul-20 2:04am
   
you haven't shown the full procedure, so I don't know about the cursor construct - it's a bit like trying to work blindfolded

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100