Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "Bob Barrows" Newsgroups: comp.databases.ms-sqlserver Subject: Re: One more thing I don't understand in large Stored Procedure Date: Sun, 2 Oct 2011 13:44:52 -0400 Organization: A noiseless patient Spider Lines: 27 Message-ID: References: Injection-Date: Sun, 2 Oct 2011 17:44:41 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="inlgCTpOMxujS+VHkVo6dA"; logging-data="24354"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+MMX7vMMi05KAZf/QwmrzqE8qalaz3BpQ=" X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6109 X-RFC2646: Format=Flowed; Original X-Antivirus-Status: Clean X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-Antivirus: avast! (VPS 111002-1, 10/02/2011), Outbound message Cancel-Lock: sha1:v9t3DgWPDiSKphmgFaSMDaQsVq0= X-Priority: 3 X-MSMail-Priority: Normal Xref: x330-a1.tempe.blueboxinc.net comp.databases.ms-sqlserver:709 Tony C. wrote: > My Question is now: > > 1) Does a SELECT Statement ALWAYS return a result set? No. If all a SELECT statement does is assign values to variables SELECT @var=col1, @var2=col2 from table it will not return a resultset. Otherwise, yes, it will always return a resultset, empty or otherwise. > 2) Is there a way I can tell by looking at the code which select > statements should return results sets from and which not? See above > > I have several SELECT statements that don't appear to return anything. > Sometimes a SELECT statments sets a local variable and doesn't return > anything and sometimes it does.....how do I tell the difference? See above. >