Click here to Skip to main content
15,894,825 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
For ex the table adc contains 3 column like col1, col2, col3 respectively (col3 which having multiple value like ab, cd, ef)
i just want o search the record like "select * from abc where col3 = 'cd'"
Posted

Perhaps you're question is answered by Solution 1? But I get a different question from your title. And my proposal is a solution to multi-line data that I used to transform that "rowset" type of table, in an input file for instance, into a single-line "one record" for per-line TSQL table:
CREATE TABLE [instance].[schema].[oneliner](
    [boxcarred][nvarchar](MAX)
     )
CREATE TABLE [instance].[schema].[onelinerIdx](
    [idx][int]IDENTITY(1,1),
       [boxcarred][nvarchar](MAX)
        )
BULK INSERT [instance].[schema].[oneliner] FROM 'C:\users\clrue\MFLL.txt'
    WITH (
          CODEPAGE = 'ACP'
          )
INSERT INTO [instance].[schema].[onelinerIdx]
    SELECT [boxcarred] FROM [instance].[schema].[oneliner]

Once in the table, the data is either one line or multiple lines, right?
Now create one more table, and filter that last indexed single/multi through a REPLACE ...
CREATE TABLE [instance].[schema].[nohammer](
    [idx][int],
        [seetosearch][nvarchar](MAX)
         )
INSERT INTO [instance].[schema].[nohammer]
    SELECT [idx], REPLACE([seetosearch],CHAR(13)+CHAR(10),' ') FROM [instance].[schema].[onelinerIdx]

Now search this target "string" usg whatever. Get it? Not a table now, just a string ...
 
Share this answer
 
SELECT column_name(s)
FROM table_name
WHERE column_name LIKE pattern

Use LIKE Instead of "=" in the select command...




Best Regards
Hemant Tyagi
+91- 9045263253
Hemantt84@hotmail.com
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900