Click here to Skip to main content
12,623,295 members (29,014 online)
Rate this:
 
Please Sign up or sign in to vote.
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 23-Jan-13 20:03pm
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

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 ...
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161128.1 | Last Updated 27 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100