Toad World® Forums

Sql error

I’m getting the following when i run a sql using parameters.

Lookup Error - SQL Server Database Error: Must declare the scalar variable “@status”.

Declare

@status as char(10)

set @status = ‘dd’

select

v3.MODALITY,

v3.Load_Date,

v3.INSTDTE,

v3.WARRSTART,

v3.DEPT,

v3.BEC,

V3.Asset_num,

v3.CUSTNAME,

v3.[MCT class],

v3.MCT,

v3.[MCT TYPE],

v3.DEPT,

v3.[Cost Center],

v3.MODEL,

v3.SERIAL,

v3.Common_Name “BEC Desc”,

v3.[PM MONTH]

from

captrack.dbo.iDesk_rpt_Inventory_V3 v3

Any help would be greatly appreciated.

set @status = 'dd ’

Pad it as it’s a char, not a varchar()