dbTalk Databases Forums  

the sql statement does not contain any parameters

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss the sql statement does not contain any parameters in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
pradeep
 
Posts: n/a

Default the sql statement does not contain any parameters - 02-18-2004 , 11:08 PM






Hi,

I need to populate a global variable by getting a output parameter
from the execution of following sql on sybase. But when i click the
parameters button,
i get following error "the sql statement does not contain any
parameters".
I tried sql with meta data same as output produced by this sql. E.g.
"select convert(char(8), getdate(), 112) as businessday"
and then putting real sql using disconnected edit. Still i couldn;t
make any headway. Any ideas...

--------------------------------------------------------------------------
set nocount on
declare @ctr int, @weekday int, @lastBusinessDay datetime,@lbdFound
int,@cnt int
select @ctr=1
select @lbdFound=0
while (@lbdFound<>1)
begin
select @lastBusinessDay = dateadd(dd, - @ctr, GETDATE())
select @weekday= datepart(dw, @lastBusinessDay)

if ((@weekday<>1) AND (@weekday<>7)) AND not exists(select *
from holiday where holiday_date=@lastBusinessDay)
select @lbdFound=1
select @ctr = @ctr +1
end
select convert(char(8), @lastBusinessDay , 112) as businessday
go
------------------------------------------------------------------------------

Thanks,
pradeep

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: the sql statement does not contain any parameters - 02-19-2004 , 02:05 AM






Can you not put this in a Stored Proc and have the value returned as an
OUTPUT parameter?

--

----------------------------

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"pradeep" <pradeep.mittal (AT) citigroup (DOT) com> wrote

Quote:
Hi,

I need to populate a global variable by getting a output parameter
from the execution of following sql on sybase. But when i click the
parameters button,
i get following error "the sql statement does not contain any
parameters".
I tried sql with meta data same as output produced by this sql. E.g.
"select convert(char(8), getdate(), 112) as businessday"
and then putting real sql using disconnected edit. Still i couldn;t
make any headway. Any ideas...

--------------------------------------------------------------------------
set nocount on
declare @ctr int, @weekday int, @lastBusinessDay datetime,@lbdFound
int,@cnt int
select @ctr=1
select @lbdFound=0
while (@lbdFound<>1)
begin
select @lastBusinessDay = dateadd(dd, - @ctr, GETDATE())
select @weekday= datepart(dw, @lastBusinessDay)

if ((@weekday<>1) AND (@weekday<>7)) AND not exists(select *
from holiday where holiday_date=@lastBusinessDay)
select @lbdFound=1
select @ctr = @ctr +1
end
select convert(char(8), @lastBusinessDay , 112) as businessday
go
--------------------------------------------------------------------------
----

Thanks,
pradeep



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.