--Start of XML Parser
DECLARE @FileName1 varchar(255)
DECLARE @ExecCmd VARCHAR(255)
DECLARE @FileContents VARCHAR(8000)
DECLARE @idoc int
DECLARE @UserName varchar(60)
DECLARE @Password varchar(60)
CREATE TABLE #tempXML(PK INT NOT NULL IDENTITY(1,1), ThisLine VARCHAR(255))
SET @FileContents = ''
SET @FileName1 = 'd:\CCCLoginConfig.dtsConfig'
SET @ExecCmd = 'type ' + @FileName1
INSERT INTO #tempXML EXEC master.dbo.xp_cmdshell @ExecCmd
DECLARE @AccountID varchar(8000)
DECLARE @getAccountID CURSOR
SET @getAccountID = CURSOR FOR select ThisLine from #tempxml
OPEN @getAccountID
FETCH NEXT FROM @getAccountID INTO @AccountID
WHILE @@FETCH_STATUS = 0
BEGIN
SET @FileContents = @FileContents + isnull(cast(@AccountID as varchar(8000)),'')
FETCH NEXT FROM @getAccountID INTO @AccountID
END
CLOSE @getAccountID
DEALLOCATE @getAccountID
EXEC sp_xml_preparedocument @idoc OUTPUT, @FileContents
SELECT text FROM OPENXML (@idoc,'/DTSConfiguration/Configuration/ConfiguredValue',1) where nodetype=3
SELECT @UserName=text FROM OPENXML (@idoc,'/DTSConfiguration/Configuration/ConfiguredValue',1) where id=27
SELECT @Password=text FROM OPENXML (@idoc,'/DTSConfiguration/Configuration/ConfiguredValue',1) where id=25
print @UserName
print @Password
DROP TABLE #tempXML
--End of XML Parser