Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

SSIS - SQL command doesnt work, error ?

$
0
0

Hi - when I am using below query in my SQL command in SSIS, its throwing error as below. What is the way for me to run this query correctly ?

I need to use this below query and generate a flatFile....how can I achieve this ?

it has a variable called @CompanyErpID

Declare @CompanyERpId varchar(50)
Set @CompanyERpId = '1158'


Select a.UserId + '|"' + replace(a.UserId,'brightstar\','') + '"|"' + isnull(a.FirstName,'') + ' ' + isnull(a.LastName,'') + '"|"' + case when a.IsLocked = 0 then 'ACTIVE' else 'INACTIVE' end + '"|"' + d.Name  + '"|"' + e.Name  + '"'
from adm.[user] a
inner join adm.userbycompany b on a.UserId = b.Userid
inner join adm.claimsbyuser c on a.userid = c.UserId
inner join adm.Claim e on c.ClaimId = e.id
inner join adm.company d on b.companyId = d.id
where (companyErpId = @CompanyERpId or @CompanyERpId = '0')
order by d.CompanyERPId, isnull(a.FirstName,'') + ' ' + isnull(a.LastName,'')



MBH




Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>