Showing posts with label structure. Show all posts
Showing posts with label structure. Show all posts

Sunday, March 25, 2012

exporting db structure

Hi,

is there a way of exporting a database structure and not the data in it?

Thanks.

Can you explain what you mean by "database structure"? If you mean the list of tables, stored procs, views, functions etc then sure you can. Just query the sysobjects table.|||

thanks for the reply. That's what I meant; I want to "copy" the database and move it to another server but I do not need all the data in it; just the tables, functions, stored procedures, ...

|||Have the profiler running, and right click on DB -> All Tasks -> Generate scripts. See what procs get called. You can do the same from your app and generate the schema structure. If its a once in a while thing, you can do it yourself manually as I mentioned above rather than writing a tool for it.|||Thanks Dinakar. This is something I will be doing often so I do need to write a tool for this. I haven't done this before, so if you could point me in the right direction on how to write such a script, I'd appreciate it.|||

Hi,

As Dinakar mentioned, the script can be get with a SQL Profiler trace. Just start the trace and generate schema scripts.

sql

Monday, March 19, 2012

Export/Import data with XML - BLOB's, how to?

I need export data from few master->detail tables and then import this data
into other database with the same structure.
I.e. export some my "object" and import.
The question is: how can I export and import tables which have ntext, image
columns?
Thank you.
Did you look at FOR XML SELECT statements for exporting and either the
client-side SQLXML Bulkload object or the server-side OpenXML rowset
provider for importing?
Best regards
Michael
"Oleg Cherkasenko" <oleg@.opel.com.ua> wrote in message
news:%235nORZ5NFHA.2604@.TK2MSFTNGP10.phx.gbl...
>I need export data from few master->detail tables and then import this data
>into other database with the same structure.
> I.e. export some my "object" and import.
> The question is: how can I export and import tables which have ntext,
> image columns?
> Thank you.
>

Export/Import data with XML - BLOB's, how to?

I need export data from few master->detail tables and then import this data
into other database with the same structure.
I.e. export some my "object" and import.
The question is: how can I export and import tables which have ntext, image
columns?
Thank you.Did you look at FOR XML SELECT statements for exporting and either the
client-side SQLXML Bulkload object or the server-side OpenXML rowset
provider for importing?
Best regards
Michael
"Oleg Cherkasenko" <oleg@.opel.com.ua> wrote in message
news:%235nORZ5NFHA.2604@.TK2MSFTNGP10.phx.gbl...
>I need export data from few master->detail tables and then import this data
>into other database with the same structure.
> I.e. export some my "object" and import.
> The question is: how can I export and import tables which have ntext,
> image columns?
> Thank you.
>

Export to/from XML

I have Database with the following structure: Regions -> Countries -> Customers -> Fabs -> Products. All relationships are one to many.
I need to build query that returns all data of any Region as XML.
What is the best way to do opposite action (Export from XML to DB) ?I just played with this over the weekend for the first time. Please take a look at "XML and Internet Support Overview" in SQL Server Books Online.

Once you configure this properly with IIS you can return auto generated XML from querying SQL Server.

What little I did, it was pretty cool.

Sunday, March 11, 2012

export to sql 2005

when i export data on sql 2000 to sql 2005, i lost all the primary key
setting and relationship.
how can preserve what database structure on the sql 2000 when i move to
sql 2005?HandersonVA (handersonva@.hotmail.com) writes:

Quote:

Originally Posted by

when i export data on sql 2000 to sql 2005, i lost all the primary key
setting and relationship.
how can preserve what database structure on the sql 2000 when i move to
sql 2005?


The safest way is simply to backup the database and restore it on SQL2005.

Next best way is to build a database from the scripts you have under
version control.

Else, well, you can script, and then move data. More chances for things
to go wrong. The Copy Database Wizard in Management Studio packages this,
but unfortunately it's buggy.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Friday, February 17, 2012

Export SQL Server Diagrams

Are there any tools available that can export SQL Server Diagrams. We have
around 50 complex databases whose structure might change periodically. I wan
t
to export those SQL server diagrams to pdfs or image files. If you have any
suggestions, let me know.
Thanks.We use Visio for this at the place I work at (reverse engineer DB)
and then we convert to PDF
"Pradip" <Pradip@.discussions.microsoft.com> wrote in message
news:2CB5193C-C212-442F-938F-E825E9A2C82A@.microsoft.com...
> Are there any tools available that can export SQL Server Diagrams. We have
> around 50 complex databases whose structure might change periodically. I
> want
> to export those SQL server diagrams to pdfs or image files. If you have
> any
> suggestions, let me know.
> Thanks.|||Unfortunately, I have never come across something that does this (and I
think it would be pretty valuble, too.)
What I've ended up doing is either printing out the diagram across multiple
8.5 x 11 pages and taping them together to get a bigger "poster" diagram...
or
in some cases I've been lucky enough to be able to print the diagram out on
a big plotter (usually used for proj. mgmt. graphics/charts) so I don't have
to tape pages together.
You should be able to make PDF's out of them if you have the Adobe PDFWriter
(a.k.a Distiller) printer driver ..it allows you to print to a PDF file.
-Jason
"Pradip" <Pradip@.discussions.microsoft.com> wrote in message
news:2CB5193C-C212-442F-938F-E825E9A2C82A@.microsoft.com...
> Are there any tools available that can export SQL Server Diagrams. We have
> around 50 complex databases whose structure might change periodically. I
want
> to export those SQL server diagrams to pdfs or image files. If you have
any
> suggestions, let me know.
> Thanks.|||You'll need to use ERD tools for that I think, unless you are satisfied with
the PrintScreen button. Database Diagrams do not support an export feature
that I am aware of.
You can use Microsoft's Visio, E/RWin (www.ca.com), Enterprise Architect
(http://www.sparxsystems.com/), probably a host of others I can't think of
off the top of my head.
Please post DDL, sample data and desired results.
See http://www.aspfaq.com/5006 for info.
"Pradip" <Pradip@.discussions.microsoft.com> wrote in message
news:2CB5193C-C212-442F-938F-E825E9A2C82A@.microsoft.com...
> Are there any tools available that can export SQL Server Diagrams. We have
> around 50 complex databases whose structure might change periodically. I
want
> to export those SQL server diagrams to pdfs or image files. If you have
any
> suggestions, let me know.
> Thanks.|||If all you require is something that can be printed (say using MS Word) one
method I use is to connect to the database via an MS Access project (.adp
file instead of the normal .mdb). With the diagram open, you then have a
option to copy the diagram to the clipboard and paste it into word as an
image.
Regards
Dazza
"Pradip" <Pradip@.discussions.microsoft.com> wrote in message
news:2CB5193C-C212-442F-938F-E825E9A2C82A@.microsoft.com...
> Are there any tools available that can export SQL Server Diagrams. We have
> around 50 complex databases whose structure might change periodically. I
> want
> to export those SQL server diagrams to pdfs or image files. If you have
> any
> suggestions, let me know.
> Thanks.|||With the diagram open in the MS Access project, click on Edit -- Copy
Diagram to Clipboard.
Regards
Dazza
"Dazza" <Post2Group@.Only.com> wrote in message
news:ekeI3hKMFHA.3328@.TK2MSFTNGP14.phx.gbl...
> If all you require is something that can be printed (say using MS Word)
> one method I use is to connect to the database via an MS Access project
> (.adp file instead of the normal .mdb). With the diagram open, you then
> have a option to copy the diagram to the clipboard and paste it into word
> as an image.
> Regards
> Dazza
> "Pradip" <Pradip@.discussions.microsoft.com> wrote in message
> news:2CB5193C-C212-442F-938F-E825E9A2C82A@.microsoft.com...
>|||This is a great idea. This will work for me atleast to export the diagram to
bitmap. Is there a way to do this programatically. Can we develop a program
will automatically connect to all the SQL Server databases and import them t
o
Access and copy the Diagram to Clipboard and export them to JPEG everyday. I
f
this is possible then this would be a huge benefit for me.
"Dazza" wrote:

> With the diagram open in the MS Access project, click on Edit -- Copy
> Diagram to Clipboard.
> Regards
> Dazza
>
> "Dazza" <Post2Group@.Only.com> wrote in message
> news:ekeI3hKMFHA.3328@.TK2MSFTNGP14.phx.gbl...
>
>