September 18, 2012 at 3:42 pm
I am modifying a script that creates Jobs, is it possible to achieving the following;
@command=N'Some Command' + @ANOTHER_VARIABLE
I need to tag the contents of another variable to then end of one being set.
Can anyone explain how i could achieve this, my real life example is
@command=N'Exec dbo.pReport_Update_Unit ''E:\MyData\Target\CSV''',
I need the Path including single quotes to be passed in by a variable set further up the script, i expected my script to work or look something like below;
e.g.
DECLARE @variable varchar(100)
SET @variable = ''E:\MyData\Target\CSV''
@command=N'Exec dbo.pReport_Update_Unit '+@variable,
September 19, 2012 at 1:46 am
Can anyoen help with this.
Thanks
September 19, 2012 at 2:08 am
samtwilliams (9/19/2012)
Can anyoen help with this.Thanks
DECLARE @variable varchar(100), @command VARCHAR(500)
SET @variable = 'E:\MyData\Target\CSV'
SET @command = N'Exec dbo.pReport_Update_Unit ''' + @variable + ''''
SELECT @command
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply