press button Save change script and get script for change this column.
My question is:
HOW Enterprise Manager get this script ? Used DLL call / stored procedure or
something else?
Is any way to get the same script in my code (VB) ?
Best regards.
AlexanderEnterprise Manager uses SQL-DMO to generate scripts, although to generate
change scripts like this there is some logic build in Enterprise Manager as
well.
See the "methods-SQL-DMO, Script" subject in Books Online for a start on how
to script SQL Server objects.
Jacco Schalkwijk
SQL Server MVP
"Alexander" <a@.a.com> wrote in message
news:e87dEwO5DHA.2480@.TK2MSFTNGP10.phx.gbl...
quote:
> Using SQL Server Enterprise Manager I can change field type,
> press button Save change script and get script for change this column.
> My question is:
> HOW Enterprise Manager get this script ? Used DLL call / stored procedure
or
quote:|||Thank you Jacco
> something else?
> Is any way to get the same script in my code (VB) ?
> Best regards.
> Alexander
>
Using SQL DMO I can generate script for existin object(s) in database.
But I'm need way to generate script for CHANGE table (like Enterprise
Manager)
Maybe there are examples generate scripts like this in VB ?
Brgrds
Alexander Feduleev
ARL Consulting
"Jacco Schalkwijk" <NOSPAMjaccos@.eurostop.co.uk> /
: news:uBetE6O5DHA.2412@.TK2MSFTNGP09.phx.gbl...
quote:
> Enterprise Manager uses SQL-DMO to generate scripts, although to generate
> change scripts like this there is some logic build in Enterprise Manager
as
quote:
> well.
> See the "methods-SQL-DMO, Script" subject in Books Online for a start on
how
quote:|||I doubt that you can generate ALTER TABLE scripts reliably with SQL-DMO,
> to script SQL Server objects.
>
> --
> Jacco Schalkwijk
> SQL Server MVP
>
> "Alexander" <a@.a.com> wrote in message
> news:e87dEwO5DHA.2480@.TK2MSFTNGP10.phx.gbl...
procedure[QUOTE]
> or
>
when you have two existsing tables. Enterprise Manager in most cases, except
really simple ones, uses a script that creates a new table, copies the data
from the old table to the new table, drops the old table and then renames
the new table.
You can have a look at a third party product like SQLCompare by
www.red-gate.com , which compares databases and has a toolkit that exposes
their APIs.
Jacco Schalkwijk
SQL Server MVP
"Alexander" <a@.a.com> wrote in message
news:OTBG$IP5DHA.2136@.TK2MSFTNGP12.phx.gbl...
quote:
> Thank you Jacco
> Using SQL DMO I can generate script for existin object(s) in database.
> But I'm need way to generate script for CHANGE table (like Enterprise
> Manager)
> Maybe there are examples generate scripts like this in VB ?
>
> --
> Brgrds
> Alexander Feduleev
> ARL Consulting
> "Jacco Schalkwijk" <NOSPAMjaccos@.eurostop.co.uk> /
quote:|||Hello Jacco
> : news:uBetE6O5DHA.2412@.TK2MSFTNGP09.phx.gbl...
generate[QUOTE]
> as
> how
column.[QUOTE]
> procedure
>
Unfortunaly ALTER TABLE and Column.AlterDataType not work with text/ntext
fields.
quote:
> Enterprise Manager uses a script that creates a new table, copies the data
> from the old table to the new table, drops the old table and then renames
> the new table.
I see, but there are situations when this column has reference to another
table and need change it all.
Enterpise Manager correct build script for this situations (add recreation
referenced tables also)
I think easy way is try to use this functionality of Enterprise Manager
SQLCompare is fine but i'm not need compare two databases but need change
some fields in exist DB.
Any new Ideas
Best Regards
Alexander
"Jacco Schalkwijk" <NOSPAMjaccos@.eurostop.co.uk> /
: news:ORDNGSP5DHA.2696@.TK2MSFTNGP09.phx.gbl...
quote:
> I doubt that you can generate ALTER TABLE scripts reliably with SQL-DMO,
> when you have two existsing tables. Enterprise Manager in most cases,
except
quote:
> really simple ones, uses a script that creates a new table, copies the
data
quote:
> from the old table to the new table, drops the old table and then renames
> the new table.
> You can have a look at a third party product like SQLCompare by
> www.red-gate.com , which compares databases and has a toolkit that exposes
> their APIs.
> --
> Jacco Schalkwijk
> SQL Server MVP
>
> "Alexander" <a@.a.com> wrote in message
> news:OTBG$IP5DHA.2136@.TK2MSFTNGP12.phx.gbl...
>
> generate
Manager[QUOTE]
on[QUOTE]
> column.
>
No comments:
Post a Comment