2012年2月18日星期六

BCP & DMO

I can script out a table's data using dmo and the bulkcopy2 object but how
can I get it to script out using ORDER BY?
Thanks
FrankAs a workaround, create a view with a SELECT TOP 100 PERCENT... ORDER BY and
then export from there.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
.
"Frank Ashley" <aa@.aa.com> wrote in message
news:exUksDmIFHA.1096@.tk2msftngp13.phx.gbl...
I can script out a table's data using dmo and the bulkcopy2 object but how
can I get it to script out using ORDER BY?
Thanks
Frank|||I could but that would mean creating temporary views for each table that i
want to script out them dropping them at the end. Unless somebody can come
up with the solution that's what i'll do.
Frank
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:eTWj63mIFHA.236@.TK2MSFTNGP14.phx.gbl...
> As a workaround, create a view with a SELECT TOP 100 PERCENT... ORDER BY
> and
> then export from there.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinnaclepublishing.com
> .
> "Frank Ashley" <aa@.aa.com> wrote in message
> news:exUksDmIFHA.1096@.tk2msftngp13.phx.gbl...
> I can script out a table's data using dmo and the bulkcopy2 object but how
> can I get it to script out using ORDER BY?
>
> Thanks
> Frank
>|||hi Frank,
Frank Ashley wrote:
> I could but that would mean creating temporary views for each table
> that i want to script out them dropping them at the end. Unless
> somebody can come up with the solution that's what i'll do.
AFAIK, the solution proposed by Tom is the only way you can achieve the
desired result..
--
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.10.0 - DbaMgr ver 0.56.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply

没有评论:

发表评论