y
w
t
to override the existing data or a script to 'drop table' before importing.
I've done a test on importing the data and it just adds concurrently the new
data. If I can 'drop table' how would I script it to do it w
import?You could use DROP and re-CREATE.
Or:
TRUNCATE TABLE YourTable.
Or:
DELETE FROM YourTable
Include these as part of whatever process performs the import. Or
schedule it automatically in a job using SQL Agent.
--
David Portas
SQL Server MVP
--|||Hi David,
Thanks for suggestions, I'm not to good with SQL, I found where you do the
job schedule. In the Edit Job Step this is the following info I put in:
Type: Transact-SQL Script
Database:name of database
Command:
DROP TABLE Result
GO
(It failed)
then I tried
TRUNCATE TABLE Result
(It Failed)
Am I using the right syntax for deleting the table. The error in Event
Viewer is Event ID 208 which when you look it up doesn't tell you much.|||"GO" is batch terminator for Query Analyzer. It has nothing to do with
T-SQL. So, create a T-SQL with the following for definition.
if object_id('Result','U') is not null
drop table Result
--
-oj
"Reg Coles" <RegColes@.discussions.microsoft.com> wrote in message
news:36BF20DA-504B-4C3A-AFB9-C2158B86A6F4@.microsoft.com...
> Hi David,
> Thanks for suggestions, I'm not to good with SQL, I found where you do the
> job schedule. In the Edit Job Step this is the following info I put in:
> Type: Transact-SQL Script
> Database:name of database
> Command:
> DROP TABLE Result
> GO
> (It failed)
> then I tried
> TRUNCATE TABLE Result
> (It Failed)
> Am I using the right syntax for deleting the table. The error in Event
> Viewer is Event ID 208 which when you look it up doesn't tell you much.|||Thanks OJ, working like a treat.
No comments:
Post a Comment