![]() ![]() L0 AS(SELECT 0 AS c UNION ALL SELECT 0 UNION ALL SELECT 0 UNION ALL SELECT 0), - 4 This is a "tex" containing an number of specialĪlso six qoutes in a row '''''''''''' hereĪlso six double qoutes in a row """""" here'Īlso five qoutes in a row '''''''''' hereĪlso five double qoutes in a row """"" here' , ('Comma semicolon' ,'This is a tekst, with a semicolon before this word.',1.123,12345678,getdate(),getdate(),getdate(),getdate()) , ('Single semicolon' ,'This is a tekst with a semicolon before this word.',1.123,12345678,getdate(),getdate(),getdate(),getdate()) ![]() , ('Single comma' ,'This is a tekst with a single comma before, this word.',1.123,12345678,getdate(),getdate(),getdate(),getdate()) , ('Single double qoute' ,'This is a tekst with a single double quote before " this word.',1.123,12345678,getdate(),getdate(),getdate(),getdate()) , ('Single qoute' ,'This is a tekst with a single quote before '' this word.',1.123,12345678,getdate(),getdate(),getdate(),getdate()) Insert into CSV_TABLE SELECT * FROM (VALUES A a long list of characters within fields.īen. I' try to point these points out in the next message.Ī testset, containing linebreaks, delimiters within fields, textqualifiers within fields. WHEN DATA_TYPE IN ('DATETIME','DATETIME2','DATE','TIME') THEN '', Column_name)įROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'SELECT RIGHT(''0000000''+convert(varchar(9), ROW_NUMBER() OVER(PARTITION BY 1 ORDER BY (SELECT NULL))),8) presenting code, there is a risc that the formatter 'interpreteds' part of the code and those parts do not represent correctly ![]() WHEN DATA_TYPE IN ('CHAR','VARCHAR') THEN '', Column_name) (NOT USED)ĭECLARE varchar(8000) = varchar(8000) = varchar(4000) = WHEN LIKE THEN ' ELSE ' ' END'ĭECLARE varchar(8000) = varchar(4000) = varchar(8000) = select * FROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'csv_table' Standard convert always use double qoutes. Date format 121 for 'DATETIME','DATETIME2','DATE', this results in YYYY-MM-DD hh:mi:ss.mmm YYYY-MM-DD hh:mi:ss.mmmmmmm YYYY-MM-DD hh:mi:ss.sssssss Quoted when a special character is used. SELECT = COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = > 26 SET = '- Dummy Header' - Maybe the number of columns as A,B,C,D. IF >=128 BEGIN - If the header goes beyond 128 characters, it is not accepted as a 'column_nam' DataLines - Supplied by executed SELECT CommentLine - Supplied by executed SELECT Header as column_name - Supplied by executed SELECT ![]() Select = FROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = FROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = - First Line select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'csv_table' Then use an empty header or a dummy header Be carefull maximum header length as a single column_name is 128 characters. + char(13)+char(10) to get more readable script. ĭECLARE varchar(30) = VARCHAR(30) = '+' + char(13)+char(10) - Use a comma ',' for distinct fields for inspection. Header and Data type lines include (optional). (Extra headers can be removed other adaptations are possible). ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |