In the course of developing some stored procs today I learned some stuff I didn't know.
1) SELECT 'abc' AS column1 can be rewritten as SELECT column1 = 'abc'
2) SELECT SUBSTRING('qwerty', 1, LEN('qwerty') - 1) & SELECT SUBSTRING('qwert ', 1, LEN('qwert ') - 1) don't give the same result because LEN strips off trailing white spaces. Yes, this is stated in BOL but let's be honest....who actually reads and digests BOL? :) Its something to be aware of anyway cos it was creating problems for me this afternoon before I discovered the cause!
Am I alone in not knowing these things? I'm glad to be able to say that it was also news to my 2 fellow SQL Server devs on my project.
Riveting stuff eh?
This is a fairly pointless blog post I think you'll agree. Firmly placed into my "Inane Waffle" category!!!
-Jamie