Viewing 7 posts - 1 through 8 (of 8 total)
GilaMonster (12/4/2015)
IF (SELECT p.ActivityCode FROM mission m LEFT OUTER JOIN product p ON p.extproductid = m.extproductid WHERE m.missionid = 12344) = 1BEGIN
-- query to be selectively run goes here
END
Thanks...
December 4, 2015 at 3:40 am
GilaMonster (12/4/2015)
If it's in Product, there's a chance it could be NULL due to the outer join....
December 4, 2015 at 3:18 am
GilaMonster (12/4/2015)
Ok, so what then, do you want to run the query and return an empty resultset? Not run the query at all?And ditch those NOLOCK hints!
Not run the query...
December 4, 2015 at 2:50 am
To clarify a bit more for you. They system uses a inparameter so it only gets one result. The query in practice will end up looking like this:
select...
December 4, 2015 at 2:47 am
GilaMonster (12/4/2015)
What happens if there are multiple rows with trigger = 1 and multiple rows with trigger = 0?
When should the print not happen? When all rows have...
December 4, 2015 at 2:41 am
GilaMonster (12/4/2015)
Firstly, ditch the NOLOCK hints, they're not go-faster switches, they're essentially WITH (RETURNPOTENTIALLYINCORRECTDATA) hints. If you don't mind the...
December 4, 2015 at 2:21 am
its basically like this:
select * FROM
(
select
m.something,
m.something,
m.something,
substring(p.something,1,30) something,
m.something,
p.trigger
from something m with(NOLOCK)
left outer join something p with(NOLOCK) on p.something=m.something
) TV
Maybe i...
December 4, 2015 at 1:58 am
Viewing 7 posts - 1 through 8 (of 8 total)