Help needed in BCP and Bulk Insert

We are planning to remove MASSIVE load data from a table and thinking of 
doing this.

1. Use BCP to move out data to files of ~equal size. Say one weeks data or 
one months data into a file or something which based on data size we might 
want to test and decide. [No idea how to do it though!]

2. Truncate the source tbl and drop all indexes

3. Use Bulk Insert to upload the data base with batchsize (10K or 'N'K based 
on test)

4. Try using TABLOCK hint with Bulklogged recovery mode

I can't produce the schema of our original tbl and show sample data so here 
is a sample whcih i created for discussion purpose.

Create table TestTable
(
	sno int not null,
	fname varchar(50) not null,
	lname varchar(40) null,
	code char(10) not null,
	dt datetime not null
)

Insert into TestTable values (1,'aa','bb','1111111111', getdate())
Insert into TestTable values (2,'cc','dd','1111111112',getdate()-1)
Insert into TestTable values (3,'ee','ff','1111111113',getdate()-2)
Insert into TestTable values (4,'gg','hh','1111111114', getdate()-3)
Insert into TestTable values (5,'ii','jj','1111111115', getdate()-4)

Set nocount on
Exec master..xp_cmdshell 'bcp "SELECT * FROM Testbed.dbo.TestTable" queryout 
c:\fileName.txt /c /T'

1. I donno how to make it create different files automatically for each 
day/week or month?

2. For Bulk Insert I tried this but it doesn't work

BULK INSERT TestTable
   FROM 'c:\filename.txt' --- How to make it pick the files dynamically?
   WITH 
      (
          BATCHSIZE = 10000,
          FIELDTERMINATOR = '',
	      ROWTERMINATOR = '\r\n'
      )
This syntax by itself is throwing errors.

Any help on this would be of great use to me. Thx

Regards
Pradeep
0
Utf
6/21/2010 10:27:59 AM
sqlserver.programming 1873 articles. 0 followers. Follow

3 Replies
787 Views

Similar Articles

[PageSpeed] 27

SqlBeginner (SqlBeginner@discussions.microsoft.com) writes:
> We are planning to remove MASSIVE load data from a table and thinking of 
> doing this.
> 
> 1. Use BCP to move out data to files of ~equal size. Say one weeks data or 
> one months data into a file or something which based on data size we might 
> want to test and decide. [No idea how to do it though!]

Not sure why you want to split the data in several files. I can 
understand that you want to test, but that is best on copy of the
production database, and not in production.

> 2. Truncate the source tbl and drop all indexes

Keep in mind that TRUNCATE TABLE will not pass if there are referencing 
foreign keys.
 
> Set nocount on
> Exec master..xp_cmdshell 'bcp "SELECT * FROM Testbed.dbo.TestTable" 
> queryout 
> c:\fileName.txt /c /T'
> 
> 1. I donno how to make it create different files automatically for each 
> day/week or month?

You need to built the BCP command dynamically with a WHERE condition
and a file name. That should be simple enough.

A hint here: use native format, that is /n rather than /c. This will make
the files slower, and both the load and the unload faster.

> 2. For Bulk Insert I tried this but it doesn't work
> 
> BULK INSERT TestTable
>    FROM 'c:\filename.txt' --- How to make it pick the files dynamically?
>    WITH 
>       (
>           BATCHSIZE = 10000,
>           FIELDTERMINATOR = '',
>            ROWTERMINATOR = '\r\n'
>       )
> This syntax by itself is throwing errors.

Hey, Pradeep, you may call yourself SqlBeginner, but you've been around
long enough in these newsgroups to know that we really like to see
those error messages. 

As for the picking the file name dynamically, you will need to use
dynamic SQL. But as I said, I'm not sure I see the point with lots of
files.

An alternative strategy would be to write DELETE statement that deletes
data in batches using a condition over the clustered index, and run that 
from an Agent job for some time.

-- 
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

0
Erland
6/21/2010 9:24:21 PM
Thanks Erland.

1. So by using /n creation of file takes extra time but loading it via bulk 
insert would be faster. Is that wht you meant?

Because i tried 
Exec master..xp_cmdshell 'bcp "SELECT * FROM Testbed.dbo.TestTable" queryout 
c:\fileName.txt /n /T'

It took approx 45ms whereas the previous example with /c took approx 15ms.

output of the txt file was looking like this

1	aa	bb	1111111111	2010-06-21 14:00:20.747
2	cc	dd	1111111112	2010-06-20 14:00:20.870
3	ee	ff	1111111113	2010-06-19 14:00:20.950
4	gg	hh	1111111114	2010-06-18 14:00:20.950
5	ii	jj	1111111115	2010-06-17 14:00:20.980


2. I tried pulling that file data into a new table with same schema and for 
some reason i couldn't make it work

Create table TestTable2
( 
sno int not null, 
fname varchar(50) not null, 
lname varchar(40) null, 
code char(10) not null, 
dt datetime not null 
)


BULK INSERT Testbed.dbo.TestTable2 
FROM 'c:\filename.txt'
WITH 
( 
	BATCHSIZE = 10000, 
	FIELDTERMINATOR = '', 
	ROWTERMINATOR = '\r\n' 
) 

Error:

Msg 4832, Level 16, State 1, Line 1
Bulk load: An unexpected end of file was encountered in the data file.
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "BULK" for linked server "(null)" reported an error. The 
provider did not give any information about the error.
Msg 7330, Level 16, State 2, Line 1
Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".

3. Can you pls show me some examples or point to articles where I can 
understand your alternate strategy better? Btw i am talking abt millions or 
billions of data in the table. Hope this strategy wouldn't fill up the log.

Thanks for your response in advance.

Regards
Pradeep


"Erland Sommarskog" wrote:

> SqlBeginner (SqlBeginner@discussions.microsoft.com) writes:
> > We are planning to remove MASSIVE load data from a table and thinking of 
> > doing this.
> > 
> > 1. Use BCP to move out data to files of ~equal size. Say one weeks data or 
> > one months data into a file or something which based on data size we might 
> > want to test and decide. [No idea how to do it though!]
> 
> Not sure why you want to split the data in several files. I can 
> understand that you want to test, but that is best on copy of the
> production database, and not in production.
> 
> > 2. Truncate the source tbl and drop all indexes
> 
> Keep in mind that TRUNCATE TABLE will not pass if there are referencing 
> foreign keys.
>  
> > Set nocount on
> > Exec master..xp_cmdshell 'bcp "SELECT * FROM Testbed.dbo.TestTable" 
> > queryout 
> > c:\fileName.txt /c /T'
> > 
> > 1. I donno how to make it create different files automatically for each 
> > day/week or month?
> 
> You need to built the BCP command dynamically with a WHERE condition
> and a file name. That should be simple enough.
> 
> A hint here: use native format, that is /n rather than /c. This will make
> the files slower, and both the load and the unload faster.
> 
> > 2. For Bulk Insert I tried this but it doesn't work
> > 
> > BULK INSERT TestTable
> >    FROM 'c:\filename.txt' --- How to make it pick the files dynamically?
> >    WITH 
> >       (
> >           BATCHSIZE = 10000,
> >           FIELDTERMINATOR = '',
> >            ROWTERMINATOR = '\r\n'
> >       )
> > This syntax by itself is throwing errors.
> 
> Hey, Pradeep, you may call yourself SqlBeginner, but you've been around
> long enough in these newsgroups to know that we really like to see
> those error messages. 
> 
> As for the picking the file name dynamically, you will need to use
> dynamic SQL. But as I said, I'm not sure I see the point with lots of
> files.
> 
> An alternative strategy would be to write DELETE statement that deletes
> data in batches using a condition over the clustered index, and run that 
> from an Agent job for some time.
> 
> -- 
> Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
> 
> Links for SQL Server Books Online:
> SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
> SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
> SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
> 
> .
> 
0
Utf
6/22/2010 10:54:53 AM
SqlBeginner (SqlBeginner@discussions.microsoft.com) writes:
> 1. So by using /n creation of file takes extra time but loading it via
> bulk insert would be faster. Is that wht you meant? 

Actually, I would expect it to be faster in both ends. Not by a large
amount, but may be 10% or so. Keep in mind that data is stored in binary
format, so if you use a text file, everything has to be converted to
text and back.

> Because i tried Exec master..xp_cmdshell 'bcp "SELECT * FROM
> Testbed.dbo.TestTable" queryout c:\fileName.txt /n /T' 
> 
> It took approx 45ms whereas the previous example with /c took approx 15ms.

Random flutter and entirely insignificant. Try it with 10 million
rows or so. Here is the output when I tried on a table of mine.
Character format:

   1199203 rows copied.
   Network packet size (bytes): 4096
   Clock Time (ms.) Total     : 15382  Average : (77961.45 rows per sec.)

Native format:

   1199203 rows copied.
   Network packet size (bytes): 4096
   Clock Time (ms.) Total     : 4805   Average : (249573.98 rows per sec.)

Character format again:

   1199203 rows copied.
   Network packet size (bytes): 4096
   Clock Time (ms.) Total     : 13900  Average : (86273.59 rows per sec.)

Faster than the first time (when data had to be read from disk, but 
still a lot slower than native format.)

I should add that this table has three char(3) columns, two datetime
columns and two float columns. For a table with lot of character columns
I would expect a smaller difference.

And, yeah, when I said 10% above it was my expectation at the time.

> BULK INSERT Testbed.dbo.TestTable2 
> FROM 'c:\filename.txt'
> WITH 
> ( 
>      BATCHSIZE = 10000, 
>      FIELDTERMINATOR = '', 
>      ROWTERMINATOR = '\r\n' 
> ) 
> 
> Error:
> 
> Msg 4832, Level 16, State 1, Line 1
> Bulk load: An unexpected end of file was encountered in the data file.

That's not a syntax error that you talked about. This is an error because
you field description is incorrect. If you take out FIELDTERMINATOR and
ROWTERMINATOR and stick to the defaults, it probably works. But we
have agree on to use native format, haven't we?

In that case you use, hm, I never remember the syntax so I leave up 
to you to read Books Online. It's the DATAFORMAT option or whatever
it's called.

> 3. Can you pls show me some examples or point to articles where I can 
> understand your alternate strategy better? Btw i am talking abt millions
> or billions of data in the table. Hope this strategy wouldn't fill up
> the log. 
 
Say that you have a table called auditlog, and there is a clustered
index on auditdate. You want to waste all data from previous years.
You could do:

   SET NOCOUNT ON
   DECLARE @start datetime,
           @keepdate datetime
   SELECT @keepdate = '20100101'
   SELECT @start = MIN(convert(smalldatetime, auditdate))
   FROM   auditlog
   WHILE @start < @keepdate
   BEGIN
      DELETE auditlog WHERE auditdate < @start
      SELECT @start = dateadd(minute, 1, @start)
   END

Exactly what increment you should use depends on how dense the data
is, and how many you accept to delete at a time.

This will not fill up the transaction log, as long as you back it up
regularly. You would run this job from SQL Server Agent, and it will 
probably run for more than 24 hours, but the load on the server will
be small.




-- 
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

0
Erland
6/22/2010 9:02:20 PM
Reply:

Similar Artilces:

Word 2003: Macro to insert manual page breaks
We need to match the original layout of Word 2003 documents when creating the HTML version for filing with the SEC. Some documents are over 200 pages. Currently we are inserting a manual page break at the end of each page. Does Word use an internal code to know where to break the pages for 8.5 x 11 paper that we could use in creating a macro? -- Sprinter ------------------------------------------------------------------------ Sprinter's Profile: 1480 View this thread: http://www.thecodecage.com/forumz/showthread.php?t=178495 [url=&quot;http://www.thecodecage.com&...

How to create a CLR DLL for Sql Server 2005? Is it just any .net class library that you can load into Sql Server 2005 or is there some special project type that I need to start with?
How to create a CLR DLL for Sql Server 2005? Is it just any .net class library that you can load into Sql Server 2005 or is there some special project type that I need to start with? "DR" <softwareengineer98037@yahoo.com> wrote in message news:uJRyKcbFIHA.3980@TK2MSFTNGP03.phx.gbl... > How to create a CLR DLL for Sql Server 2005? Is it just any .net class > library that you can load into Sql Server 2005 or is there some special > project type that I need to start with? > You can do it all "by hand" but there is a template "SQL Server project&...

how to do a bulk submit?
I have a database where i submit form data based on a serial number selected from a dropdown menu. I would like to be able to do this by scanning in the serial numbers into a list box. Can anyone give me some pointers on how to accomplish this? - Scan in serial numbers into list box. Serial number format is 02-123456. Scanned data will be "02-12345602-65432102-321654" - break up the data into induvidual serial numbers. - Submit the data one serial number at a time. Thanks. This is a multi-part message in MIME format. ------=_NextPart_000_089C_01C87217.39D8C160 Content-Type...

Help with Userform
I need to setup a restricted means of allowing users to edit data in existing cells on a spreadsheet through a macro (userform?). I want to create a userform that will read data from these existing cells and display their contents in a series of text boxes. The user will then have the choice to edit any data item, if they need to, or leave the data as is. Upon the user hitting the OK key on the userform, the edited data will be entered in their previous cell locations. Any help or examples will be appreciated! Thanks ...

Problems with Replace .. please help
This is a multi-part message in MIME format. ------=_NextPart_000_02E4_01C34473.61257B40 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi,=20 I have an xml file. <cashier>=20 <tag param1=3D"work-14" param1=3D"0" param2=3D"1000199" param3=3D"1" = param4=3D"2141690" param5=3D"3" param5=3D"3" param6=3D"011111" = param7=3D"4" />=20 <tag param1=3D"work-14" param1=3D"0" param2=3D"1000199" param3=3D"1&qu...

Reading a hyperlink from a table and inserting it into the hyperlink property...
I would like to know how to read a hyperlink from a table and then in turn insert that hyperlink into the hyperlink property of a command button to execute it. My database has serveral hyperlinks stored in the fields of a table. Thank you in advance Max strHyperlink = HyperlinkPart(Trim(Nz(Me!lnkDescription.Value, "")), acAddress) strLinkName = HyperlinkPart(Trim(Nz(Me!lnkDescription.Value, "")), acDisplayText) int_PPT_Pg_Nbr = HyperlinkPart(Trim(Nz(Me!lnkDescription.Value, "")), acSubAddress) str_ToolTip_PPT = HyperlinkPart(Trim(Nz(Me!l...

insert>video option is grayed out in frontpage 2003
the option is grayed out on the menu. Take a look at this article: How to insert a video in FrontPage 2003 http://support.microsoft.com/kb/825508/en-us -- ~ Kathleen Anderson Microsoft MVP - FrontPage Spider Web Woman Designs http://www.spiderwebwoman.com/resources/ Please reply to the newsgroup for the benefit of others "pagewest" wrote: > the option is grayed out on the menu. ...

populating from sheets -- and PLEASE don't tell me I need VB!
Stupid newbie question, Excel 2003: I have a 2 sheet document. SOME of the info from Sheet 1 needs to appear on Sheet 2. For example, Sheet 1 Column G values need to be populated to Sheet 2 as Column B, Column H needs to be Column D, etc. Is there any way to automate this without having to write a VB script? I know a macro could kind of do it, but I don't think it could take all the parameters, since Sheet 1 is constanly being altered (i.e., new values, etc.). Oh, and all rows are relational so that G3 value from Sheet 1 when it goes to Sheet 2 B17 also has to have H3 from Shee...

Help with Linking
I need to do three things, if you can answer any of them that would b great. First, is there a way to make a macro that goes directly to the "Ope File" screen? What about linking it to a folder name? Second: I have a worksheet set up to pull information from a secon sheet, which needs to be imported first. All the equations return #RE until the text file is imported, which is named Sheet1 by default. wrote all my equations to pull from Sheet1, but if a new sheet get imported, I need it to pull from that sheet, Sheet2 (default). M equations won't change to Sheet2, or Sheet...

need inv/rec/issue template
I need an Excel template that can manage reciepts and issue and track material through multiple step projects. I know that it will be input intensive but we are small making onesies and twosies with multiple inside and outside processes. Thanks for your assistance Mark This sounds like a lot more than just a template, Mark. Sounds like a complete custom application to me. The best I can do is an invoice and sales tracking method in my downloads folder at www.officearticles.com/downloads/ ************ Anne Troy www.OfficeArticles.com "Material Maven" <Material Maven@discu...

amend a PO with a query? Please help!
Hello, Our new warehouse manager entered, received and committed a PO from the wrong vendor - over 100 items! Does anyone know a way to either reverse the PO or change the vendor? Please help!!!! Thank you! diana Diana, You can reverse the PO by opening it again in receiving mode. Use the Quick Scan button and add an item to the PO (any item). This will 'unlock' or re-open the PO. You can now delete the item you just added back off. Next you would enter the quantity 'Received to Date' of each item into the 'Quantity Received' column as a negative. Fo...

Help on producing a Probability Density Function please!
Hi! I am trying to produce an empirical probability density function graph in Excel. The aim of it is to compare the data with the standard Normal distribution so I would also like to be able to plot the standard normal probability density function on the same graph for this purpose. Any help would be greatly appreciated! Thanks! See Mike Middleton's http://www.usfca.edu/fac-staff/middleton/demand.pdf -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article <01E...

Please Help...I can not send/receive or delete email on outlook 2000
It gives an the following errors" Error has been detected in the file C:|Windoews\Outlook.pst. quit all mail applications and then use Inbox Repair tool." I spent hours tring to find a solution on the support section. Couldn't find it.. Thank you so much for help.. What size is yr *.pst? OL prior to 2003 can have problems when greater than 1.7gb The inbox repair tool is scanpst.exe If oversize; http://support.microsoft.com/?kbid=296088 David "Daniel" <dqiab@yahoo.com> wrote in message news:05a401c3676d$0ef74c50$a401280a@phx.gbl... > It gives an the follow...

How do you combine two columns to one? Help!!!!!!
I have address numbers in column A and street names in column B, I want to combine all of both columns into one without going through the whole process for each individual cells. HELP!!!!!! "sttrumpet" <sttrumpet@discussions.microsoft.com> wrote in message news:F72E43CE-CA99-4CD0-BCA1-85EFADCB459D@microsoft.com... > I have address numbers in column A and street names in column B, I want to > combine all of both columns into one without going through the whole process > for each individual cells. HELP!!!!!! Use the fuction =A1&B1 in cell B1 Drag the function ...

VB Code help
Here is a portion of one of my VB Macros in Excel: If Selection.Count > 0 Then MsgBox ("Average = ") & (RunningTotal / Selection.Count), vbInformation, "Average" End If My question: How do I format the number (RunningTotal/Selection.Count) to look like 0.000, instead of 0.0000000000000000?? What should my code look like with the new formatting. Thanks Chris Chris, Try this: ....Format((RunningTotal / Selection.Count), "0.000")... -- Earl Kiosterud mvpearl omitthisword at verizon period net ------------------------------------------- &qu...

Need help in data copying. #2
Hi Dave Thanks for your reply. It is working perfect *if there is more than one row*. But If I have the data only one row (B8 in my case) , then it selec the data till the end of the file ( till Row no. 65536) I will appreciate your reply. Tom -- SMIL ----------------------------------------------------------------------- SMILE's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=488 View this thread: http://www.excelforum.com/showthread.php?threadid=25956 SMILE, Don't use .End(xlDown) For example, if the code is Range(ActiveCell, ActiveCell.End(xlDown)...

how to insert control's in CTabCtrl
hi group, i have created a CTabCtrl on my dockable window with the following code int CDocDebug::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CSizingDocBar::OnCreate(lpCreateStruct) == -1) return -1; SetSCBStyle(GetSCBStyle() | SCBS_SHOWEDGES | SCBS_SIZECHILD); ///CTabCtrl Creation CRect rect; GetClientRect(&rect); m_imageList.Create(IDB_TREEVIEWBITMAP,16,1,RGB(255,255,255)); m_wndTabCtl.Create(TCS_BOTTOM|TCS_FORCELABELLEFT |WS_CHILD | WS_VISIBLE |WS_TABSTOP, rect,this,12345); m_wndTabCtl.SetImageList(&m_imageList); DWORD dwExStyle= m_wndTabCtl.GetExtendedStyle(); ...

line graph-need to pick up dates as values for the x axis?
How do you get a line graph to pick up and show dates as the values on the x axis, not starting at zero nor at the first of the month. There doesn't seem to be anywhere for x-axis data to be transferred to the x- axis. I did put the dates into a row of cells and highlight them. i am using MS office 2000. Go to Source Data on the Chart menu. On the Series tab, select the series, then click in the XValues box, clear it if necessary, and select the range that contains your dates. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions ht...

A chart needs to be created to show names and $ amounts 400-6K
I need to create a chart which contains $ values: 499; 500; 1500; 2300; 50,000; 199,601; 597,201; 494; 42,825.33. These are funds by group. The legend should show each group name as it correlates to the data plotted. THanks so much Did you try making a line chart? "ojpop" <ojpop@discussions.microsoft.com> wrote in message news:3FE5FC7E-5254-460C-80E0-871C2055763A@microsoft.com... >I need to create a chart which contains $ values: 499; 500; 1500; 2300; > 50,000; 199,601; 597,201; 494; 42,825.33. These are funds by group. The > legend should show each group nam...

Move to a new OWA server (ssl cert needs to move over also)
I moved a frontend owa server from server01 to server02. I have a cert on server01 that I need to move to server02. Can't I just export the cert out of server01 and into server02? Is there an article on how to do this? tia -comb Export a cert with private key and import the cert on new server http://technet2.microsoft.com/WindowsServer/en/Library/ad336dc5-2d48-4c6e-a837-c810b666020a1033.mspx -- Bharat Suneja MVP - Exchange www.zenprise.com NEW blog location: www.exchangepedia.com/blog ---------------------------------------------- "combfilter" <whore@whore.com> ...

Need help with using a bar graph in a report
I have a report that separates information about representatives by manager. I need the graphs to give a quick summary on a few stats from each rep but only show for that manager's team and not all information. For example: Manager A has RepA, RepB, and RepC under him. Each rep has Aux1, Aux2, Aux3 information which needs to be displayed. My goal is to show Manager A with his Reps A,B, and C of their Aux1, 2, and 3. Then, under the next manager Header I want Manager B to show Rep D, E, and F with their Aux1, 2, and 3 information. Etc thru Manager G. Please help... Th...

HELP PLEASE!!! #2
This is a multi-part message in MIME format. ------=_NextPart_000_0018_01C5D651.83566720 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0019_01C5D651.83566720" ------=_NextPart_001_0019_01C5D651.83566720 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable how do i get this background off this?? im very new... thanks.... =20 ------=_NextPart_001_0019_01C5D651.83566720 Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-/...

Help creating a list
Hi, I have a list of values in a single column. Many of the values are repeated. I need to create a list from this, where each value only appears one time, and capture in a new tab. Example Tab 1: 2008 Record A 2008 Record A 2009 Record B 2010 Record B 2010 Record B Result Needed in Tab 2: 2008 Record A 2009 Record B 2010 Record B Appreciate any help....Thanks ...

insert date
Hello, Excel 2000. How might I insert the document last saved date into header or footer? Not into a cell. You need a sub to do this This will only work if you are using Excel 2000 or higher Place this in the thisworkbook module Private Sub Workbook_BeforePrint(Cancel As Boolean) Dim wkSht As Worksheet For Each wkSht In ActiveWindow.SelectedSheets wkSht.RightFooter = "&8Last Saved : " & _ ActiveWorkbook.BuiltinDocumentProperties("Last Save Time") Next wkSht End Sub If you use Excel 97 post back -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rond...

Inserting picture without loss of information
I'm attempting to insert some cropped sections of very high resolution (3000x2000) bitmaps into Excel. The problem is when I insert the cropped images there is some processing done on the image before it is displayed. This processing blurs some of the pixels. I really need the image to retain the pixel information. Is this at all possible? Chris, I've found, though not worked extensively with it, that small pictures will be inserted in actual size. That means if Excel is set to 100% zoom, they'll be rendered pixel-for-pixel on the screen, if the zoom is set to 100%. Large p...