[dba-SQLServer] Strange syntax

David McAfee davidmcafee at gmail.com
Tue Sep 13 19:27:20 CDT 2011


No. This is very old usage. Pre 7.0.

I've seen it in our old erp system.

My professor would throw stuff like that in some of our tests.

Anybody using that in a newer SQL sproc is just trying to make it look like
he's doing hard work. :)

Sent from my Droid phone.
On Sep 13, 2011 4:39 PM, "Alan Lawhon" <lawhonac at hiwaay.net> wrote:
> Arthur, et al:
>
> Goodness! I hope something like this doesn't show up on the 70-432 and
> 70-433 SQL Server certification exams ...
>
> Alan C. Lawhon
>
> -----Original Message-----
> From: dba-sqlserver-bounces at databaseadvisors.com
> [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur
> Fuller
> Sent: Tuesday, September 13, 2011 6:21 AM
> To: Discussion concerning MS SQL Server
> Subject: [dba-SQLServer] Strange syntax
>
> I just came across some T-SQL syntax that I've never seen before, and I
have
> no idea what it means or how it works.
>
> <sql>
> DECLARE @b INT
> SELECT 0 [A]
> , B = 1 -- 1
> , 1 ++ 1 AS [C]
> , 1 +-+ 1 AS [D]
> , 1 -+- 1 AS [E]
> , 1 - - 1 AS [F]
>
> PRINT 'Result: ' + CAST(@b AS VARCHAR(10))
> </sql>
>
> Results:
>
> A B C D E F
> ----------- ----------- ----------- ----------- ----------- -----------
> 0 1 2 0 2 2
>
> (1 row(s) affected)
>
> Can anyone explain this? I can't think of a use for it offhand, but I'm
> certainly curious as to how it works.
>
> TIA,
> Arthur
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
>
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
>



More information about the dba-SQLServer mailing list