Showing posts with label system. Show all posts
Showing posts with label system. Show all posts

Monday, March 26, 2012

Executing a unit of work without replication

We are using SQL Server 2000 on Win2003.
I would like to do something like the following on a replicated system.
BEGIN WORK WITHOUT REPLICATION;
...
<Some insert, update or delete SQL>
...
COMMIT;
Is there any way to achieve this non-replicated transaction with SQL
Server. This needs to be an on-line activity in parallel with other
replicated transactions.
Thanks,
Redden96
if there is something about the nature of the update you can
encapsulate logic into your replication stored procedures to skip these
transactions. For instance if you have a column which has a unique
value for this type of work you do not want replicated you could trap
for this value in the replication stored procedures.
Another option is to put filters on your articles which look like this
select * from publishedtables where 1=1
Then in your filter procs change them to always return 0 when you want
these transactions skipped. When you want replication to pick up
transactions again, change it to 1.
|||Thanks Hilary. I was hoping for something a little less invasive, but I
can make a solution similar to the one you describe work for me.

Monday, March 19, 2012

execute xp_cmdshell and other SA storedproc

Hi all,

I have to execute stored procedures containing
xp_cmdshell and certain system storedprocedures in msdb and master
with a user who is not SA.
(i.e iam able to execute stored procedures when i log as sa,
but any other user cannot run them)

Pls tell how to do this, it is quite urgent.Books online reviews:
When xp_cmdshell is invoked by a user who is a member of the sysadmin fixed server role, xp_cmdshell will be executed under the security context in which the SQL Server service is running. When the user is not a member of the sysadmin group, xp_cmdshell will impersonate the SQL Server Agent proxy account, which is specified using xp_sqlagent_proxy_account. If the proxy account is not available, xp_cmdshell will fail. This is true only for Microsoft Windows NT 4.0 and Windows 2000. On Windows 9.x, there is no impersonation and xp_cmdshell is always executed under the security context of the Windows 9.x user who started SQL Server.

Follow the corresponding links on BOOKS ONLINE about this topic.

Sunday, February 26, 2012

execute proc on stopping mssql server

How execute extended proc on stopping ms sql server (it mean before
stoping).
Is it possible to handle this?
Or is in system proc a'la sp_on_stop?

ThxIndrek Mgi (mkkk@.hotmail.com) writes:
> How execute extended proc on stopping ms sql server (it mean before
> stoping).
> Is it possible to handle this?
> Or is in system proc a'la sp_on_stop?

KILL on the spid in question is the only way I can think of. Short of
rebooting the server.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Try this,

--Email when database is started

CREATE procedure email

as

exec sp_sendSMTPmail 'test@.test.com.au', 'Database Rebooted',
@.cc='', @.BCC = '',
@.Importance=1,
@.Attachments='', @.HTMLFormat = 0,@.From =
'test@.test.com.au'

GO
exec sp_procoption N'email', N'startup', N'true'
GO

Thanks,

"Indrek Mgi" <mkkk@.hotmail.com> wrote in message
news:4215cb43_2@.news.estpak.ee...
> How execute extended proc on stopping ms sql server (it mean before
> stoping).
> Is it possible to handle this?
> Or is in system proc a'la sp_on_stop?
> Thx

Wednesday, February 15, 2012

Execute DTS from Job

How can I execute a DTS package from a Job using the
operating system command? Please help.Hello Vic!!
> How can I execute a DTS package from a Job using the
> operating system command? Please help.
You can use the command DTSRUN (you can find more details in books online
for TSQL)
or
try the program DTSRUNUI.EXE (you can find it in 80\Tools\Bin directory)
Bye!
Corrado

Execute batch file from a Job

How can I execute a batch file (upload.bat) from a Job.
I have the type of job as a Operating System Command, but
I don't know what to put on the Command box. I tried the
batch file path and file name, but it doesn't work.
Thanks,
Vicyou could try
cmd /c Your\Batch\File\Path\and\name.bat
"Vic" <vduran@.specpro-inc.com> wrote in message
news:03ec01c36055$3b8a9390$a501280a@.phx.gbl...
> How can I execute a batch file (upload.bat) from a Job.
> I have the type of job as a Operating System Command, but
> I don't know what to put on the Command box. I tried the
> batch file path and file name, but it doesn't work.
> Thanks,
> Vic|||Check out xp_cmdshell in BooksOnLine.
--
Andrew J. Kelly
SQL Server MVP
"Vic" <vduran@.specpro-inc.com> wrote in message
news:03ec01c36055$3b8a9390$a501280a@.phx.gbl...
> How can I execute a batch file (upload.bat) from a Job.
> I have the type of job as a Operating System Command, but
> I don't know what to put on the Command box. I tried the
> batch file path and file name, but it doesn't work.
> Thanks,
> Vic