Extracting XML content from an XML file from within SQL Server 2000 using Managed Code - Testing the .NET component from within SQL Server 2000 (Page 4 of 5 )
After completing all of the above steps, we need to test the component. To test the component, the first issue is that we need to create an XML file in any path. As this is a demonstration, I created a simple file (Sample.xml) in my root C drive. The content within that Sample.xml file would be as follows:
After saving the above XML, open up your query analyzer and type the following Transact-SQL code, to test the component:
DECLARE @ExecutionResult INT, @errorSource VARCHAR(100), @errorDescription VARCHAR(100), @result VARCHAR(800),@hnd INT
Just press F5 to execute the script and it should return to you the content available in the c:\sample.xml file. It is not necessary to handle the errors as above, but it is a good practice to have it included.