Ask Paula!

...bringing you notes from the field...

  Home  |   Contact  |   Syndication    |   Login
  147 Posts | 5 Stories | 133 Comments | 0 Trackbacks

News

Copyright © 2008-2018 Paula DiTallo

Tag Cloud


Article Categories

Archives

Post Categories

Image Galleries

.NET Development

Enterprise Integration

Entertainment - Games

Java Development

Mobile/PDA Development

Professional Affiliations

September 2015 Entries

The most likely reason is that your profile has not been configured, or you are using an incorrect name under the @profile_name parameter. To determine your profile settings, use this query:SELECT [profile_id] ,[name] ,[description] ,[last_mod_datetime] ,[last_mod_user] FROM [msdb].[dbo].[sysmail_profile] If after you have checked the results of this query and you are using the correct profile name, check how you are passing the parameter values.Don't do this:exec msdb.dbo.sp_send_dbmail @subject, ......

This sql script will start an agent job on a remote server. If you're running this as a step in another agent job, keep in mind that the job you are running it from will be determined to be successful, even if the remote job fails--as this is an asynchronous kick off only.declare @returnCode int declare @JobName varchar(300) declare @ServerName varchar(200) declare @query varchar(8000) declare @cmd varchar(8000) set @JobName = 'TheJobNameYouWantToRun' set @ServerName = 'TheRemoteServerWhereTheJobIs' ......

You will need to enable the feature first.Follow these steps:EXEC sp_configure 'show advanced options', 1GO-- this updates whatever the currently configured value for advanced optionsRECONFIGUREGO-- Now enable the command shellEXEC sp_configure 'xp_cmdshell', 1GO--update the currently configured value with xp_cmdshell setting update.RECONFIGUREGO ......

If you are using the SSMS GUI, you may not be aware that behind the scenes, you are really issuing an ALTER DATABSE command. It is likely that another process (or processes) were accessing the database you want to take offline.If you're a DBA, or have sysadmin privileges, issue an sp_who2 command -- looking for the ALTER DATABSE process logged to you. Kill the process. Once the process has been killed off, issue the ALTER DATABSE command yourself.To take the database offline:USE masterGOALTER DATABASE ......