Re: VB 2005 Insert records into multiple tables
- From: "AnikSol" <anisol@xxxxxxxxxxxxxxxx>
- Date: Tue, 31 Oct 2006 22:48:42 +0800
Arnie,
Thanks.
Maybe I wan't clear in asking my query.
What I wanted to know was which method would be more appropriate -
- using BCP (since the file only contains valid SQL commands) - what happens
in case if there is a failure after processing of few records?
- use transaction scope (but somehow I am unable to do multiple commands in
the scope)
- use Adon.net transaction ( transaction.begin , commit, etc) (this is the
way you have recommended , but with a caution)
The file is in fact generated by an application so the chances of having an
improper sql command string is quite remote. It is definitely not static.
There would be one file to be "imported " daily.
thanks.
"Arnie Rowland" <arnie@xxxxxxxx> wrote in message
news:eldpIC3%23GHA.4740@xxxxxxxxxxxxxxxxxxxxxxx
In the input file, start a TRANSACTION before the current SQL Statements,
test each statement for success/failure, and either ROLLBACK abort further
processing, or at the end, COMMIT as appropriate.
However, you are opening your server to major security risks.
What is the nature of the input file?
Is it being created by the user?
Created by the application?
Or is it static?
Could it be transformed into a stored procedure?
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to
the top yourself.
- H. Norman Schwarzkopf
"AnikSol" <anisol@xxxxxxxxxxxxxxxx> wrote in message
news:uobiTGy%23GHA.4356@xxxxxxxxxxxxxxxxxxxxxxx
Hi All,
Not sure if this is the right forum to post this!
VB 2005 Prof, SQL server 2005, Windows application
Scenario: In a winform application, using SQL server authentication
method
(not windows authentication), we have a text/binary file containing
multiple
SQL statements (insert,update,delete commands) for multiple tables.
From the Winform , we need to create a process wherein we process this
file
and update the database.
In case of a failure to process any sql statement in the middle of this
file
(for whatsoever may be the reason , possibility is remote but should not
be
excluded), then all the transaction need to be rolled back - meaning the
database state should be same as before we started the processing of this
file.
Query: What is the best method to carryout this functionality without
using
DTS. Ofcourse, this process should be executed from a winform and
from a
client machine.
Thanks.
.
- Follow-Ups:
- Re: VB 2005 Insert records into multiple tables
- From: Wei Lu [MSFT]
- Re: VB 2005 Insert records into multiple tables
- Prev by Date: beta testing a SQL Server comparison tool
- Next by Date: Using Transaction scope
- Previous by thread: beta testing a SQL Server comparison tool
- Next by thread: Re: VB 2005 Insert records into multiple tables
- Index(es):
Relevant Pages
|
Loading