I'm passing a text file name into a variable in a SP that will then forward that name and append it to a console application for processing. As far as I can see the code looks right but, I get a NULL Output when I EXEC the SP. My console application is in .NET Visual C#. Do I need to add an @ symbol or will the path info be parsed correctly?
Thanks for your help Experts.
/****** Object: StoredProcedure [dbo].[RunPingUtil] Script Date: 04/06/2009 08:30:40 ******/
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
ALTER Procedure [dbo].[RunPingUtil]
SET NOCOUNT ON;
DECLARE @Workstations varchar(max)
SET @Workstations = '\\Crprchblgsrd\d$\ProofOfConcept\data.txt'
DECLARE @CommandLine sysname;
SET @CommandLine = '\\Crprchblgsrd\d$\ProofOfConcept\ProofOfConcept.exe ' + @Workstations + '';
EXEC xp_cmdshell @CommandLine;