Showing posts with label execute. Show all posts
Showing posts with label execute. Show all posts

Wednesday, March 28, 2012

Knowing current database

How can I identify the database which I execute an TSQL
statement.
The counterpart to @.@.ServerName...
Something like @.@.database?
thanks in advance.
/Tob
Tobbe,
select db_name() as DatabaseName
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Tobbe wrote:
> How can I identify the database which I execute an TSQL
> statement.
> The counterpart to @.@.ServerName...
> Something like @.@.database?
> thanks in advance.
> /Tob

Monday, March 26, 2012

killing a user process

Hi,
I have a user process related to sql mail (xp_readmail) which was submitted.
It was taking a longtime to execute, hence I tried to kill this process using
KILL command. The status it is showing me now is KILLED\ROLLBACK. But when I
again execute the KILL command WITH_STATUS_ONLY, it says rollback is
completed successfully. But still the process is not killed and it stays in
this mode for indefinite time.
How can I kill such kind of process? I even tried re-starting
SQLServeragent, but it didn't help. Anybody is facing such problems?
Thanks
GYKIt's running mapi and you may need to use the command line
kill to kill the mapi32 OS process - or use task manager and
kill the processes.
-Sue
On Tue, 28 Sep 2004 12:15:03 -0700, GYK
<GYK@.discussions.microsoft.com> wrote:
>Hi,
>I have a user process related to sql mail (xp_readmail) which was submitted.
>It was taking a longtime to execute, hence I tried to kill this process using
>KILL command. The status it is showing me now is KILLED\ROLLBACK. But when I
>again execute the KILL command WITH_STATUS_ONLY, it says rollback is
>completed successfully. But still the process is not killed and it stays in
>this mode for indefinite time.
>How can I kill such kind of process? I even tried re-starting
>SQLServeragent, but it didn't help. Anybody is facing such problems?
>Thanks
>GYK

killing a user process

Hi,
I have a user process related to sql mail (xp_readmail) which was submitted.
It was taking a longtime to execute, hence I tried to kill this process using
KILL command. The status it is showing me now is KILLED\ROLLBACK. But when I
again execute the KILL command WITH_STATUS_ONLY, it says rollback is
completed successfully. But still the process is not killed and it stays in
this mode for indefinite time.
How can I kill such kind of process? I even tried re-starting
SQLServeragent, but it didn't help. Anybody is facing such problems?
Thanks
GYK
It's running mapi and you may need to use the command line
kill to kill the mapi32 OS process - or use task manager and
kill the processes.
-Sue
On Tue, 28 Sep 2004 12:15:03 -0700, GYK
<GYK@.discussions.microsoft.com> wrote:

>Hi,
>I have a user process related to sql mail (xp_readmail) which was submitted.
>It was taking a longtime to execute, hence I tried to kill this process using
>KILL command. The status it is showing me now is KILLED\ROLLBACK. But when I
>again execute the KILL command WITH_STATUS_ONLY, it says rollback is
>completed successfully. But still the process is not killed and it stays in
>this mode for indefinite time.
>How can I kill such kind of process? I even tried re-starting
>SQLServeragent, but it didn't help. Anybody is facing such problems?
>Thanks
>GYK

Kill Users Without Processadmin Role

Hi folks, i create a procedure in master db that kill users spids. Giving EXECUTE permission on the procedure to users without giving processadmin role doesn't work! Any guidelines?
Howdy!Other than "Don't do that", nope.

Killing processes requires a lot more understanding of the server than the average user is ever likely to have. Our tech support people always want that ability, but I've never found any remotely safe way to give it to them because they don't think in terms of the impact that killing a process might have.

-PatP|||Teacher, it's the same LOCKING issue; The WELL DESIGNED VB APPLICATION timesout often coz of a table exclusively locked by one of the user; if the DBA isn't available; what to do then. This is not the solution but at least it would help the users to proceed.
No doubt, It's coz of the poorly designed tables; but i can't change all just once!

Howdy!|||I'll conceed that this is drastic, but if you have to give them something to fix the problem without having someone technically competent (a dba) to resolve the underlying problems on duty, then the best answer I've found is to give two people permission to reboot the database server.

If the entire machine (therefore the SQL Server) goes down, all of the database connections will be dropped at once. The resulting rollbacks will be handled by the recovery process when the SQL Service restarts after the reboot.

The total impact of a reboot will be large, but it will still be smaller than the probable impact of killing arbitrary spids. This isn't a good solution, but it is the best one I can offer if you can't have a dba that understands the issues on hand to resolve these problems.

-PatP

Wednesday, March 21, 2012

Kick off a DTS Package from ASP?

Is it possible to execute a DTS Package from ASP?

For example, if a user went to my website and clicked a button, it'd execute the DTS package? Thanks.This dts needs to kick off from asp or asp.net?

There is a stored procedure in the master db that can do this. I cannot remember the name, but I remember finding it on some SQL Server site. I will try to track it down again.|||Baxicall you have to use DTS.Package object to run those!

See belwo URL that has some code example on how to do it!

http://support.microsoft.com/default.aspx?scid=kb;en-us;252987

http://www.asp101.com/articles/carvin/dts/default.asp

Hope it helps!|||It was ASP.NET, I apologize for not mentioning it. Will the cited examples work in .NET?|||Here is the one related to that
http://support.microsoft.com/default.aspx?scid=kb;en-us;321525

But I haven't tried at (As my old app which I made using ASP)