Re: Update database with a dataset



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
>
>
>
.



Relevant Pages

  • Re: Desparete for advice on stored proc from asp.net
    ... [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx] ... Got tidbits? ... > first "half" of the stored proc always fires fine, ... > second half never works the first time the code behind is called, ...
    (microsoft.public.dotnet.framework.aspnet.datagridcontrol)
  • Re: Update database with a dataset
    ... SP to update data, but it is still would be a problem with the table name. ... will not be safe - you could face injection problem ... > sqlserver database. ... > but I don't want to write a stored proc for every table that needs to be ...
    (microsoft.public.data.ado)
  • Update database with a dataset
    ... sqlserver database. ... Currently I'm doing this by truncating the tables, ... Is there some way of using one stored proc to facilitate the same end ... Prev by Date: ...
    (microsoft.public.data.ado)