Using SQL Server 2008 - Split text inside Stored procedure and build sql.
I have stored procedure that takes single input parameter as varchar(100).
Input parameter will have text something like this:
'FUSE BLOCK' <-----this is just a sample, will be more than 2 words...
I want to split the Text based on single space in between and build like SQL;
IF 'FUSE BLOCK'
Select * from dbo.Part Where Name LIKE '%FUSE%' AND Name LIKE '%BLOCK%'
Select * from dbo.Part Where Name LIKE '%FUSE%'
Select * from dbo.Part Where Name LIKE '%BLOCK%'
it should be dynamic based on the spilt characters...any idea how to do it?