March 13, 2009 at 12:37 am
hi,
I had tried the following code for executing a package by passing paramaters.
declare @cmd varchar(1000)
declare @ssispath varchar(1000)
declare @fileName varchar(1000)
declare @database varchar(1000)
declare @tableName varchar(1000)
set @ssispath = 'C:\Package.dtsx'
set @fileName = 'C:\temp\test.csv'
set @tableName = 'test'
select @cmd = 'dtexec /F "' + @ssispath + '"'
select @cmd = @cmd + ' /SET \Package.Variables[User::fileName].Properties[Value];"' + @fileName + '"'
select @cmd = @cmd + ' /SET \Package.Variables[User::fileName].Properties[Value];"' + @tableName + '"'
exec Master..dbo.xp_cmdshell @cmd
The error i got is
Could not find server 'Master' in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinkedserver to add the server to sys.servers.
I havent used any linked server .What might be the problem?..
Regards
vijay
March 13, 2009 at 6:55 am
You have an extra period between Master and dbo, thus SQL Server thinks that Master is a linked server not a database. Try this:
exec Master.dbo.xp_cmdshell @cmd
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply