Hello,
SELECT dbo.tSp.pID, dbo.tLo.oS
FROM dbo.tSp INNER JOIN
dbo.tLo ON dbo.tSp.SpID = dbo.tLo.SpID
WHERE (dbo.tLo.oS = N'[MyText]')
This works without Where and I see MyText available in oS column. Why does
it not bring anything when Where is there?
Thanks,Ok. I removed [, works fine.
"JIM.H." wrote:
> Hello,
> SELECT dbo.tSp.pID, dbo.tLo.oS
> FROM dbo.tSp INNER JOIN
> dbo.tLo ON dbo.tSp.SpID = dbo.tLo.SpID
> WHERE (dbo.tLo.oS = N'[MyText]')
> This works without Where and I see MyText available in oS column. Why does
> it not bring anything when Where is there?
> Thanks,
>|||Just as a follow up the brackets are to use a obejectname in SQL Server,
useful for those developers who use spaces or special reserved words for
their objects (Yeah I know, there are some out there who always do this
:-) )
HTH, Jens Suessmeyer.
--
http://www.sqlserver2005.de
--
"JIM.H." <JIMH@.discussions.microsoft.com> wrote in message
news:34E4754D-ECA2-42B7-B36A-BA2F42A841FC@.microsoft.com...
> Ok. I removed [, works fine.
> "JIM.H." wrote:
>> Hello,
>> SELECT dbo.tSp.pID, dbo.tLo.oS
>> FROM dbo.tSp INNER JOIN
>> dbo.tLo ON dbo.tSp.SpID = dbo.tLo.SpID
>> WHERE (dbo.tLo.oS = N'[MyText]')
>> This works without Where and I see MyText available in oS column. Why
>> does
>> it not bring anything when Where is there?
>> Thanks,|||SELECT dbo.tSp.pID, dbo.tLo.oS
FROM dbo.tSp
INNER JOIN
dbo.tLo
ON dbo.tSp.SpID = dbo.tLo.SpID
AND dbo.tLo.oS = N'MyText'
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"JIM.H." <JIMH@.discussions.microsoft.com> wrote in message
news:C1220918-D358-4387-9268-94679031B403@.microsoft.com...
> Hello,
> SELECT dbo.tSp.pID, dbo.tLo.oS
> FROM dbo.tSp INNER JOIN
> dbo.tLo ON dbo.tSp.SpID = dbo.tLo.SpID
> WHERE (dbo.tLo.oS = N'[MyText]')
> This works without Where and I see MyText available in oS column. Why does
> it not bring anything when Where is there?
> Thanks,
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment