PC Review


Reply
Thread Tools Rate Thread

Clear All data in Temp Data

 
 
=?Utf-8?B?U2FtYW50aGE=?=
Guest
Posts: n/a
 
      23rd Mar 2005
I'm trying to save data to a temp table. I'd like all existing data in the
temp table to be cleared before the new data inserted. How can I do that
using SQL?
Thanks in a advance.

 
Reply With Quote
 
 
 
 
Rick Brandt
Guest
Posts: n/a
 
      23rd Mar 2005
Samantha wrote:
> I'm trying to save data to a temp table. I'd like all existing data
> in the temp table to be cleared before the new data inserted. How
> can I do that using SQL?
> Thanks in a advance.


DELETE TableName.* FROM TableName

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


 
Reply With Quote
 
=?Utf-8?B?JzY5IENhbWFybw==?=
Guest
Posts: n/a
 
      23rd Mar 2005
Hi, Samantha.

> I'd like all existing data in the
> temp table to be cleared before the new data inserted. How can I do that
> using SQL?


Try:

DELETE *
FROM TempTable;

Be aware of database bloat, though. Make sure that the database is
compacted frequently after deleting many records in tables.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. (Only "Answers" have green
check-marks.) Remember that the best answers are often given to those who
have a history of rewarding the contributors who have taken the time to
answer questions correctly.


"Samantha" wrote:

> I'm trying to save data to a temp table. I'd like all existing data in the
> temp table to be cleared before the new data inserted. How can I do that
> using SQL?
> Thanks in a advance.
>

 
Reply With Quote
 
David C. Holley
Guest
Posts: n/a
 
      23rd Mar 2005
DELETE * FROM tblTempData;

Samantha wrote:
> I'm trying to save data to a temp table. I'd like all existing data in the
> temp table to be cleared before the new data inserted. How can I do that
> using SQL?
> Thanks in a advance.
>

 
Reply With Quote
 
David C. Holley
Guest
Posts: n/a
 
      23rd Mar 2005
True, if I'm not mistaken though there is a way to compact a database
via code. I've never done it so I'd have to dig into help. I believe
that the syntax is CurrentDatabase.Compact but NOT certain.

'69 Camaro wrote:
> Hi, Samantha.
>
>
>>I'd like all existing data in the
>>temp table to be cleared before the new data inserted. How can I do that
>>using SQL?

>
>
> Try:
>
> DELETE *
> FROM TempTable;
>
> Be aware of database bloat, though. Make sure that the database is
> compacted frequently after deleting many records in tables.
>
> HTH.
>
> Gunny
>
> See http://www.QBuilt.com for all your database needs.
> See http://www.Access.QBuilt.com for Microsoft Access tips.
>
> (Please remove ZERO_SPAM from my reply E-mail address, so that a message
> will be forwarded to me.)
>
> - - -
> When you see correct answers to your question posted in Microsoft's Online
> Community, please sign in to the Community and mark these posts as "Answers,"
> so that all may benefit by filtering on "Answered questions" and quickly
> finding the right answers to similar questions. (Only "Answers" have green
> check-marks.) Remember that the best answers are often given to those who
> have a history of rewarding the contributors who have taken the time to
> answer questions correctly.
>
>
> "Samantha" wrote:
>
>
>>I'm trying to save data to a temp table. I'd like all existing data in the
>>temp table to be cleared before the new data inserted. How can I do that
>>using SQL?
>>Thanks in a advance.
>>

 
Reply With Quote
 
Dirk Goldgar
Guest
Posts: n/a
 
      23rd Mar 2005
"David C. Holley" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)
> True, if I'm not mistaken though there is a way to compact a database
> via code. I've never done it so I'd have to dig into help. I believe
> that the syntax is CurrentDatabase.Compact but NOT certain.


Not exactly. It's complicated, if you're using Access 97; easy if
you're using Access 2000 or later. See this link:

http://www.mvps.org/access/general/gen0013.htm
Why CompactCurrentDatabase doesn't work from code

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


 
Reply With Quote
 
=?Utf-8?B?U2FtYW50aGE=?=
Guest
Posts: n/a
 
      23rd Mar 2005
Thanks everyone. I'll have to check into the compact issue since it looks
complicated.

"Samantha" wrote:

> I'm trying to save data to a temp table. I'd like all existing data in the
> temp table to be cleared before the new data inserted. How can I do that
> using SQL?
> Thanks in a advance.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a graph with existing data...clear data after save =?Utf-8?B?Q2FtIE5lZXNvbg==?= Microsoft Excel Programming 3 15th Jun 2006 06:37 PM
Clipboard doesn't clear old data when new data is loaded Sid9 Windows XP General 1 16th Feb 2006 02:28 PM
Clipboard doesn't clear old data when new data is loaded Sid9 Windows XP General 0 14th Feb 2006 02:24 AM
CLEAR ALL DATA ON THE FIELDS for data entry (ASP.NET Web program) bienwell Microsoft ASP .NET 0 17th Nov 2005 03:59 PM
Re: saving data / temp data solex Microsoft Access VBA Modules 0 24th May 2004 04:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:26 PM.