1

Topic: Entering of the data from CSV from a line in the table

Function which is implemented CLR sends request on HTTP to the server and in the answer receives text NVARCHAR (max) a format csv.
Type:
1\t2\t3
1\t2\t3
4\t5\t6
Which are necessary for bringing in the table.
The question consists in how to address to this data and what variants exist for the task in view decision?

2

Re: Entering of the data from CSV from a line in the table

lex452;
If you already have CLR a function,  it that it would return you not scalar result and at once  a set.

3

Re: Entering of the data from CSV from a line in the table

felix_ff wrote:

lex452;
If you already have CLR a function,  it that it would return you not scalar result and at once  a set.

Type that at once itself the data interposed through SqlBulkCopy or what you mean?

4

Re: Entering of the data from CSV from a line in the table

lex452;
Would be not present that it returned you not a line of a type:
' Kolonka1\tKolonka2\tKolonka3'
And returned a resultant dial-up of a type
1 as [row number], ' Dannye1 ' AS [1], ' Dannye2 ' AS [2], ' Dannye3 ' AS [3]
2 as [row number], ' Dannye4 ' AS [1], ' Dannye5 ' AS [2], ' Dannye6 ' AS [3]

5

Re: Entering of the data from CSV from a line in the table

felix_ff;
Not absolutely I understand that it gives to me, I all differently will need to address somehow to them, they also to return in the form of a line.

6

Re: Entering of the data from CSV from a line in the table

And then at you the finite instruction will look like that that type:

insert into result_table
exec [dbo]. [get_csv_file] (' somethig ');

It is not necessary anything superfluous .

7

Re: Entering of the data from CSV from a line in the table

lex452;
They return not in the form of a line and in the form of a resultant dial-up, i.e. you already will have not scalar CLR a function and tabular CLR function

8

Re: Entering of the data from CSV from a line in the table

Familiarize with it:
https://msdn.microsoft.com/ru-ru/library/ms131103 (v=sql.120).aspx

9

Re: Entering of the data from CSV from a line in the table

felix_ff;
Already I read, did not know that it is possible to return the table. Thanks

10

Re: Entering of the data from CSV from a line in the table

lex452;
And generally even is better all to wrap in CLR procedure instead of function what the resultant dial-up was with floating number of columns.

11

Re: Entering of the data from CSV from a line in the table

felix_ff;
Interesting variant, it is necessary to try. But I hoped that there is a type variant openrowset, but without saving of the data in a file

12

Re: Entering of the data from CSV from a line in the table

lex452;
Generally all as to a web on good to turn generally in separate application, which will be  arriving requests (the table/turn service broker) to fulfill them on the side of application and already on readiness of result to flood on the server.
And the server of access in out of had no.

13

Re: Entering of the data from CSV from a line in the table

The author did not specify @@ version in this connection I risked to glance in the crystal full-sphere and saw the decision in usage for returned result instead of csv a format, xml or json.

14

Re: Entering of the data from CSV from a line in the table

lex452;
And what brainstorming session had been selected a reset format csv? Alter in xml as advise and do not invent bicycles at once on crutches

15

Re: Entering of the data from CSV from a line in the table

TaPaK;
Csv for the purpose of reduction of the data transferred on a network. Is and json it now and I bring. But too many the superfluous data. Sql server 2017