Errors Scripting Out Multi-server Jobs

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


ADVERTISEMENT

Scripting Overnight Backup Jobs For SQL Server Databases

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

How To Remove Master ( Multi-server Jobs )

Oct 10, 2007

I marked a server as master in a multi-server jobs environment, but how can I remove it? this server should be a target server.

SQL Server 2000

Thanks

View 4 Replies View Related

Scripting Jobs

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

Copying Jobs By Scripting

Nov 8, 2000

I am trying to copy a job by scripting it out and running the script. I am getting these errors:
Warning: Non-existent step referenced by @on_success_step_id.
and
Warning: Non-existent step referenced by @on_fail_step_id.

What's up with that?

Is it possible to copy a job onto the same server?

Thanks!

Ellen

View 3 Replies View Related

Transfer Jobs With Scripting

Sep 11, 2003

Hi,

Is there any way that I can script out all the jobs at a time (instead of doing one by one). I have mor than 100 jobs to transfer, I was just wondering if there were a way to do all at once.

Thanks.

View 6 Replies View Related

4 Errors When Using SSIS Scripting Component

Nov 7, 2006



Hi guys, I got these errors when writing a scripting component. Anyone encounteer these errors before?

Warning 1 The dependency 'EnvDTE' could not be found.
Warning 2 The dependency 'Microsoft.SqlServer.VSAHosting' could not be found.
Warning 3 The dependency 'Microsoft.SqlServer.DtsMsg' could not be found.
Warning 4 The dependency 'Microsoft.SqlServer.VSAHostingDT' could not be found.



-Daren

View 4 Replies View Related

SQL 2000 Maintenance Plan And Multi-step Jobs

Mar 9, 2006

Hi,

I'm working with SQL 2000 and am just learning about Maintenance Plans (MP). They seem convenient, but after some time, I'm wondering if they're the best approach long-term. Here are my experiences.

Using the MP Wizard, I created a plan with tasks from all the dialogs:

- Optimize database
- Check integrity
- Backup database
- Backup transaction log
- Write a report

I was puzzled to find 4 jobs were created, each with just 1 step, and staggered starting times. I expected to find 1 job with 4 steps. So, brimming with confidence, I did just that. I combined all 4 into 1 job, deleted the 3 other MP created jobs, and checked for any job-specific details in the code. However now when I open the MP, I get this pop-up:

"One or more of the jobs created for this plan has had additional steps added to it. It is not recommended that jobs created by the maintenance plan be modified in any way."

Okay, fair warning. Yet it appears the job and all steps run successfully, both on demand, and on a schedule. So now I'm wondering if jobs always need a MP. If I don't mind working with xp_sqlmaint syntax, it appears the only thing I'm giving up is the MP history. But I expect job history and '-WriteHistory' will minimize that loss.

I searched BOL, this Forum, and Google, and found a couple articles. One author preferred the ease of the Wizard, another preferred the control and added features of T-SQL, but both created a MP in their examples. So I'm hoping some experienced DBAs can advise.

If I create a job with multiple steps, and no MP, are there important things I give up or problems I create?
Is this approach a bad idea in SQL 2005?

At this stage, I don't need replication or other advanced features. Just simple database maintenance.

Thank you,
- Martin

View 1 Replies View Related

Data Scripting Tool ( NOT DATABASE Scripting)

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

SQL Server 2008 :: How To Make Sproc Return Errors For Underlying Table Errors

Jul 1, 2015

I recently updated the datatype of a sproc parameter from bit to tinyint. When I executed the sproc with the updated parameters the sproc appeared to succeed and returned "1 row(s) affected" in the console. However, the update triggered by the sproc did not actually work.

The table column was a bit which only allows 0 or 1 and the sproc was passing a value of 2 so the table was rejecting this value. However, the sproc did not return an error and appeared to return success. So is there a way to configure the database or sproc to return an error message when this type of error occurs?

View 1 Replies View Related

Multi-database Multi-server

Mar 27, 2007

I am new to Reporting Services and hope that what I am looking to do is within capabilities :-)



I have many identical schema databases residing on a number of data servers. These support individual clients accessing them via a web interface. What I need to be able to do is run reports across all of the databases. So the layout is:



Dataserver A

Database A1

Database A2

Database A3



Dataserver B

Database B1

Database B2



Dataserver C

Database C1

Database C2

Database C3



I would like to run a report that pulls table data from A1, A2, A3, B1, B2, C1, C2, C3



Now the actual number of servers is 7 and the number of databases is close to 1000. All servers are running SQL2005.



Is this something that Reporting Services is able to handle or do I need to look at some other solution?



Thanks,



Michael

View 5 Replies View Related

SQL Server Scripting How To?

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

Scripting SQL Server 2005 Changes

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

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 View Related

Scripting Objects In Sql Server 2005

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

SQL Server 2008 :: Scripting A Query That Needs All Values?

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

Sql Server 2005 Scripting Table Data

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

SQL Server Admin 2014 :: Scripting Options Alter Element?

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

SQL 2012 :: Disaster Recovery Options For Multi-Database Multi-Instance Environment

Sep 23, 2014

Disaster Recovery Options based on the following criteria.

--Currently running SQL 2012 standard edition
--We have 18000 databases (same schema across databases)- majority of databases are less than 2gb-- across 64 instances approximately
--Recovery needs to happen within 1 hour (Not sure that this is realistic
-- We are building a new data center and building dr from the ground up.

What I have looked into is:

1. Transactional Replication: Too Much Data Not viable
2. AlwaysOn Availability Groups (Need enterprise) Again too many databases and would have to upgrade all instances
3. Log Shipping is a viable option and the only one I can come up with that would work right now. Might be a management nightmare but with this many databases probably all options with be a nightmare.

View 1 Replies View Related

SQL 2012 :: MSDTC In Multi-node / Multi-instanced Cluster

Aug 17, 2015

More often than not, I typically don't touch DTC on clusters anymore; however on a project where the vendor states that it's required. So a couple things here.

1) Do you really need DTC per instance or one for all?
2) Should DTC be in its own resource group or within the instance's group?
2a) If in it's own resource group, how do you tie an instance to an outside resource group? tmMappingSet right?

View 9 Replies View Related

The Multi Delete &&amp; Multi Update - Stored Procedure Not Work Ok

Feb 4, 2008

the stored procedure don't delete all the records
need help



Code Snippet
DECLARE @empid varchar(500)
set @empid ='55329429,58830803,309128726,55696314'
DELETE FROM [Table_1]
WHERE charindex(','+CONVERT(varchar,[empid])+',',','+@empid+',') > 0
UPDATE [empList]
SET StartDate = CONVERT(DATETIME, '1900-01-01 00:00:00', 102), val_ok = 0
WHERE charindex(','+CONVERT(varchar,[empid])+',',','+@empid+',') > 0
UPDATE [empList]
SET StartDate = CONVERT(DATETIME, '1900-01-01 00:00:00', 102), val_ok = 0
WHERE charindex(','+CONVERT(varchar,[empid])+',',','+@empid+',') > 0




TNX

View 2 Replies View Related

Help With Multi Join Or Multi Tier Select.

Jul 20, 2005

Hello,I am trying to construct a query across 5 tables but primarily 3tables. Plan, Provider, ProviderLocation are the three primary tablesthe other tables are lookup tables for values the other tables.PlanID is the primary in Plan andPlanProviderProviderLocationLookups---------------------------------------------PlanIDProviderIDProviderIDLookupTypePlanNamePlanIDProviderStatusLookupKeyRegionIDLastName...LookupValue....FirstName...Given a PlanID I want all the Providers with a ProviderStatus = 0I can get the query to work just fine if there are records but what Iwant is if there are no records then I at least want one record withthe Plan information. Here is a sample of the Query:SELECT pln.PlanName, pln.PlanID, l3.LookupValue as Region,p.ProviderID, p.SSNEIN, pl.DisplayLocationOnPCP,pl.NoDisplayDate, pl.ProviderStatus, pl.InvalidDate,l1.LookupValue as ReasonMain, l2.LookupValue as ReasonSub,pl.InvalidDataFROM Plans plnINNER JOIN Lookups l3 ON l3.LookupType = 'REGN'AND pln.RegionID = l3.Lookupkeyleft outer JOIN Provider p ON pln.PlanID = p.PlanIDleft outer JOIN ProviderLocation pl ON p.ProviderID = pl.ProviderIDleft outer JOIN Lookups l1 ON l1.LookupType = 'PLRM'AND pl.ReasonMain = l1.LookupKeyleft outer JOIN Lookups l2 ON l2.LookupType = 'PLX1'AND pl.ReasonSub = l2.LookupkeyWHERE pln.PlanID = '123456789' AND pl.ProviderStatus = 0ORDER BY p.PlanID, p.ProviderID, pl.SiteLocationNumI know the problew the ProviderStatus on the Where clause is keepingany records from being returned but I'm not good enough at this toanother select.Can anybody give me some suggestions?ThanksDavid

View 5 Replies View Related

Scripting Stored Procedure Add With Linked Server Reference When Linked Server Is Not Available

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

Parent Package Reports Failure On Errors, But No Errors In Log

Jul 31, 2006

I have a parent package that calls child packages inside a For Each container. When I debug/run the parent package (from VS), I get the following error message: Warning: The Execution method succeeded, but the number of errors raised (3) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.

It appears to be failing while executing the child package. However, the logs (via the "progress" tab) for both the parent package and the child package show no errors other than the one listed above (and that shows in the parent package log). The child package appears to validate completely without error (all components are green and no error messages in the log). I turned on SSIS logging to a text file and see nothing in there either.

If I bump up the MaximumErrorCount in the parent package and in the Execute Package Task that calls the child package to 4 (to go one above the error count indicated in the message above), the whole thing executes sucessfully. I don't want to leave the Max Error Count set like this. Is there something I am missing? For example are there errors that do not get logged by default? I get some warnings, do a certain number of warnings equal an error?

Thanks,

Lee

View 5 Replies View Related

SQL Server Jobs

Apr 29, 2002

I have moved my database recently from a NT server to a Windows 2000 server, both running SQL 7.0 I have a couple of jobs that sometimes, work, sometimes not, the problem it tells me is that it cannot find the file specified, I run the job from enterprise manager and it runs just fine, it'll run here and there but it still fails frequently. Any suggestions on what to check? Thanks.

Bob

View 4 Replies View Related

SQL Server 7 Jobs

Jul 26, 2001

When I change the SA password on my server the current SQL Jobs no longer
work. How can I fix or get around this problem without rebuilding my jobs?

View 1 Replies View Related

Jobs On SQL Server 7.0

Jan 3, 2000

Hi there and happy newyear

I have a very annoying problem with my SQL Server 7.0

Here is the story:
In our compagny we have three SQL servers, SQL1, SQL2 and SQL3. The SQL1 server is our development server where we build our databases. When they are ready to go live I make an DTS package that copies the database to SQL2 and put it into a schedule.

Is it somehow possible to execute a job on SQL2 when the job on SQL1 succesfully has finished??

Cheers

Dennis

View 5 Replies View Related

DB Engine :: Trigger Jobs On Remote Server To Do Its Work On Original Server

May 10, 2015

I'm new to SQL. I have a scenario, Where customer want to move all the jobs from original SQL server to some remote SQL server and want to trigger jobs on remote server to do its work on original server.

View 4 Replies View Related

Can We Create Jobs In Sql Server?

Sep 6, 2007

 Can we create Jobs in Sql Server?

View 3 Replies View Related

Jobs In SQL Server Agent

Apr 9, 2001

Hi All,
I am not able to see any of the jobs in the enterprise manager that are scheduled on one of our production servers. Have any body seen this type of behaviour of SQL server.. The jobs are there in the SQL as I can query sysjobs table to see there entry.. The jobs are being executed properly when they are supposed to..
Thanks
Ajay

View 2 Replies View Related

Transfering Jobs From One Server To Another

Aug 7, 2000

Hi
I need to copy all the jobs from one server to another server. How i have to do. I tried to take script of MSDB database, but it is not scripting all the jobs. PLs anyone suggest me what i have to do with scheduled jobs in 65.
it is very urgent pls.
thank u
--Rk

View 1 Replies View Related

SQL SERVER JOBS FAILING

Jun 27, 2000

I have created DTS packages to export data to text files....these packages are
running...the jobs that are created to run these packages are failing ...
both the SQL SERVER and the SQL SERVER AGENT are running administrator accounts ...if the job step is run on the command line it works..so basically
some permission that invokes the the command shell is missing...jobs that run just T-SQL steps work fine too....what am i missing out?

View 1 Replies View Related

Moving Jobs To A New Server

Jan 21, 2001

Hi,
I have to move my SQL server data from win95 to NT.
When it comes to databases I would execute attach option.
When it comes to backup devices I think I could simply copy the folder where
backup devices are being located? IS it true??
How about moving jobs; DTS and Database Maintenance Plans???
Any Ideas??
Thanks,
Andy

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved