Question On VB Scripting For SQL Server DTS
Apr 6, 2006
Hi all,
I'm going to be getting involved with the creation and reconfiguration of DTS jobs, however I've noticed that they'll require VB Script, which I'm not familiar with.
Without me reading an 1000pp book on learning all uses of VB Script, are there any articles/resources that focus exclusively or distinctly on the most common uses of vb script in databasing?
On a separate note, are there any ready-made sample applications I could download and connect to a SQL database for study purposes?
Thanks in advance,
JB.
View 6 Replies
ADVERTISEMENT
Mar 16, 2004
Hi to all
Is there any option in sql server DTS or any other third party tool that can script data. By scripting data i mean that....
if a table "Employee" contains 50 rows, i want the tool to write 50 insert queries for me so that i can run in it anywhere.
Problem is i have to insert data in a remote server where i cannot use DTS. I just have a text area to write my query and press the run button..
Hope u understand my problem. In case of any explanation please reply. Waiting for your response. Thanx in advance.
by to all
View 1 Replies
View Related
Nov 22, 2006
I'll try to explain this in detail so that it's easily understood. I
sure could use some other eyes on this folks. I need help figuring this
one out. Here is the project...
We have your basic Windows 2003
server environment with XP Pro on the workstations. I'm using a program
called Tag. Yes I know this site did not develop tag but I'm hoping
that this post will get you thinking and hopefully some of you might
like the challenge of helping a fellow developer figure out a technical
problem.
We have mp3's that all have some specific tags based on
date and title for example. They would need to change dynamically on
the fly without human intervention. Here is a generic list of tags we
typically use.
--artist "Company Name Here"
--title "My Test Title"
--year "2006"
--genre "News or whatever here"
--comment "This is a test comment"
The
TITLE, GENRE AND COMMENT would need to change dynamically. The rest are
fixed and generic and dont need to change. I have different folders.
For example:
C:AudioTaggedFolder One
C:AudioTaggedFolder Two
C:AudioTaggedFolder Three
I have the tag.exe and batch files in C:Program FilesTag folder. Here are the batch files I use.
test1.bat
for /f "tokens=1-4 delims=/.- " %%A in ('date /t') do (set Dow=%%A&set MM=%%B&set DD=%%C&set YYYY=%%D)
tag
C:AudioTagged*.mp3 --artist "Company Name Here" --year %YYYY%
--genre "News" --title "Some kind of title here" --comment "This is a
test comment"
mp3tags.txt (flat file that contains the tags)
--artist "Company Name Here"
--title "My Test Title"
--year "2006"
--genre "News or whatever here"
--comment "This is a test comment"
http://www.flickr.com/photos/ericowens_photography/ (when you get here look for a screen shot of an MP3 Tag toward the bottom.
So
if I want this program to run (without human intervention) and put the
tags that pertain only to those mp3's that need them how would I do
this?
Example: C:AudioTaggedFolder One est1.mp3 needs...
--artist "Company Name Here"
--title "Specific Title of it's own here"
--year "2006"
--genre "Specific genre of it's own here"
--comment "This is a test comment"
Can
this be done with VB Script and if so I need help writing it out. Can
SQL Server be used to store the data but then call the script which
then executes the Tag.exe program?
Please anyone's thoughts on this would be greatly appreciated.
Thanks in advance
View 1 Replies
View Related
Mar 11, 2008
I've checked this site but was unable to find what i needed. Perhaps there is a very simple solutio to this.
I have several databases (development, testing1, testing2, production).
I have recently modified and added some tables and stored procedures in the development database. I would like to push the changes to testing1 database. In SQL Management Studio, it's possible to right-click the a table and create EITHER an alter or create or drop script. The same is for stored procedures. I need to be able to create scripts that checks if the object (table, or stored procedure exists) and either 1) create it, if the object exist or 2) alter it, if the object exists.
Is there a tool that does this? or How can I do this via Management Studio?
Thanks,
Psion
View 3 Replies
View Related
Apr 7, 2006
ok...this (going on eight years now) sql server user has a seeminglyvery simple problem with his new developers edition of sql server 2005.I'm trying to script multiple tables and indexes in the mmc...and usingthe usual control/shift keys to select multiple objects isn't working.Is this a bug in the mmc, or am I losing my mind or is there somethingI haven't yet seen in bol?thanks in advance...
View 1 Replies
View Related
Oct 26, 2015
This is the database structure I setup:
--Main Table
CREATE TABLE [dbo].[tbl_RF_Items](
[ItemID] [int] IDENTITY(1,1) NOT NULL,
[ProgramID] [tinyint] NOT NULL,
[StatusID] [tinyint] NOT NULL,
[Item] [nvarchar](256) NOT NULL,
)
--Mapping Table
CREATE TABLE [dbo].[tbl_RF_Tags_Map_Items](
[TagID] [int] NOT NULL,
[ItemID] [int] NOT NULL,
[DateModified] [smalldatetime] NULL,
CONSTRAINT [PK_tbl_RF_Tags_Item_Map] PRIMARY KEY CLUSTERED
[Code] ....
This a result set of the Items Map table so far:
TagIDItemID
1284838
1291475
1291480
8284838
8291475
8291480
10284838
10291480
62291475
Each item will have 3 tags. I am having trouble on how to filter the data. For example if i chose TagID 1, 8, and 62, the result set should return only one result. If I do an IN clause, it acts like an OR and I need something to act like an AND.It seems like the only option is to do a dynamic where clause, but there are thousands of items and that might hinder performance of the database. Is there any other option?
View 6 Replies
View Related
Apr 21, 2008
While attempting to script out some multi-server jobs I am receiving this error:
TITLE: Microsoft SQL Server Management Studio
------------------------------
Script failed for Job 'my job name'. (Microsoft.SqlServer.Smo)
For help, click: <link removed to keep message width to a normal size :)>
------------------------------
ADDITIONAL INFORMATION:
Unable to cast object of type 'System.DBNull' to type 'System.String'. (Microsoft.SqlServer.Smo)
------------------------------
BUTTONS:
OK
------------------------------
This happens on any multi-server job. The reason behind needing to script this is the current database server that acts as our master server for SQL Server jobs is being replaced. I figured it would be easy enough to script out the job on the old server and run it (with minimal modifications) on the new server. Now, if I create any of these jobs manually on the new server and try to script it, it works just fine. Any ideas what might be the issue here?
I've tried doing it via SSMS from multiple servers and the issue persists.
View 1 Replies
View Related
Mar 21, 2008
Hi,
I need to transfer data from my test server to the deployment server, is there any way or tool to achieve that. Any help will be much appreciated.
Thanks.
Kabir
View 5 Replies
View Related
Mar 21, 2008
Hi, I've just been given the task of finding out how to implement a backup procedure for our SQL server databases. Most are running 2000, some 2005.
I'm a programmer, and I'm used to having a DBA to help me! I've seen a few methods on the web involving a stored procedure and running the task from task manager.
I need to backup and restore all the databases in SQL Server 2000 and work out a way of displaying whether or not it was successful.
Can anybody please point me in the right direction as I've no idea how to do any of this really. I guess if I could setup a sproc to loop through the databases that would help, but I'm not sure where to start.
Thanks in advance.
View 9 Replies
View Related
Aug 11, 2015
Is there a way to (automatically) remove/disable the first statements like SET ANSI_NULLS ON and SET QUOTED_IDENTIFIER ON which are generated by modify sp via mms 2014 interface?
--
SET ANSI_NULLS ON
--
SET QUOTED_IDENTIFIER ON
ALTER PROCEDURE [dbo].[sp_SendMail] @test INT = 0
AS
begin
--blabla
end
View 1 Replies
View Related
Jul 18, 2006
Is there a way to bypass the syntax checking when adding a stored procedure via a script?
I have a script that has a LINKed server reference (see below) .
INSERT
INTO ACTDMSLINKED.ACTDMS.DBO.COILS ..etc.
ACTDMSLINKED does not exist at the time I need to add the stored procedure that references it.
PLEASE to not tell me to add the LINK and then run the script. This is not an option in this scenerio.
Thanks,
Terry
View 4 Replies
View Related
Jun 29, 2001
SQL 7
I am trying to run a script written for an asp page (pure vbscript) in a active script job. I am getting errors on:
Server.CreateObject("ADODB.Connection")
Yes, ADO is up to date and loaded. The error says
Error Code: 0 Error Source= Microsoft VBScript runtime error Error Description: Object required: 'Server' Error on Line 14. The step failed.
Thoughts ..
Craig
View 1 Replies
View Related
Sep 14, 2000
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.
View 2 Replies
View Related
Oct 28, 2002
Does anyone know how to prevent or change the
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
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.
Thanks,
Scott
View 3 Replies
View Related
May 3, 2006
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?
Thanks
View 4 Replies
View Related
Oct 7, 2005
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.
View 10 Replies
View Related
Mar 21, 2007
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.
Sigh. This is driving me crazy.
Please, any advice!!
Thanks
View 14 Replies
View Related
May 15, 2006
Hi Gurus/MVPS:
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.
Please help!!!.
Thanks
Ankith
View 3 Replies
View Related
Nov 18, 2003
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?
View 6 Replies
View Related
Nov 4, 2004
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.
View 1 Replies
View Related
Nov 30, 2001
Hi,
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?
TIA,
Seoras.
View 2 Replies
View Related
Mar 26, 2001
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-
View 2 Replies
View Related
Apr 10, 2001
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
View 2 Replies
View Related
Jun 5, 2001
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??
View 2 Replies
View Related
Aug 7, 2000
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.
View 1 Replies
View Related
Jul 16, 2002
How can I get a script of triggers (drop & create them) without scripting the tables with them ?
Thanks!
View 9 Replies
View Related
Jun 28, 2004
Is there any way to script DTS Packages? :confused:
View 1 Replies
View Related
Jan 29, 2008
Are you kidding me?
I can't create 1 object per file anymore AND I can't have the drop created along with the create
Are they forcing you to use ALTER?
What a piece of junk
View 7 Replies
View Related
May 7, 2004
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.
View 3 Replies
View Related
May 19, 2008
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?
View 1 Replies
View Related
Oct 28, 2004
Hi,
Does anyone have scripts that generate the following:
1. All PK
2. All FK
3. All Indexes
Separate from the table DDL.
( EM can generate but with table DDL as well )
rockmoose
View 5 Replies
View Related
Apr 11, 2006
Dear friends,
I have alot of tables to create in sql server 2005. They are all ready to copy and paste. Is there a window where I can just script all in at once?
Thankyou very much
Chopsmum
View 13 Replies
View Related
Mar 9, 2007
Hi all.
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.
Cheers people.
View 2 Replies
View Related