• For this kind of files it's better to use ODBC drivers.

    They read those strings with identifiers properly.

    I created text file TestInsert.txt in the folder C:\TextFiles (local to the SQL Server instance):

    [Code]"Name","Price"

    "Test","1,1"

    "19""Monitor, the nice one","250"[/Code]

    Then I added linked server:

    [Code]EXEC sp_addlinkedserver txtsrv1, 'Jet 4.0',

    'Microsoft.Jet.OLEDB.4.0',

    'C:\TextFiles',

    NULL,

    'Text'

    [/Code]

    To see the list of files available:

    [Code]EXEC sp_tables_ex txtsrv1[/Code]

    And now - just simple SELECT:

    [Code]SELECT *

    FROM txtsrv1...[TestInsert#txt]

    [/Code]

    I remember this code was done based on BOL examples, but I don't remember the topic.

    _____________
    Code for TallyGenerator