Hi All!
I need UPDATE scripts for my data. I know several tool's
which create INSERT Scripts ... but this do not help me.
For example i need scripts like that:
UPDATE [tbl] SET fld1 = 'abc' WHERE idxFld = 1
UPDATE [tbl] SET fld1 = 'def' WHERE idxFld = 2
UPDATE [tbl] SET fld1 = 'ghi' WHERE idxFld = 3
.
.
.
Any assistance or suggestions would be appreciated.
Thanks in Advance
SusanneHi John
thanks for you answer.
I need a software or script which created T-SQL Update
statements for different tables/fields (Must be dynamic !
different tables and fields, n records).
Examples (only for demo):
If you choose the master.dbo.sysusers table, the result
must be like that:
UPDATE sysusers SET name = 'xxx' WHERE uid = 1
UPDATE sysusers SET name = 'yyy' WHERE uid = 2
..
.. (for all data)
..
If you choose the master.dbo.sysobjects table, the result
must be like that:
UPDATE sysobjects SET name = 'abc' WHERE id = 1
..
.. (for all data)
..
I need this scripts to send them via eMail and update a
different server/database ! I can't use standard methods
like "UPDATE ... FROM...", DTS, linked servers or
whatever ... i need "simple Update" commands.
Susanne
>--Original Message--
>Hi
>Without knowing more detail it is hard to know or advise
you on what to do.
>If there are a finite number of idxFld values you could
create a lookup
>table and use the FROM clause in the update statement to
populate the new
>values. If this does not help please post DDL and
example data.
>John
>
>"Susanne" <spam@.hotmail.com> wrote in message
>news:04e001c35a5a$85a5add0$a101280a@.phx.gbl...
>> Hi All!
>> I need UPDATE scripts for my data. I know several
tool's
>> which create INSERT Scripts ... but this do not help
me.
>> For example i need scripts like that:
>> UPDATE [tbl] SET fld1 = 'abc' WHERE idxFld = 1
>> UPDATE [tbl] SET fld1 = 'def' WHERE idxFld = 2
>> UPDATE [tbl] SET fld1 = 'ghi' WHERE idxFld = 3
>> .
>> .
>> .
>> Any assistance or suggestions would be appreciated.
>> Thanks in Advance
>> Susanne
>>
>
>.
>|||Hi Susanne !
I think SQL Scripter is the right software for you.
http://www.sqlscripter.com
Regards
Michael
>--Original Message--
>Hi All!
>I need UPDATE scripts for my data. I know several tool's
>which create INSERT Scripts ... but this do not help me.
>For example i need scripts like that:
>UPDATE [tbl] SET fld1 = 'abc' WHERE idxFld = 1
>UPDATE [tbl] SET fld1 = 'def' WHERE idxFld = 2
>UPDATE [tbl] SET fld1 = 'ghi' WHERE idxFld = 3
>..
>..
>..
>Any assistance or suggestions would be appreciated.
>Thanks in Advance
>Susanne
>
>.
>|||Hi
I guess you could write this yourself using dynamic SQL. As you seem to have
to do this regularly, I have the feeling that what may be required is a
redesign of the database(s) as they are probably not normalised.
John
"Susanne" <spam@.hotmail.com> wrote in message
news:043e01c35a63$ccc48840$a601280a@.phx.gbl...
> Hi John
> thanks for you answer.
> I need a software or script which created T-SQL Update
> statements for different tables/fields (Must be dynamic !
> different tables and fields, n records).
> Examples (only for demo):
> If you choose the master.dbo.sysusers table, the result
> must be like that:
> UPDATE sysusers SET name = 'xxx' WHERE uid = 1
> UPDATE sysusers SET name = 'yyy' WHERE uid = 2
> ..
> .. (for all data)
> ..
> If you choose the master.dbo.sysobjects table, the result
> must be like that:
> UPDATE sysobjects SET name = 'abc' WHERE id = 1
> ..
> .. (for all data)
> ..
>
> I need this scripts to send them via eMail and update a
> different server/database ! I can't use standard methods
> like "UPDATE ... FROM...", DTS, linked servers or
> whatever ... i need "simple Update" commands.
> Susanne
>
>
> >--Original Message--
> >Hi
> >
> >Without knowing more detail it is hard to know or advise
> you on what to do.
> >
> >If there are a finite number of idxFld values you could
> create a lookup
> >table and use the FROM clause in the update statement to
> populate the new
> >values. If this does not help please post DDL and
> example data.
> >
> >John
> >
> >
> >"Susanne" <spam@.hotmail.com> wrote in message
> >news:04e001c35a5a$85a5add0$a101280a@.phx.gbl...
> >> Hi All!
> >> I need UPDATE scripts for my data. I know several
> tool's
> >> which create INSERT Scripts ... but this do not help
> me.
> >>
> >> For example i need scripts like that:
> >> UPDATE [tbl] SET fld1 = 'abc' WHERE idxFld = 1
> >> UPDATE [tbl] SET fld1 = 'def' WHERE idxFld = 2
> >> UPDATE [tbl] SET fld1 = 'ghi' WHERE idxFld = 3
> >> .
> >> .
> >> .
> >>
> >> Any assistance or suggestions would be appreciated.
> >>
> >> Thanks in Advance
> >> Susanne
> >>
> >>
> >
> >
> >.
> >
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment