Showing posts with label sqlscript. Show all posts
Showing posts with label sqlscript. Show all posts

Friday, March 9, 2012

Generate SQLscript for db?

Due to the large size db, I need to generate a SQL script and keep it in
VSS. The script should contain all create objctes statemnts. Using
'Generate SQL Script' in the Enterprise Manager by right clicking the db
is not helping. What I am missing here?
Thanks!
*** Sent via Developersdex http://www.examnotes.net ***> Using
> 'Generate SQL Script' in the Enterprise Manager by right clicking the db
> is not helping.
Why not? If you don't say what it does wrong, it is hard for us to help you.
Here's a general
article on the subject: http://www.karaszi.com/SQLServer/in...ver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Test Test" <farooqhs_2000@.yahoo.com> wrote in message news:eclCR3rkFHA.1948@.TK2MSFTNGP12.p
hx.gbl...
> Due to the large size db, I need to generate a SQL script and keep it in
> VSS. The script should contain all create objctes statemnts. Using
> 'Generate SQL Script' in the Enterprise Manager by right clicking the db
> is not helping. What I am missing here?
> Thanks!
>
>
> *** Sent via Developersdex http://www.examnotes.net ***|||Could you describe why that isn't working?
Visual Studio.NET also has the Generate Script from the Server Explorer.
Clint Hill
H3O Software
http://www.h3osoftware.com
Test Test wrote:
> Due to the large size db, I need to generate a SQL script and keep it in
> VSS. The script should contain all create objctes statemnts. Using
> 'Generate SQL Script' in the Enterprise Manager by right clicking the db
> is not helping. What I am missing here?
> Thanks!
>
>
> *** Sent via Developersdex http://www.examnotes.net ***|||The script got created but it was without create objects statements.
This is what I did - in the 'Generate SQL Script' window, I clicked on
'Formatting' tab, I noticed 'Generate create and drop objects' boxes are
checked by default (which I do want). Then, I clicked on 'Options' tab,
and checked the script db (and the ones I needed) and hit ok, it did
generate a script but without create objects. I tried many times but
with same results. It has logins, dbs settings and create db statements
only. where all other create objects (tables, views, stored procs) went
(even though they were seleceted)?
*** Sent via Developersdex http://www.examnotes.net ***|||Did you add the objects you want to include to the right list box in the lef
t-most tab?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Test Test" <farooqhs_2000@.yahoo.com> wrote in message news:utOLieskFHA.1148@.TK2MSFTNGP12.p
hx.gbl...
> The script got created but it was without create objects statements.
> This is what I did - in the 'Generate SQL Script' window, I clicked on
> 'Formatting' tab, I noticed 'Generate create and drop objects' boxes are
> checked by default (which I do want). Then, I clicked on 'Options' tab,
> and checked the script db (and the ones I needed) and hit ok, it did
> generate a script but without create objects. I tried many times but
> with same results. It has logins, dbs settings and create db statements
> only. where all other create objects (tables, views, stored procs) went
> (even though they were seleceted)?
>
> *** Sent via Developersdex http://www.examnotes.net ***|||Got it. Thanks, Tobor!
You have to hit 'Show All' in the 'General' tab to get the objects
selection. By defualt, it was all greyed (thats why I was ignoring it).
My bad.
Thanks!
*** Sent via Developersdex http://www.examnotes.net ***

Sunday, February 26, 2012

Generate Script and Insert Data

I have a question regarding generating SQL script from a database.If you use SQL Server Management Express, it lets you generate SQLscript that can be used to recreate table structure, stored procedures,etc. But it does not include the actual data stored in the tables.

Is it possible to generate SQL to *INSERT* data as well? If yes, then how?

You can get a template query for inserting data to 1 table by right clicking the table in Object Explorer->choose Script Table As->INSERT To. However there is no such generated script to do actual INSERTs and it is not necessary, because there are serveral easy way to transfer data into the new table, for example you can just use such INSERT command:

INSERT INTO newTable SELECT * FROM oldTable

|||

Here is software that does exactly what you want:http://www.denovations.com/products/sqlpopulator/

I'm using it by myself while creating database installation script and should say this solution matched all my requirements.