I just starting working for a new client this week. They have a custom install program written in VB.NET which installs the database to SQL Server 2000. Normally, when I want to create a SQL script to create a database, I would go into Enterprise Manager, right-click on a database, and select All Tasks | Generate SQL Script. However, that's not how this client works. Much to my horror, the CREATE DATABASE, CREATE TABLE, etc. statements are both hard-coded and hand-coded within the install program itself. When I asked them why they weren't using SQL Server's scripting capabilities to automatically generate the script, they said that SQL Server scripting is buggy and that it doesn't work properly. It was hard getting specific details but they said it would leave out indexes, for example. Now, I'm no SQL Server expert, but I've never had a problem using SQL Server's scripting capabilities. The database they use isn't that big - maybe 20-30 tables. So, before I make an issue out of it, I was wondering what everyone else's experience with SQL Server 2000's scripting features? If you've used SQL Servers scripting to recreate a database, does it work? Did you have issues?
Can you write a script that compares table changes. I have a testing database with a bunch of table changes that i need to move to production and instead of handtypeing the changes in I was wondering if there was a method of creating a script.
Hi,I need to take data from a SQL Serer 2005 database, and load into aremote 2000 database. I've already been able to script and create thedatabase objects (MS SQL Server 2005 has a nifty option which allowsyou to scripting for SQL Server 2000 compliance). Now i just need toget the data in.Is there a tool or utility out there that i can use to generate insertstatements for all the tables in database?Thanks much for any advice regarding this.
Hi there,Getting ready for deployment and I would like to be able to run an installscript that will not just generate the schema, but fill in some of thetables with default data. Is there a tool out there that will scan usertables in an SQL database and generate the script required in order tocreate a database with this default data?ThanksRobin
Ho all SQL gurus, I've searched for samples on how to automaticallyscripting SQL2000 tables to export data between databases via a sqlscript. (somehing like:INSERT INTO [ges1gara].[dbo].[CategAtleti]([CodCat], [Denominazione],[LimiteBassoDonne], [LimiteBasso], [LimiteAltoDonne], [LimiteAlto])VALUES(<CodCat,smallint,3>,<Denominazione,varchar(50),"Maschietti/Bambine">,<LimiteBassoDonne,smallint,6>, <LimiteBasso,smallint,6>,<LimiteAltoDonne,smallint,6>, <LimiteAlto,smallint,6>)INSERT INTO [ges1gara].[dbo].[CategAtleti]([CodCat], [Denominazione],[LimiteBassoDonne], [LimiteBasso], [LimiteAltoDonne], [LimiteAlto])VALUES(<CodCat,smallint,4>,<Denominazione,varchar(50),"Giovanissimi/Giovanissime">,<LimiteBassoDonne,smallint,7>, <LimiteBasso,smallint,7>,<LimiteAltoDonne,smallint,7>, <LimiteAlto,smallint,7>))Can you pls.point me to the right direction? TIAfrom tesis-Italy*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!
Hi I'm trying to script an Admin user into my SQL set up scripts. I'm ok with creating the database, adding tables and populating the tables I've created and thought that I could just EXEC aspnet_Membership_CreateUser '/', 'Admin', 'SecretPassword'...to achieve my goal, but it seems that the framework is responsible for encrypting the password before it gets to the Procedure and clear text just isn't acceptable.Any ideas on how to go about adding the user through SQL?
I have searched hi and low for hours within the product and online - I cannot find how to have SQL 2005 produce a script to automatically repeat the creation of a database role I have tedious manually created.
I have tried "script object as, create to,<>" - single-liners are produced - no details. More single line results from "<Database>, All Tasks, Generate Scripts".
Am I missing something or is this a bug?
€¦also to note after review blogs and other sources the use of the SQL2005 methods related to security and new schema objects - I feel€¦ dreadfully wrong - what is claimed feels like hype, unsupported by examples and usage cases feels like we better just make all automated processes sysadmin; I know learning curves can be strong but I am not this green or that stupid - where are the DOCS/training materials?
I know it's a simple question, just can't figure it out: How do I script a new column into an existing table in SQL? I am using MS SQL 7.0 and need to create several new columns in existing tables. thanks all.
that appear between each Create? I can't see any options for changing then or eliminating them when generating the SQL Script for my stored procedures.
I have to come up a script that will be going across 60 different servers that will be looking for document type that are not being used across all servers and then deleting them.
To start with:
Select Enabled from MHGROUP.CUSTOM5 where Enabled ='N'
then delete records
and where would I run this type of script or should I say can this be done?
Anyone know how to write a script for sql 6.5 that identifies what column is a primary key on a table? (INFORMATION_SCHEMA doesn't exist) Thanks for the help in advance.
What I need to do - can it be done without scripting?
1.) I need to get a list of sp's from a table (EXEC SQL task)
2.) Next, loop through the list of sp's and execute (FOREACHLOOP)
3.) Then, write the output of each sp to a uniquely named file. (DATA FLOW task)
So far, I have had success with 1 and 2. But getting the DATA FLOW task to work has been imposssible thus far.
I tried everything I can think of. I even created a child package that gets called from the FOREACHLOOP, using a Parent Variable Configuration to pass down the name of the stored procedure variable to the child package. No dice.
I am ready to throw in the towel here.
So, my question is, can what I want to do even be DONE without scripting? I was trying to avoid the "manual" approach to this project. It seems like what I want to do "should" be so simple.
In sum, I am simply trying to read a list of sp's from a table, execute the sp's, then write the output of the sp's to a uniquely named file.
Can this be done without scripting? I am beginning to think NOT.
Can you please share or show me the code for scripting out stored procedures in SQL Server 2005 using SQL Cmd?. I need to perform the following:
1). Script out the text of the stored procedure
2). Output to a sql file (text file) under some directory like C:sql
3). Import the file into the destination db and run it.
The above three need to be automated in a DTS Package. I tried to use the DMO but my source server is a SQL2k5 and so DTS desginer does not let me use the ActiveX with DMO against SQL 2k5. I need to run the first step against a SQL2k5 machine and the second and third on a SQL2k machine.
Just getting into scripting sql. I have a little script that adds and drops a default value for a column. But I cannot get it to run when the column already has a default value specified. If I didn't script the contraint and specify a name I have no name to specify when trying to drop it.
ALTER TABLE users ADD CONSTRAINT dev1 DEFAULT 1 FOR ns_email_flag ALTER TABLE users DROP CONSTRAINT dev1
How do I remove any existing default values using script?
I am currently running SQL7 sp3 and will be moving the database to SQL2k. I have restored the database without any problems, but have not moved the dts packages. What would be the best solution: script the packages, save the packages to the 2k db, or just build from scratch? Any feedback would be appreciated. Thanks! -J-
I would like to move over all of my DTS packages and corresponding jobs onto another MS SQL server machine. The problem that I have is that I haven't been able to find any straight-forward info on how to script up these jobs, move them onto another machine and execute them. I have scanned through previous posts written by people with the same problem, but every response is simply "script up the jobs and move them onto another server." Maybe I'm missing something, but how "exactly" do I get a job to show up on this destination machine in EM, in the management/sql server agent/jobs folder. I did the jobs/all tasks/script job... but then what? I saved it on this destination machine, but am unclear as what to do next. The MS SQL Server Administrators companion book is of no help on this subject, and I do not understand how this simple task can be so confusing and is not documented. Any help would be greatly appreciated. Thanks in advance! TB
Many times here I have read about scripting DTS packages to copy them to another server. How is this done? Under "All tasks/Generate SQL Scripts" there is no option for DTS. Sould I be looking elsewhere??
I know there must be a way to script GRANTS for all users for specific objects(tables, sp's, etc). Can't find much in BOL, etc. Does anyone know how? Any comments would be appreciated.
Hi all, Is there any way to script all the triggers in a database just the way we script tables and stored procedures? currently I am using the system tables. regards, Harshal.
Does anyone here know anything about the DCS Scripting Language.
A contract vacancy has arisen using this language but I've never heard of it and there does seem to be anything on the internet about it. Can anyone help?
I am looking to write a script to create several new tables. What i would like to know is how do i check if they already exist before i create them and if they already exist dont create them? If they dont exist, create them.