Zaurb
asked on
How to automatically delete data from table in SQL Server before BCP is launched.
Hi!
I'm using bcp.exe to insert data into SQL Server 2005 Express Edition. How do I get rid of the existing data in SQL Server table each time I run bcp.exe to insert new data.
The process must be automated. For this reason I can't run manually TRUNCATE TABLE table_name each time before the bcp is launched.
Thank you!
I'm using bcp.exe to insert data into SQL Server 2005 Express Edition. How do I get rid of the existing data in SQL Server table each time I run bcp.exe to insert new data.
The process must be automated. For this reason I can't run manually TRUNCATE TABLE table_name each time before the bcp is launched.
Thank you!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OK, I think I resolved this issue by scheduling sqlcmd utility. It works, but...
any better solutions will be greatly appreciated. I'm sure there are much better and more effective approaches.
Thank you!
any better solutions will be greatly appreciated. I'm sure there are much better and more effective approaches.
Thank you!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!
But again, since I use EXPRESS Edition there's no SQL Server Agent for using Job Step...
Is there any external tool or some other method for that?
Thank you!
But again, since I use EXPRESS Edition there's no SQL Server Agent for using Job Step...
Is there any external tool or some other method for that?
Thank you!
You may run the TSQL statement I gave you before running the bcp statement and by calling the osql command line...That way the statement for checking the existence of a specific table would be ran each time the bcp is ran...
Hope this helps
Hope this helps
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The problem is that I'm using an SQL Server 2005 Express Edition. I can't find SQL Server Agent under the Object Explorer in Management Studio.
Is there another way to configure that?
Thank you!