Hey all I am trying to figure out how to do this query using MS SQL T-SQL that will allow me to query the table it finds the data in. Currently I have this in a stored procedure and the @Temp is the temp table it puts the results in. It just shows that it found the data in table X in Column X.
SELECT SchemeName, TableName, ColumnName
FROM @Temp
WHERE DataFound = 1
What I am trying to do is to take that TableName & ColumnName and do another query to pull all the data from that table back that it found that search word on.
The stored procedure execute looks like this:
USE [CoreDB]
GO
DECLARE @return_value int
EXEC @return_value = [dbo][findMyString]
@DataToFind = N'xml',
@ExactMatch = 0
SELECT 'Returned Value' = @return_value
GO
I am searching for the word XML above. The 0 means the exact word or 1 means a wildcard %%. The output from the above looks like this:
How would one do this in a stored procedure?