Showing posts with label certain. Show all posts
Showing posts with label certain. Show all posts

Friday, March 30, 2012

knowing which jobs/dts/SSIS affect which tables

hi, we were doing something and began to wonder which jobs/dts were
affecting a certain table (we use SQL 2000)... is there anyway to check
this?

and have the features for such dependency analysis been added for SQL
2005?I've never tried this, but you might be able to trap it using Profiler;
set up a log and filter on object_id.

http://www.microsoft.com/technet/ar...9.mspx?mfr=true

Post back and let us know if that works for you.

Stu

metaperl wrote:
> hi, we were doing something and began to wonder which jobs/dts were
> affecting a certain table (we use SQL 2000)... is there anyway to check
> this?
> and have the features for such dependency analysis been added for SQL
> 2005?sql

Friday, March 23, 2012

kill process id with host

I need a script to kill several process ids by a certain host....need help
ASAP...thanksUse the below command:-
KILL SPID
SPID you can get from master..sysprocesses table
Thanks
Hari
SQL Server MVP
"Jamie Elliott" <JamieElliott@.discussions.microsoft.com> wrote in message
news:361BFBE0-E309-430E-8B34-E8D96B906AD2@.microsoft.com...
>I need a script to kill several process ids by a certain host....need help
> ASAP...thanks|||There are about 100 dead process ids from 1 host, are you saying this will
kill all the process ids from this single host?
"Hari Pra" wrote:

> Use the below command:-
> KILL SPID
> SPID you can get from master..sysprocesses table
> Thanks
> Hari
> SQL Server MVP
>
> "Jamie Elliott" <JamieElliott@.discussions.microsoft.com> wrote in message
> news:361BFBE0-E309-430E-8B34-E8D96B906AD2@.microsoft.com...
>
>|||Declare @.Host VarChar(100)
Set @.Host = '<Put Computer HostName Here>'
Declare @.Sql VarChar(20)
While Exists
(Select * From master..SysProcesses
Where HostName = @.Host)
Begin
Select @.Sql = 'Kill ' +
LTrim*Str(Max(Spid), 5,0))
From master..sysProcesses
Where HostName = @.Host
-- --
Exec(@.Sql)
End
"Jamie Elliott" wrote:
> There are about 100 dead process ids from 1 host, are you saying this will
> kill all the process ids from this single host?
> "Hari Pra" wrote:
>

Friday, February 24, 2012

Keep records that contain certain attributes

Have a report that I want to keep certain attributes and as long as the report contains this certain attribute, bring all other attributes with it. Better with an example. In this report I am specifically looking for attribute "Alcohol", if I find this attribute I want to include all others that fit with this record's Primary Key which could include, "Drugs","Arson","Vandalism", etc. Problem is when I try to use a paramater or filter I get the "Alcohol" Attribute but not the "Drugs","Arson","Vandalism", etc. Conversely since I dont have any filter/paramater set I get everything even if it does not include "Alcohol"

suggestions?

thansk in advance

km

Hi km

I am having a bit of trouble understanding what data you are working with.
Once this is clear perhaps I can help.
Does your data-set look like the following?

Primary Key | Problem
-
1 Drugs
1 Alcohol
1 Vandalism
2 Theft
2 Drugs

And you want to display all rows with PrimaryKey = 1 (since it includes alcohol), but not any rows with Primary Key 2?

If that is the case it will definitely be easiest to do this in you query itself, not in the report.
Something like:

Select * From Table WHERE PrimaryKey IN
(SELECT PrimaryKey From Table WHERE Problem = 'Alcohol'

Cheers
Mark
|||

thanks Mark

Yes this is similiar to my data found out that there is a unique key for each atttribute so all is resolved

thanks for your response

km

Keep records that contain certain attributes

Have a report that I want to keep certain attributes and as long as the report contains this certain attribute, bring all other attributes with it. Better with an example. In this report I am specifically looking for attribute "Alcohol", if I find this attribute I want to include all others that fit with this record's Primary Key which could include, "Drugs","Arson","Vandalism", etc. Problem is when I try to use a paramater or filter I get the "Alcohol" Attribute but not the "Drugs","Arson","Vandalism", etc. Conversely since I dont have any filter/paramater set I get everything even if it does not include "Alcohol"

suggestions?

thansk in advance

km

Hi km

I am having a bit of trouble understanding what data you are working with.
Once this is clear perhaps I can help.
Does your data-set look like the following?

Primary Key | Problem
-
1 Drugs
1 Alcohol
1 Vandalism
2 Theft
2 Drugs

And you want to display all rows with PrimaryKey = 1 (since it includes alcohol), but not any rows with Primary Key 2?

If that is the case it will definitely be easiest to do this in you query itself, not in the report.
Something like:

Select * From Table WHERE PrimaryKey IN
(SELECT PrimaryKey From Table WHERE Problem = 'Alcohol'

Cheers
Mark
|||

thanks Mark

Yes this is similiar to my data found out that there is a unique key for each atttribute so all is resolved

thanks for your response

km