Showing posts with label including. Show all posts
Showing posts with label including. Show all posts

Wednesday, March 28, 2012

Scripted CREATE INDEX

I have SQL Server 2005 x64. I found in the studio I can generate all
sorts of scripts, including the creation of indexes.
I works, however the script contains the CREATE TABLE statements as
well. I want the scripts to recreate the scripts on another filegroup
(testing a theory from previous post).
Am I missing a switch in the wizard to exclude CREATE TABLE?
I did create the script, but then I manually deleted all the CREATE
TABLE statements, which was a pain.
Thanks
RobOn Mar 12, 11:55 am, "rcamarda" <robert.a.cama...@.gmail.comwrote:

Quote:

Originally Posted by

I haveSQLServer 2005 x64. I found in the studio I cangenerateall
sorts of scripts, including the creation of indexes.
I works, however thescriptcontains the CREATE TABLE statements as
well. I want the scripts to recreate the scripts on another filegroup
(testing a theory from previous post).
Am I missing a switch in the wizard to exclude CREATE TABLE?
I did create thescript, but then I manually deleted all the CREATE
TABLE statements, which was a pain.
Thanks
Rob


If you want to fine-tune what gets scripted, you might want to check
out this free app I wrote using SMO:

http://www.elsasoft.org/tools.htm
it will generate scripts for all objects in any 2000 or 2005 db. You
could easily modify it to script only indexes. source code is
available. implemented in C#.

Tuesday, March 20, 2012

Script out whole SQL SERVER Database including INSERT

Hi All,
I am trying to script out a whole SQL SERVER database with all objects
in it along with INSERT Statments to populate data into the table. My
goal is to have one single file which I can just run and produce the
same structure in a new system.
I do not know if there is a way to do that. If there is, I would really
appreciate if any of you can let me know.
Thanks
-- CCDon=B4t know which SQL Server version you are using but for SQL2k5 the
new namespace from SSIS offers something to do that programmatically.
Anyway, if you don=B4t want the tools and want to do that the old
fashioned way, there is a script from vyaskn which produces the
statement from TSQL:
http://vyaskn.tripod.com/code.htm#inserts
HTH, Jens Suessmeyer.

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