Re: Update database with a dataset
- From: "shmeian" <shmeian@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 28 Apr 2005 18:23:11 -0700
Thanks Val.
I think I might stop being lazy and write individual stored procs for each
table.
"Val Mazur (MVP)" wrote:
> Hi,
>
> You could pass DataSet as an XML text into SP and use OPENXML inside of this
> SP to update data, but it is still would be a problem with the table name.
> If you pass it into SP and try to build SQL statement dynamically, then it
> will not be safe - you could face injection problem
>
> --
> Val Mazur
> Microsoft MVP
>
> http://xport.mvps.org
>
>
>
> "shmeian" <shmeian@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:74EB6CE8-596C-44A6-8F39-AC69A8194966@xxxxxxxxxxxxxxxx
> >I have a dataset which contains data to replace (most of) the data in an
> > sqlserver database.
> > Currently I'm doing this by truncating the tables, and then using a
> > dataadapter.update() method call to insert the new data having
> > instantiated a
> > SqlCommandBuilder object.
> >
> > This works fine but I have to have insert permissions set on all the
> > tables
> > in the db.
> >
> > Is there some way of using one stored proc to facilitate the same end
> > result? Ideally I want all access to the database to go through stored
> > procs
> > but I don't want to write a stored proc for every table that needs to be
> > updated (there's more than 50 tables).
> > Thanks
>
>
>
.
- References:
- Update database with a dataset
- From: shmeian
- Re: Update database with a dataset
- From: Val Mazur \(MVP\)
- Update database with a dataset
- Prev by Date: Re: What data system can I use for storing documents?
- Next by Date: IIS sopts servings pages using ADO stream
- Previous by thread: Re: Update database with a dataset
- Next by thread: IIS sopts servings pages using ADO stream
- Index(es):
Relevant Pages
|
|