Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #715

Re: One more thing I don't understand in large Stored Procedure

From Erland Sommarskog <esquel@sommarskog.se>
Newsgroups comp.databases.ms-sqlserver
Subject Re: One more thing I don't understand in large Stored Procedure
Date 2011-10-02 20:31 +0200
Organization Erland Sommarskog
Message-ID <Xns9F72D0B59846BYazorman@127.0.0.1> (permalink)
References <lf7h87lipni429qkdkfp09gskcuaj8nk7q@4ax.com> <j6a7u8$np2$1@dont-email.me> <aa9h87l9p368vnjhg28h42kblk9mev6b4u@4ax.com>

Show all headers | View raw


Tony C. (me@here.com) writes:
> However, this does return a resultset. 
> 
> 
>  select @BeginProcessControlDate as BeginProcessControlDate,
> @EndProcessControlDate as EndProcessControlDate,
>         count(*) as UsageGroupCount 
>    from CabsUsageGroupHC;

This is not variable assignment.
 
> only diff is SELECT @variable AS  instead
> of SELECT @variable = 
> 
> could that be the difference?
 
Yes, the second is variable assignment. The first produces a regular 
result set. You simply return the value of the variable to the client.


-- 
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

One more thing I don't understand in large Stored Procedure Tony C. <me@here.com> - 2011-10-02 12:34 -0500
  Re: One more thing I don't understand in large Stored Procedure "Bob Barrows" <reb01501@NOSPAMyahoo.com> - 2011-10-02 13:44 -0400
    Re: One more thing I don't understand in large Stored Procedure Tony C. <me@here.com> - 2011-10-02 12:47 -0500
    Re: One more thing I don't understand in large Stored Procedure Tony C. <me@here.com> - 2011-10-02 13:05 -0500
      Re: One more thing I don't understand in large Stored Procedure Erland Sommarskog <esquel@sommarskog.se> - 2011-10-02 20:31 +0200
        Re: One more thing I don't understand in large Stored Procedure Tony C. <me@here.com> - 2011-10-02 13:32 -0500
          Re: One more thing I don't understand in large Stored Procedure Henk van den Berg <me@myplace.net> - 2011-10-02 21:28 +0200
      Re: One more thing I don't understand in large Stored Procedure "Bob Barrows" <reb01501@NOSPAMyahoo.com> - 2011-10-02 15:25 -0400
        Re: One more thing I don't understand in large Stored Procedure Tony C. <me@here.com> - 2011-10-02 15:31 -0500

csiph-web