﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server Newbies  / buld insert question / 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>Mon, 20 May 2013 13:23:57 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: buld insert question</title><link>http://www.sqlservercentral.com/Forums/Topic1419213-1292-1.aspx</link><description>You're welcome. Thanks for the feedback.</description><pubDate>Wed, 13 Feb 2013 12:21:52 GMT</pubDate><dc:creator>opc.three</dc:creator></item><item><title>RE: buld insert question</title><link>http://www.sqlservercentral.com/Forums/Topic1419213-1292-1.aspx</link><description>Thank you, that worked well for me.</description><pubDate>Wed, 13 Feb 2013 12:19:48 GMT</pubDate><dc:creator>rightontarget</dc:creator></item><item><title>RE: buld insert question</title><link>http://www.sqlservercentral.com/Forums/Topic1419213-1292-1.aspx</link><description>SSIS would be my choice for this. A Derived Column Transform after reading the file could append your additional columns before loading the row into a table.If you want to stay in T-SQL then you can use OPENROWSET and read the entire file as a SINGLE_CLOB and append the columns you want to the resultset:[code="sql"]SELECT  BulkColumn AS LineFromFile,        'something' AS Col1,        'something else' AS Col2FROM    OPENROWSET(BULK N'P:\@\1.txt', SINGLE_CLOB) AS Document;[/code][size="1"]edit: spelling[/size]</description><pubDate>Tue, 12 Feb 2013 17:46:21 GMT</pubDate><dc:creator>opc.three</dc:creator></item><item><title>buld insert question</title><link>http://www.sqlservercentral.com/Forums/Topic1419213-1292-1.aspx</link><description>Hi all,I have a text file that has one number in it. I need to load that number into the table, but I need to add 2 more fields to it (hard-code value and the current date).For instance: my file has 12345 in it. I need to do the following:insert into tableAvalues ('A',12345,getdate());Is it possible to do in one shot in:BULK INSERT tableA   FROM 'c:\temp\file.txt'    WITH ( ROWTERMINATOR ='' )Thanks,</description><pubDate>Tue, 12 Feb 2013 15:11:36 GMT</pubDate><dc:creator>rightontarget</dc:creator></item></channel></rss>