Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Joining on Part of a Column - SOLVED

Author  Topic 

jbates99
Constraint Violating Yak Guru

396 Posts

Posted - 2010-08-31 : 14:44:31
hi all,

I'm trying to list all my (2005) SSIS package names along with the agent Job that executes them.

Well, this is what I came up with and it is obviously not quite correct.

select 'PNCLRMDB' as 'Server', c.name as PackageName, a.name as JobName from sysjobs a INNER JOIN sysjobsteps b ON a.job_id = b.job_id INNER JOIN sysdtspackages90 c ON c.name LIKE '%'+b.command+'%';

It parses OK but does not return any records.

Is there a way of doing this in a single SQL stmt ?

Thanks John

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-08-31 : 17:59:32
use this:

ON b.command like '%'+c.name+'%'

then it will work.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

jbates99
Constraint Violating Yak Guru

396 Posts

Posted - 2010-08-31 : 18:23:44
Thank you WebFred!

It worked beautifully.

And yes, that's what you advised me to do yesterday in the other forum.... but well, you know :)

I owe you a cold one of your favorite beverage!

John - Memphis TN USA
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-08-31 : 18:35:50



No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -