Browse by Tags

All Tags » T-Sql (RSS)

Trimming that "untrimmable space"

UPDATE : It seems Community Server stripped the actual CHAR(160) in @someStringWithPad, just so that it will be contrived append CHAR(160) at the @someStringWithPad variable. ;) Ever experienced trying the following code to trim a seemingly "space"...
Posted by bonskijr | with no comments

Sql Server Data Type Precedence : Redux

Previously jokiz bloged about this one , I'd like to add further. The same issue cropped up again in the forums although not the exactly the same as jokiz's experience, this one could really give you hours of head scratching. Previously I was amazed that...

Sql Server 2005 Tip:Implicit Conversion of bit data types

Didn't you know that the following statement is now valid for Sql Server 2005 as criteria for a column with bit data type? SELECT * FROM Orders WHERE Processed = 'true' The engine is now intelligent enough to implicitly convert it to SELECT * FROM Orders...
Posted by bonskijr | 2 comment(s)
Filed under: , ,

Quick Tip: Character pad right a number

I have been dependent on the pad functions since the clipper days as it helped alot on formatting fixed length ids(invoice no., receipt no., etc.) Although I think the only purpose of formatting a number to fixed length precedeed by (usually) a zero is...
Posted by bonskijr | with no comments
Filed under:

Default Values

In VB I just love optional parameters, it's a shame that C# doesn't have that feature(instead of overloading methods of different parameters.) In T-Sql we can simulate this optional parameters in our stored procedures by using default values......
Posted by bonskijr | 13 comment(s)
Filed under: