Showing posts with label generate. Show all posts
Showing posts with label generate. Show all posts

Thursday, March 29, 2012

Creation scripts from a database

I would like to know the sql command to generate all the scripts of a database so that I can replicate the same database for testing purpose. For instance, I need those scripts to help me re-create the database itself and indexes, triggers, and stored procedures of it if possible.

I remember there was a command to display all these scripts in Sql but I forgot it. If someone knows it, please help. Thanks in advance.

blumonde

Maybe you can use Enterprise Manager, select the database in EM, right click it, choose 'All tasks'->'Generate Script', click 'Show All'. Then you can choose objects to be scripted, and save the script to file system.|||

If you are in SQL Server 2000 in Query Analyzer in the Object browser with the database closed in Enterprise Manager right click on the database and click on create and you will get the create database statement. If you need the create statement for any object in the database make sure the database is open in Enterprise Manager and do the same per object and you will generate the create statement of all the objects.

In SQL Server 2005 do the same in Management Studio to generate the create statement.

Another way to move database is to use the Backup and Restore wizard and use the restore from device option to recreate the database. If your test SQL Server in not on the network remember to put the .BAK file in the Backup subfolder in Microsoft SQL Server folder in Programs. Hope this helps.

|||

Hi Iori_Jay and Caddre,

Thanks for your help. I have the scripts now. Thanks again. I appreciate it a lot.

blumonde

Sunday, March 25, 2012

Creating user groups with Forms Authentication

Hello,
Is there a way to implement groups with forms authentication? Currently I am
only able to create users and being able to generate groups would greatly
help.
ThanksSearch the below URL for 'forms authentication groups'. I found quite a few
results:
http://groups-beta.google.com/group/microsoft.public.sqlserver.reportingsvcs
--
Adrian M.
MCP
"Sceptical" <skep@.nowhere.com> wrote in message
news:HrH6e.17208$215.16616@.tornado.rdc-kc.rr.com...
> Hello,
> Is there a way to implement groups with forms authentication? Currently I
> am only able to create users and being able to generate groups would
> greatly help.
> Thanks
>sql

Monday, March 19, 2012

Creating SQL Script with code

Hello there
I have huge databse that i need to generate it to script sometimes
The Sql Generate SQL Script tool is not smart: it build the tables, views,
store procedures and function on the end. But if the view or store procedure
is based on one of the functions the script won't work
Therefore i need to develop my own tool for scripting databse.
Is the a way to get script that create each object in the system, including
all its items?
..
roy@.atidsm.co.il
: 03-5611606
' 050-7709399> The Sql Generate SQL Script tool is not smart: it build the tables, views,
> store procedures and function on the end. But if the view or store
procedure
> is based on one of the functions the script won't work
If you are using EM, you can find on the Formatting tab an otion to include
all dependet objects.

> Therefore i need to develop my own tool for scripting databse.
> Is the a way to get script that create each object in the system,
including
> all its items?
As EM and QA, you can use SQL DMO to script objects. heck
http://www.karaszi.com/sqlserver/in...ate_script.asp.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com|||Hi,
I would suggest you to use sp_helptext or retrieve info from syscomments
table.
Ed
"Roy Goldhammer" wrote:

> Hello there
> I have huge databse that i need to generate it to script sometimes
> The Sql Generate SQL Script tool is not smart: it build the tables, views,
> store procedures and function on the end. But if the view or store procedu
re
> is based on one of the functions the script won't work
> Therefore i need to develop my own tool for scripting databse.
> Is the a way to get script that create each object in the system, includin
g
> all its items?
> --
> ??òé a?ì????
> ù.?. òúé? ?e??ú ú??e?
> roy@.atidsm.co.il
> èì: 03-5611606
> ?ì_' 050-7709399
>
>|||Perhaps you messe dsomething up, there is a way to script all object
depending the one you want to have via UI. SO the follwing code, will
procuding the script for creating the Function and the view if you only
select the view to create and check the checkbox saying to script also
depending objects.
Try it out,
HTH, Jens Smeyer.
http://www.sqlserver2005.de
--
CREATE FUNCTION [dbo].FCT_YadaYada()
RETURNS INT AS
BEGIN
return 1
END
Create View VI_YadaYada
AS
Select dbo.FCT_YadaYada() as YadaYada
"Roy Goldhammer" <roygoldh@.hotmail.com> schrieb im Newsbeitrag
news:%23%23pvEFYQFHA.3076@.tk2msftngp13.phx.gbl...
> Hello there
> I have huge databse that i need to generate it to script sometimes
> The Sql Generate SQL Script tool is not smart: it build the tables, views,
> store procedures and function on the end. But if the view or store
> procedure
> is based on one of the functions the script won't work
> Therefore i need to develop my own tool for scripting databse.
> Is the a way to get script that create each object in the system,
> including
> all its items?
> --
>
> ..
> roy@.atidsm.co.il
> : 03-5611606
> ' 050-7709399
>

Friday, February 24, 2012

Creating maintenance plans in MSDE

I can create a maintenance plan in Enterprisemanager using the maintenance plan wizard. It automatically creates 4 different jobs. I can generate a script for those jobs and run using a batch file in MSDE. Is there another way to do the same thing. How c
an i create maintenance plans in MSDE
Hi,
You need to just run the same types of scripts against the MSDE. Use OSQL or
a 3rd party tool.
HTH,
Greg Low (MVP)
MSDE Manager SQL Tools
www.whitebearconsulting.com
"hp" <anonymous@.discussions.microsoft.com> wrote in message
news:E4C10AAD-2B43-4BDE-B1B1-C23D326CAE19@.microsoft.com...
> I can create a maintenance plan in Enterprisemanager using the maintenance
plan wizard. It automatically creates 4 different jobs. I can generate a
script for those jobs and run using a batch file in MSDE. Is there another
way to do the same thing. How can i create maintenance plans in MSDE
|||These articles may help you get started:
241397 HOWTO: Back Up a Microsoft Data Engine Database with Transact-SQL
http://support.microsoft.com/?id=241397
328747 INF: Recovery Planning for Microsoft SQL Server 2000 Desktop Engine
http://support.microsoft.com/?id=328747
325003 HOW TO: Manage the SQL Server Desktop Engine (MSDE 2000) by Using the
http://support.microsoft.com/?id=325003
Cindy Gross, MCDBA, MCSE
http://cindygross.tripod.com
This posting is provided "AS IS" with no warranties, and confers no rights.

Tuesday, February 14, 2012

Creating Custom Scripts Problem

When I ran the sp_script_synctran_commands to generate my custom scripts for my Immediate Updating subscriber on the publisher, it appears the script generated that I need to run on the subscriber is being truncated.
What can I do about that?
in QA go to Tools - Options and click on the results tab. Make sure Maximum
characters per column is 8192.
"JLS" <jlshoop@.hotmail.com> wrote in message
news:uK2JrZx5FHA.3188@.TK2MSFTNGP15.phx.gbl...
When I ran the sp_script_synctran_commands to generate my custom scripts for
my Immediate Updating subscriber on the publisher, it appears the script
generated that I need to run on the subscriber is being truncated.
What can I do about that?
|||Thanx that worked!
Jude
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message news:%23Y2FwNz5FHA.2676@.TK2MSFTNGP15.phx.gbl...
in QA go to Tools - Options and click on the results tab. Make sure Maximum
characters per column is 8192.
"JLS" <jlshoop@.hotmail.com> wrote in message
news:uK2JrZx5FHA.3188@.TK2MSFTNGP15.phx.gbl...
When I ran the sp_script_synctran_commands to generate my custom scripts for
my Immediate Updating subscriber on the publisher, it appears the script
generated that I need to run on the subscriber is being truncated.
What can I do about that?