sql server - SQL: creating a string array and query = like all strings in array -
I have a SQL Server 2005 report that takes a parameter in a query string that searches for customer names. The problem is that some customers should keep in the middle, when the user 'John Smith' will not bring it 'John Q Smith'.
By using only SQL, how do I split a string? An array by white space then searches for the result that matches each string in the array?
Try this SQL Server 2005
announcement @username Name VARCHAR (Maximum) SELECT @UserName = 'John Smit' DECLARE @User TABLE (Username VARCHAR (MAX)) Include in User (Username) Select 'John Smit' INSERT User Name (User Name, '', '% ')
Comments
Post a Comment