﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Paul Hunter  / BCP Format File Builder / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 22 May 2013 05:43:05 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: BCP Format File Builder</title><link>http://www.sqlservercentral.com/Forums/Topic765895-1613-1.aspx</link><description>It looks like it's an issue with one of the varchar data columns.You might want to look at the table variable -- maybe bust out the varchar 5/6 to sysname.  Then try it again.declare @format table    (   rowId          smallint      identity primary key    ,   colName       sysname    not null    ,   terminator    varchar(6)  not null    ,   colOrder       varchar(5)  not null    ,   fileLength     varchar(5)  not null    );I've got an update to this that I should post.  I'll try to get it cleaned up and deliver it this weekend.Let me know how it works.</description><pubDate>Wed, 03 Nov 2010 17:45:22 GMT</pubDate><dc:creator>SQLNightOwl</dc:creator></item><item><title>RE: BCP Format File Builder</title><link>http://www.sqlservercentral.com/Forums/Topic765895-1613-1.aspx</link><description>Hi,I'd love to use your format file builder.  I am running it on a SQL 2005 instance.  I was able to create the stored proc but at run time I get:Msg 8152, Level 16, State 13, Procedure usp_BCPFormatFile, Line 188String or binary data would be truncated.The statement has been terminated.It seems to be referring to:insert @format values(@column, @terminator, @fieldNum, @length)Do you remember seeing that before?</description><pubDate>Wed, 03 Nov 2010 07:25:46 GMT</pubDate><dc:creator>Ken Davis</dc:creator></item><item><title>RE: BCP Format File Builder</title><link>http://www.sqlservercentral.com/Forums/Topic765895-1613-1.aspx</link><description>Thanks for the kind words.  I'm in the process of building a utility that will read the file and do a sample "load" based on the format file. I thought about using xp_cmdshell to do this but decided against it in favor of the utility.  Some of my reasons for this are: * some/many admins don't permit the use of xp_cmdshell * it would require a table to load the header row (another dependency)Both of those are overcome by using a stand alone application.</description><pubDate>Tue, 18 Aug 2009 19:52:54 GMT</pubDate><dc:creator>SQLNightOwl</dc:creator></item><item><title>RE: BCP Format File Builder</title><link>http://www.sqlservercentral.com/Forums/Topic765895-1613-1.aspx</link><description>Paul,   A great start.  Any thoughts on extending it to read the first line of thefile on disk.  Could use XPcmdshell or write some CLR creating a assemblyand have the function reference it to read the disk file for the header,also could enhance to prompt for field type and lengths.  I have hand crafted many a format file for use with BCP.  It always was a pain and takes a while. In the data I am dealing with we normally have in excess of a hundred columns so as you can see... very painfull to do it manually. We use BCP and in many cases Bulk Insert (Which is faster), using these sameformat files.  We are normally loading 8 to 10 million rows, so we need somethingwith performance.  At any rate great job !</description><pubDate>Tue, 18 Aug 2009 07:58:24 GMT</pubDate><dc:creator>anbean</dc:creator></item><item><title>RE: BCP Format File Builder</title><link>http://www.sqlservercentral.com/Forums/Topic765895-1613-1.aspx</link><description>Looks like I need to re-read my comments and use spell check before I post to the SQL Server Central.  :-)</description><pubDate>Fri, 14 Aug 2009 06:27:49 GMT</pubDate><dc:creator>SQLNightOwl</dc:creator></item><item><title>BCP Format File Builder</title><link>http://www.sqlservercentral.com/Forums/Topic765895-1613-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/scripts/SQL+2005%2f8/67764/"&gt;BCP Format File Builder&lt;/A&gt;[/B]</description><pubDate>Wed, 05 Aug 2009 16:54:47 GMT</pubDate><dc:creator>SQLNightOwl</dc:creator></item></channel></rss>