473,387 Members | 3,787 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

generating database script

Is it possible to generate the t-sql script for a database schema and the
data from .Net(C#) at all?

Cheers

Ollie Riches
Nov 16 '05 #1
6 2020
found this so far

http://www.sqlteam.com/item.asp?ItemID=17320

"Ollie Riches" <ol**********@hotmail.com> wrote in message
news:#n**************@TK2MSFTNGP12.phx.gbl...
Is it possible to generate the t-sql script for a database schema and the
data from .Net(C#) at all?

Cheers

Ollie Riches

Nov 16 '05 #2
Check out also free tool CodeSmith at www.ericjsmith.net/codesmith

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

"Ollie Riches" <ol**********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Is it possible to generate the t-sql script for a database schema and the
data from .Net(C#) at all?

Cheers

Ollie Riches

Nov 16 '05 #3
thanks but I don't want a code generator, I am looking for a programmatic
approach to scripting out the database schema and the dat contained in the
database, just like you can through sql server 2000 enterprise manager

Cheers

Ollie Riches

"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
news:eW**************@TK2MSFTNGP14.phx.gbl...
Check out also free tool CodeSmith at www.ericjsmith.net/codesmith

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

"Ollie Riches" <ol**********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Is it possible to generate the t-sql script for a database schema and the data from .Net(C#) at all?

Cheers

Ollie Riches


Nov 16 '05 #4
The only accessible code I know of for this is in DMO, which is a COM based API. You can find a tiny
(classical VB) example here, among other things:
http://www.karaszi.com/SQLServer/inf...ate_script.asp

With 2005, we can use SMO for this, which is managed code.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Ollie Riches" <ol**********@hotmail.com> wrote in message
news:OC**************@TK2MSFTNGP14.phx.gbl...
thanks but I don't want a code generator, I am looking for a programmatic
approach to scripting out the database schema and the dat contained in the
database, just like you can through sql server 2000 enterprise manager

Cheers

Ollie Riches

"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
news:eW**************@TK2MSFTNGP14.phx.gbl...
Check out also free tool CodeSmith at www.ericjsmith.net/codesmith

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

"Ollie Riches" <ol**********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
> Is it possible to generate the t-sql script for a database schema and the > data from .Net(C#) at all?
>
> Cheers
>
> Ollie Riches
>
>



Nov 16 '05 #5
thanks

Ollie

"Tibor Karaszi" <ti***************************@hotmail.nomail.co m> wrote in
message news:eq**************@TK2MSFTNGP15.phx.gbl...
The only accessible code I know of for this is in DMO, which is a COM based API. You can find a tiny (classical VB) example here, among other things:
http://www.karaszi.com/SQLServer/inf...ate_script.asp

With 2005, we can use SMO for this, which is managed code.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Ollie Riches" <ol**********@hotmail.com> wrote in message
news:OC**************@TK2MSFTNGP14.phx.gbl...
thanks but I don't want a code generator, I am looking for a programmatic approach to scripting out the database schema and the dat contained in the database, just like you can through sql server 2000 enterprise manager

Cheers

Ollie Riches

"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
news:eW**************@TK2MSFTNGP14.phx.gbl...
Check out also free tool CodeSmith at www.ericjsmith.net/codesmith

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

"Ollie Riches" <ol**********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
> Is it possible to generate the t-sql script for a database schema and

the
> data from .Net(C#) at all?
>
> Cheers
>
> Ollie Riches
>
>



Nov 16 '05 #6
Ollie,

Not quite.

You can most certainly write a bunch of queries to read the master db and
peice the info together, and you can leverage on the FillSchema methods, but
ADO.NET is not a schema/script generator.

- Sahil Malik
http://codebetter.com/blogs/sahil.malik/

"Ollie Riches" <ol**********@hotmail.com> wrote in message
news:#n**************@TK2MSFTNGP12.phx.gbl...
Is it possible to generate the t-sql script for a database schema and the
data from .Net(C#) at all?

Cheers

Ollie Riches

Nov 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Matik | last post by:
Hello, I need to change collation in my database (more databases acctualy). Therefore, I wanted to make a script, which will do it at one more time. I already have a cursor, updating...
3
by: drdeadpan | last post by:
Hi, I was using enterprise manager to generate a script for my DB. I scripted only my tables and views and in Options I picked all the options EXCEPT "script Primary Keys, Foreign Keys and...
12
by: Martin_Hurst | last post by:
Has some one come up with a similar type script that could be used in a Postgresql database? The script below was created for a SQLServer database. Thx, -Martin ...
2
by: bizt | last post by:
Hi, Is it possible to obtain the width/ height of an image when that image is dyanically created using a PHP script and passing GET attributes. For example: <img...
3
by: dawnerd | last post by:
I am having troubles with my script. It is supposed to generate a "map" from a serialized array stored in a database. However, it is not generating any html. I know the data is being retrieved from...
1
by: lavadan | last post by:
Hi Folks, I am a newbie to VB Script. I need to generate the following XML document using VB Script. Can you please advise me on this? I can manage at least if I know the concept of generating XML...
0
by: Aswanth | last post by:
I'm Generating Reports in SSRS-2005.. Previously I got the Data from One Database & Generated Reports.. Now I used to get the Data from Two Different Databases(ie Database-1 & Database-2) & to...
1
by: csharpula csharp | last post by:
Hello, I need to generate cs files from XSD files. I would like to do it automatically. What is the best way to do it? Is it better be done with PreBuild inside VS (before compilation) or to...
4
by: nmsreddi | last post by:
Hi friends recently i have started working on SQLserver 2005 as DBA for my project . when i tried to generate script for my Database i was confused to find two options for scripting in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.