<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Home</title><link>https://sourceforge.net/p/sqlbulk/wiki/Home/</link><description>Recent changes to Home</description><atom:link href="https://sourceforge.net/p/sqlbulk/wiki/Home/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 25 May 2017 08:20:09 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/sqlbulk/wiki/Home/feed" rel="self" type="application/rss+xml"/><item><title>Discussion for Home page</title><link>https://sourceforge.net/p/sqlbulk/wiki/Home/?limit=25#022e</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Why this dll?&lt;br/&gt;
Because there isn t in sql server a easy way to do it executing command in sp.&lt;/p&gt;
&lt;p&gt;I developed this dll to improve the development of sp and to avoid the problem of the Bulk or Bpc commandm that required Administrator grant.&lt;/p&gt;
&lt;p&gt;Below a little documentation on how to use it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;declare @r nvarchar(max),
        @i int            

exec @i=dbo.CLR_Bulk_mt 'db',--database
                        'dbo',--schema
                        'table',--table
                        'path,--path
                        't1.txt',--file
                        0,--encoding 1-&amp;gt;UTF8, 2-&amp;gt; UTF8 BOM, 3-&amp;gt; UTF7, 4-&amp;gt; UTF32, altro default 1
                        0,--fisrt row
                        '|',--test delimitator
                        '.',--decimal separator
                        'c3,c4,c2,c1',--columns of table
                        '1,2,5,6',--position of the columns in text
                        ',,yyyyMMdd,',--date format
                        'false',--allow blank
                        1,--heading
                        0,--buffer
                        0,--transaction
                        0,--text has some rows with less columns?
                        @r output                                        
print @i
print @r
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Parameters&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Sp returns an int value that indicate the number of imported rows or if less 0 means there was an error.&lt;/p&gt;
&lt;p&gt;db – String - necessary&lt;br/&gt;
It s the db where there is the table where the file will be imported.&lt;/p&gt;
&lt;p&gt;Sp could be in a different db.&lt;/p&gt;
&lt;p&gt;schema – String - necessary&lt;br/&gt;
It s the table schema.&lt;/p&gt;
&lt;p&gt;table – String - necessary&lt;br/&gt;
It s the table where the file will be imported.&lt;/p&gt;
&lt;p&gt;path – String - necessary&lt;br/&gt;
The path of the file.&lt;/p&gt;
&lt;p&gt;file – String - necessary&lt;br/&gt;
File to import.&lt;/p&gt;
&lt;p&gt;encoding – int - necessary&lt;br/&gt;
1-&amp;gt;UTF8&lt;br/&gt;
2-&amp;gt; UTF8 BOM&lt;br/&gt;
3-&amp;gt; UTF7&lt;br/&gt;
4-&amp;gt; UTF32&lt;br/&gt;
Other, default 1&lt;br/&gt;
First_row – int - necessary&lt;br/&gt;
Then beginning to read the rows.&lt;/p&gt;
&lt;p&gt;delimitator – char - necessary&lt;br/&gt;
It s the delimitator of text columns.&lt;/p&gt;
&lt;p&gt;decimale – char&lt;br/&gt;
It s the decimal separator.&lt;/p&gt;
&lt;p&gt;If not defined (‘’) will use the default of system.&lt;/p&gt;
&lt;p&gt;trace – String – (comma list ‘c1,c2,c3,...’)&lt;br/&gt;
It s the columns of table to import.&lt;/p&gt;
&lt;p&gt;Sp check that:&lt;/p&gt;
&lt;p&gt;columns exists in the table;&lt;br/&gt;
extract the columns informations (type, nullable,..)&lt;br/&gt;
If not defined (‘’) will import in the text sequence and manage columns as String nullable.&lt;/p&gt;
&lt;p&gt;positions – String – (comma list of int values ‘1,2,4,9,...’)&lt;br/&gt;
Map the previous definition of columns with the position of text columns.&lt;/p&gt;
&lt;p&gt;If not defined (‘’) will import in the text sequence.&lt;/p&gt;
&lt;p&gt;options – String – (comma list ‘,,yyyyMMdd,ddMMyy,...’ or single vale ‘yyyyMMdd’)&lt;br/&gt;
It s the date format.&lt;/p&gt;
&lt;p&gt;If the column it s “date/datetime/smalldatetime” sp try to cast it with the defined format.&lt;/p&gt;
&lt;p&gt;If not defined (‘’) will use the default system settings.&lt;/p&gt;
&lt;p&gt;allow_blank – String - (comma list ‘false,,true,...’ or single vale ‘true’)&lt;br/&gt;
Manage the blank or null values.&lt;/p&gt;
&lt;p&gt;True: if text value is blank (‘’,’ ‘) and column is nullable then will import “NULL” otherwise will use the minimal value allowed by that type (‘1900-01-01’ date, 0 number).&lt;br/&gt;
False: do nothing.&lt;br/&gt;
Heading – bool - necessary&lt;br/&gt;
True: file has header;&lt;br/&gt;
False: file hasn t header.&lt;br/&gt;
buffer_row – int&lt;br/&gt;
Sp use a buffer to performe the import.&lt;/p&gt;
&lt;p&gt;0 use the default value.&lt;/p&gt;
&lt;p&gt;To find the best value it s necessary to try with some values because it depends by hardware of server.&lt;/p&gt;
&lt;p&gt;trans – bool - necessary&lt;br/&gt;
True: run the import in transaction with rollback in case of error or commit id all fine.&lt;br/&gt;
False: no transaction.&lt;br/&gt;
Use_min_rows – bool&lt;br/&gt;
True: If the text has some rows with less columns of the definition will continue to the next.&lt;br/&gt;
False: if a row has less columns will return an error.&lt;br/&gt;
error – String (ouput)&lt;br/&gt;
Returns the error.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ema manu</dc:creator><pubDate>Thu, 25 May 2017 08:20:09 -0000</pubDate><guid>https://sourceforge.net8a6bbf32f709f33d84e5eec50752be48504856ed</guid></item><item><title>Home modified by ema manu</title><link>https://sourceforge.net/p/sqlbulk/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Welcome to your wiki!&lt;/p&gt;
&lt;p&gt;This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: &lt;span&gt;[SamplePage]&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;The wiki uses &lt;a class="" href="/p/sqlbulk/wiki/markdown_syntax/"&gt;Markdown&lt;/a&gt; syntax.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;h6&gt;Project Members:&lt;/h6&gt;
	&lt;ul class="md-users-list"&gt;
		&lt;li&gt;&lt;a href="/u/elle0087/"&gt;ema manu&lt;/a&gt; (admin)&lt;/li&gt;
		
	&lt;/ul&gt;&lt;br/&gt;
&lt;p&gt;&lt;span class="download-button-5926922c8e184e64d320c27a" style="margin-bottom: 1em; display: block;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ema manu</dc:creator><pubDate>Thu, 25 May 2017 08:13:32 -0000</pubDate><guid>https://sourceforge.netb5d18e646cfad342a0592e378f785be38a5abb48</guid></item></channel></rss>