Assuming cursor1 is required, the following 3 results were found.
SET @myCounter = 0; SET @minStrLen = LEN(@p_SearchString) - 1; SET @maxStrLen = LEN(@p_SearchString) + 1; -- Populate Cursor1 (used to generate final SQL query to run) DECLARE Cursor1 CURSOR FOR SELECT 'SELECT ' + COLUMN_NAME + ' COLLATE...
BEGIN -- Declare some variables to use DECLARE @SqlToExecute varchar(max), @TableToProcess varchar(max); -- Populate Cursor1 (Used to hold valid table names) DECLARE Cursor1 CURSOR FOR SELECT TABLE_CATALOG + '.' + TABLE_SCHEMA + '.' + TABLE_NAME FROM...
Parse comma delimited string into a table SELECT @myXml = CONVERT(xml,'' + REPLACE(@p_SearchColumns,',','') + ''); DECLARE Cursor1 CURSOR FOR SELECT [Value] = T.c.value('.','varchar(max)') FROM @myXml.nodes('/root/s') T(c); -- Create temporary table to...