Showing posts with label copied. Show all posts
Showing posts with label copied. Show all posts

Friday, February 24, 2012

Creating multilple tables at once

I had a SQL db that i copied all the tables into excel and it generated the quereies in order to create those tables....Is there anyway i could excute all those table creations at once or would it be easier to just write an application that does that for me?i am a little confused on what you are asking. That said if you have generated several CREATE TABLE scripts and your question here is can you compile them all into one big script and execute it to recreate all the tables at once, the answer is YES you can.|||How i do it is I open the Query ananlyzer and input the CREATE TABLE query I see it say the command has excuted succesfully but when does the actual table show up in the SQL server? does it have automatically or do i need to do some eles to actually create the table? How would i go about creating the create table script?|||

since you are using the term "Query Analyzer" I will presume that you are using SQL 2000...

In Query Analyzer you need to display the object explorer. If memory servesI think it was View/Object Explorer but regardless its in the main menu somewhere. Once you have object explorer displayed explore down to an individual table (you may be able to select multiple again its been a while) and select Tasks/Generate Script. Also in Enterprise Mgr. I believe you can perform the equivilent in Enterprise Mgr. (but i seem to recall thoughts that I couldnt so dunno for sure on that). Overall its a VERY EASY PROCESS.

Then open up Query Analyzer, select open file/query, browse to the .sql file you created previously and a new query window with the script's contents will be shown. Hit ctrl & F5 to syntax check it (just a habit of mine personally) and then hit F5 again to execute it. Now via Enterprsie Mgr. and Query Analyzer Object Explorer you should see your new tables. You can interact with the new tables via TSQL Queries or via the GUI in Enterprise Mgr.

Derek

Tuesday, February 14, 2012

Creating DDL (create statements) and data (insert satement)

Hi,
I have about 10.000 rows of data to be copied to another server in another
city, I want to create a DDL (create statements) and data (insert
statements) via EM but I only get the DDL. How to create the insert
statement from EM? There's such a feature? Or should I create it from app?
TIA,
Hendrickhttp://vyaskn.tripod.com/code/generate_inserts.txt
David Portas
SQL Server MVP
--|||http://vyaskn.tripod.com/code/generate_inserts.txt
will do it. However, for 10K rows it might be easier and more efficient
to use BCP. 10,000 individual INSERTs in a script could be a slow and
cumbersome process.
David Portas
SQL Server MVP
--|||Great, thanks.
We'll consider the BCP utililty, too.
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1131038250.883762.17220@.f14g2000cwb.googlegroups.com...
> http://vyaskn.tripod.com/code/generate_inserts.txt
> will do it. However, for 10K rows it might be easier and more efficient
> to use BCP. 10,000 individual INSERTs in a script could be a slow and
> cumbersome process.
> --
> David Portas
> SQL Server MVP
> --
>

Creating DDL (create statements) and data (insert satement)

Hi,
I have about 10.000 rows of data to be copied to another server in another
city, I want to create a DDL (create statements) and data (insert
statements) via EM but I only get the DDL. How to create the insert
statement from EM? There's such a feature? Or should I create it from app?
TIA,
Hendrick
http://vyaskn.tripod.com/code/generate_inserts.txt
David Portas
SQL Server MVP
|||http://vyaskn.tripod.com/code/generate_inserts.txt
will do it. However, for 10K rows it might be easier and more efficient
to use BCP. 10,000 individual INSERTs in a script could be a slow and
cumbersome process.
David Portas
SQL Server MVP
|||Great, thanks.
We'll consider the BCP utililty, too.
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1131038250.883762.17220@.f14g2000cwb.googlegro ups.com...
> http://vyaskn.tripod.com/code/generate_inserts.txt
> will do it. However, for 10K rows it might be easier and more efficient
> to use BCP. 10,000 individual INSERTs in a script could be a slow and
> cumbersome process.
> --
> David Portas
> SQL Server MVP
> --
>

Creating DDL (create statements) and data (insert satement)

Hi,
I have about 10.000 rows of data to be copied to another server in another
city, I want to create a DDL (create statements) and data (insert
statements) via EM but I only get the DDL. How to create the insert
statement from EM? There's such a feature? Or should I create it from app?
TIA,
Hendrickhttp://vyaskn.tripod.com/code/generate_inserts.txt
--
David Portas
SQL Server MVP
--|||http://vyaskn.tripod.com/code/generate_inserts.txt
will do it. However, for 10K rows it might be easier and more efficient
to use BCP. 10,000 individual INSERTs in a script could be a slow and
cumbersome process.
--
David Portas
SQL Server MVP
--|||Great, thanks.
We'll consider the BCP utililty, too.
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1131038250.883762.17220@.f14g2000cwb.googlegroups.com...
> http://vyaskn.tripod.com/code/generate_inserts.txt
> will do it. However, for 10K rows it might be easier and more efficient
> to use BCP. 10,000 individual INSERTs in a script could be a slow and
> cumbersome process.
> --
> David Portas
> SQL Server MVP
> --
>