master..sysprocesses issue in SQL Server 2005

I can run the following query in Sql Server 2000 with no issues but in SQL server 2005
I get the blocked and program_name fields as the ambiguous field error.

select spid, blocked, hostname, program_name, loginame from master..sysprocesses
7of9121098Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

25112Commented:
I get the statement working ok on both 2000 and 2005. can you post an image of the error you are getting?
0
25112Commented:
do you mean NULL?
blocked column can be NULL..
and if is a internal system process, the program_name could be NULL, too..
http://msdn.microsoft.com/en-us/library/ms179881%28v=SQL.90%29.aspx
0
25112Commented:
i should say NULL or blank
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

7of9121098Author Commented:
The problem is with the ORDER BY statement, it works without it. Weird...

select spid, blocked, hostname, program_name, loginame, * from master..sysprocesses
-- to avoid the sql process
where status <> 'background'
order by blocked desc,program_name
Msg 209, Level 16, State 1, Line 1
Ambiguous column name 'blocked'.
Msg 209, Level 16, State 1, Line 1
Ambiguous column name 'program_name'.
0
25112Commented:
try this:

select
spid,
blocked as BlockedProcess ,
hostname,
program_name as ProgramName,
loginame,
 * from master..sysprocesses
where status <> 'background'
order by blocked desc,program_name
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
7of9121098Author Commented:
Wierd, I wonder why it didn't work with alias. Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.