dbTalk Databases Forums  

Sql Server task failing for parameters

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


Discuss Sql Server task failing for parameters in the microsoft.public.sqlserver.dts forum.



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

Default Sql Server task failing for parameters - 06-10-2005 , 05:13 AM






Dear all,

When I am building a sql server task I am not be able to put a global
variable inside a dynamic command.

Look at this:

SET @bcpCommand= 'bcp ' + @db + '' + @table + ' out ' + @strPath +
'.dat -c -S ' + @host + ' -U ' + @strUser +' -P ' + ? + ''

The last one, i.e (?) must be a parameter but returns me an error. And the
before ones are variables declared inside the task.

What’s happening?

Regards,


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

Default Re: Sql Server task failing for parameters - 06-13-2005 , 01:01 AM






How are you doing this? You look to be using a mixture of TSQL and DTS.

Have a look here for a DTS way to this

How to manipulate the Execute Process task.
(http://www.sqldts.com/default.aspx?251)

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"Enric" <Enric (AT) discussions (DOT) microsoft.com> wrote

Quote:
Dear all,

When I am building a sql server task I am not be able to put a global
variable inside a dynamic command.

Look at this:

SET @bcpCommand= 'bcp ' + @db + '' + @table + ' out ' + @strPath +
'.dat -c -S ' + @host + ' -U ' + @strUser +' -P ' + ? + ''

The last one, i.e (?) must be a parameter but returns me an error. And the
before ones are variables declared inside the task.

What's happening?

Regards,




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.