Showing posts with label step. Show all posts
Showing posts with label step. Show all posts

Friday, March 23, 2012

script to create replication

Is it possible to create distribution, replication... from script? I would
like to do this on a new sql server. Is there a macro to record the step I
do and I can bring that to production server and run it? Thanks.
The easiest method is to create the distributor and publications using EM
then get EM to script it out. Edit the resulting script with the new
computername and run it there.
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||OK. I know how to create distributor and publications using EM but I don't
know how to use EM to script it out. Please advice. Thanks.
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:%23%23EmyenJFHA.3336@.TK2MSFTNGP10.phx.gbl...
> The easiest method is to create the distributor and publications using EM
> then get EM to script it out. Edit the resulting script with the new
> computername and run it there.
> HTH,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
|||You can right-click the replication folder (or an individual publication)
and select 'generate sql script'.
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
sql

Monday, March 12, 2012

Script including database and tables creation in one step

Hi all,
I want to create a complete script for my SQL Server 2005 database,
including database creation, and tables creation. Is there any way to
do it visually from SQL Server Management Studio, all in one step.
I've only been able to generate a script with database creation and
another script with tables creation. I just mix the scripts and no
more trouble, but I remember there was a way to generate a complete
script in one step from Management Studio.
Maybe I'm wrong about this "one-step" script, but just in case
somebody knows the trick...
Regards.
Hi
Have you tried right click on the database -tasks--generate scripts?
"Lonifasiko" <mloichate@.gmail.com> wrote in message
news:1178521497.595949.126000@.o5g2000hsb.googlegro ups.com...
> Hi all,
> I want to create a complete script for my SQL Server 2005 database,
> including database creation, and tables creation. Is there any way to
> do it visually from SQL Server Management Studio, all in one step.
> I've only been able to generate a script with database creation and
> another script with tables creation. I just mix the scripts and no
> more trouble, but I remember there was a way to generate a complete
> script in one step from Management Studio.
> Maybe I'm wrong about this "one-step" script, but just in case
> somebody knows the trick...
> Regards.
>
|||Yes, I've already tried but if not wrong, only generates create table
statements, users, roles, schemas and so on. But no sign of create
database statement.
Thanks.
|||Hi
Yes, there isn't. Try right click on the database and click Script database
as...
"Lonifasiko" <mloichate@.gmail.com> wrote in message
news:1178524605.708697.208370@.p77g2000hsh.googlegr oups.com...
> Yes, I've already tried but if not wrong, only generates create table
> statements, users, roles, schemas and so on. But no sign of create
> database statement.
> Thanks.
>
|||The option you mention does not script the different create table
statements; only writes create database related statements.
I'm afraid there is no way to do it "all-in-one step". Then, the mix
between two separated scripts is needed.
Regards.
|||Hi
Take look at SQL-SMO (SQL-DMO) object library
"Lonifasiko" <mloichate@.gmail.com> wrote in message
news:1178532977.970284.245110@.p77g2000hsh.googlegr oups.com...
> The option you mention does not script the different create table
> statements; only writes create database related statements.
> I'm afraid there is no way to do it "all-in-one step". Then, the mix
> between two separated scripts is needed.
> Regards.
>

Script including database and tables creation in one step

Hi all,
I want to create a complete script for my SQL Server 2005 database,
including database creation, and tables creation. Is there any way to
do it visually from SQL Server Management Studio, all in one step.
I've only been able to generate a script with database creation and
another script with tables creation. I just mix the scripts and no
more trouble, but I remember there was a way to generate a complete
script in one step from Management Studio.
Maybe I'm wrong about this "one-step" script, but just in case
somebody knows the trick...
Regards.Hi
Have you tried right click on the database -tasks--generate scripts?
"Lonifasiko" <mloichate@.gmail.com> wrote in message
news:1178521497.595949.126000@.o5g2000hsb.googlegroups.com...
> Hi all,
> I want to create a complete script for my SQL Server 2005 database,
> including database creation, and tables creation. Is there any way to
> do it visually from SQL Server Management Studio, all in one step.
> I've only been able to generate a script with database creation and
> another script with tables creation. I just mix the scripts and no
> more trouble, but I remember there was a way to generate a complete
> script in one step from Management Studio.
> Maybe I'm wrong about this "one-step" script, but just in case
> somebody knows the trick...
> Regards.
>|||Yes, I've already tried but if not wrong, only generates create table
statements, users, roles, schemas and so on. But no sign of create
database statement.
Thanks.|||Hi
Yes, there isn't. Try right click on the database and click Script database
as...
"Lonifasiko" <mloichate@.gmail.com> wrote in message
news:1178524605.708697.208370@.p77g2000hsh.googlegroups.com...
> Yes, I've already tried but if not wrong, only generates create table
> statements, users, roles, schemas and so on. But no sign of create
> database statement.
> Thanks.
>|||The option you mention does not script the different create table
statements; only writes create database related statements.
I'm afraid there is no way to do it "all-in-one step". Then, the mix
between two separated scripts is needed.
Regards.|||Hi
Take look at SQL-SMO (SQL-DMO) object library
"Lonifasiko" <mloichate@.gmail.com> wrote in message
news:1178532977.970284.245110@.p77g2000hsh.googlegroups.com...
> The option you mention does not script the different create table
> statements; only writes create database related statements.
> I'm afraid there is no way to do it "all-in-one step". Then, the mix
> between two separated scripts is needed.
> Regards.
>

Script including database and tables creation in one step

Hi all,
I want to create a complete script for my SQL Server 2005 database,
including database creation, and tables creation. Is there any way to
do it visually from SQL Server Management Studio, all in one step.
I've only been able to generate a script with database creation and
another script with tables creation. I just mix the scripts and no
more trouble, but I remember there was a way to generate a complete
script in one step from Management Studio.
Maybe I'm wrong about this "one-step" script, but just in case
somebody knows the trick...
Regards.Hi
Have you tried right click on the database -tasks--generate scripts?
"Lonifasiko" <mloichate@.gmail.com> wrote in message
news:1178521497.595949.126000@.o5g2000hsb.googlegroups.com...
> Hi all,
> I want to create a complete script for my SQL Server 2005 database,
> including database creation, and tables creation. Is there any way to
> do it visually from SQL Server Management Studio, all in one step.
> I've only been able to generate a script with database creation and
> another script with tables creation. I just mix the scripts and no
> more trouble, but I remember there was a way to generate a complete
> script in one step from Management Studio.
> Maybe I'm wrong about this "one-step" script, but just in case
> somebody knows the trick...
> Regards.
>|||Yes, I've already tried but if not wrong, only generates create table
statements, users, roles, schemas and so on. But no sign of create
database statement.
Thanks.|||Hi
Yes, there isn't. Try right click on the database and click Script database
as...
"Lonifasiko" <mloichate@.gmail.com> wrote in message
news:1178524605.708697.208370@.p77g2000hsh.googlegroups.com...
> Yes, I've already tried but if not wrong, only generates create table
> statements, users, roles, schemas and so on. But no sign of create
> database statement.
> Thanks.
>|||The option you mention does not script the different create table
statements; only writes create database related statements.
I'm afraid there is no way to do it "all-in-one step". Then, the mix
between two separated scripts is needed.
Regards.|||Hi
Take look at SQL-SMO (SQL-DMO) object library
"Lonifasiko" <mloichate@.gmail.com> wrote in message
news:1178532977.970284.245110@.p77g2000hsh.googlegroups.com...
> The option you mention does not script the different create table
> statements; only writes create database related statements.
> I'm afraid there is no way to do it "all-in-one step". Then, the mix
> between two separated scripts is needed.
> Regards.
>