Home Forums SQL Server 2008 T-SQL (SS2K8) How to generate data in lakhs format in SQL Server 2008 RE: How to generate data in lakhs format in SQL Server 2008

  • Luis Cazares (9/5/2013)


    I agree with Koen when he says that formatting should be done in the visualization layer.

    But if the column type is money, then you can use CONVERT and a format code.

    money and smallmoney Styles

    When expression is money or smallmoney, style can be one of the values shown in the following table. Other values are processed as 0.

    Value Output

    0 (default) No commas every three digits to the left of the decimal point, and two digits to the right of the decimal point; for example, 4235.98.

    1 Commas every three digits to the left of the decimal point, and two digits to the right of the decimal point; for example, 3,510.92.

    2 No commas every three digits to the left of the decimal point, and four digits to the right of the decimal point; for example, 4235.9819.

    For example:

    SELECT CONVERT( varchar(15), MyColumn, 1)

    BY using the above we will be able to generate output like 100,000.00 and so on...but my output should be 1,00,000.00...and for this i am able to achieve it in informatica but my wish is to make it achievable in SQL.