May 21, 2013 at 2:06 am
Hi
I see nothing wrong with my code but it keeps throwing up the following error:
Msg 208, Level 16, State 1, Line 266
Invalid object name 'members_.memberID_'
Any idea what I'm doing wrong please?
select domain_,count(memberID_) as CountofMembers
from members_.memberID_ with (nolock)
left join clicktracking_ on members_.memberID_ = clicktracking_.memberID_
where
members_.list_ = 'cheapflights_uk' and
TimeClicked between @start and @end
and History_Type_ <> 'old'
and UrlID_ IS NOT NULL
and (
domain_ = 'hotmail.co.uk' or
domain_ = 'hotmail.com' or
domain_ = 'yahoo.co.uk' or
domain_ = 'yahoo.com' or
domain_ = 'gmail.com' or
domain_ = 'aol.com' or
domain_ = 'btinternet.com' or
domain_ = 'live.co.uk' or
domain_ = 'talktalk.net' or
domain_ = 'googlemail.com' or
domain_ = 'msn.com' or
domain_ = 'tiscali.co.uk' or
domain_ = 'ntlworld.com' or
domain_ = 'sky.com' or
domain_ = 'live.com' or
domain_ = 'fsmail.net' or
domain_ = 'blueyonder.co.uk' or
domain_ = 'ymail.com' or
domain_ = 'rocketmail.com' or
domain_ = 'btconnect.com'
)
group by domain_
order by domain_
May 21, 2013 at 2:09 am
from members_.memberID_ with (nolock)
Do you have a table named memberId_ which belongs to the schema members_ ?
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
May 21, 2013 at 2:15 am
Hi
I've worked out the problem.
from members_.memberID_ with (nolock)
shouldn't have memberID_ in the SQL
Thanks
May 21, 2013 at 2:29 am
philip.davy (5/21/2013)
HiI've worked out the problem.
from members_.memberID_ with (nolock)
shouldn't have memberID_ in the SQL
Thanks
Great you could find it out 🙂
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
May 21, 2013 at 2:41 am
Btw, watch those nolocks.
See - http://blogs.msdn.com/b/davidlean/archive/2009/04/06/sql-server-nolock-hint-other-poor-ideas.aspx
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply