Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 formating numbers

Author  Topic 

amigoface
Starting Member

2 Posts

Posted - 2011-11-05 : 16:02:34
hi,

I am trying to migrate a database from firebird to sqlserver

So I translate stored procedures as they are written

some stored procedure contain one UDF function that take a number and a format and make the formatting

the format can be variable ; for example :

#0.00, ### ##0.00 .... and things like that

after some searching i did'nt found a solution to this problem

any help is welcome

thanks and good day

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-11-05 : 18:30:23
Formatting should be done inside the application and not inside T-SQL. Return the raw data to the application and let the application figure it out.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-11-06 : 02:39:57
quote:
Originally posted by amigoface

hi,

I am trying to migrate a database from firebird to sqlserver

So I translate stored procedures as they are written

some stored procedure contain one UDF function that take a number and a format and make the formatting

the format can be variable ; for example :

#0.00, ### ##0.00 .... and things like that

after some searching i did'nt found a solution to this problem

any help is welcome

thanks and good day


all front end application have functions which facilitates easy displaying of data in format you want. Whats the front end language you're using? there's no need of changing formatting in databse or in sql query for this purpose

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

amigoface
Starting Member

2 Posts

Posted - 2011-11-06 : 05:43:44
well it's a little complicated

the formated result is not just for display, it's used by another stored procedure :)

it's a relatively big medical application that i am in charge to port to the web using sql server

i am not the original developper of the app, so to be honest i am just translating database from firebird to sql server



and you are right , formatting should be done in the client side
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-11-06 : 06:18:51
quote:
Originally posted by amigoface

well it's a little complicated

the formated result is not just for display, it's used by another stored procedure :)

it's a relatively big medical application that i am in charge to port to the web using sql server

i am not the original developper of the app, so to be honest i am just translating database from firebird to sql server



and you are right , formatting should be done in the client side


why should a proc rely upon format of arriving data? assuming you're using proper datatype this is not at all required

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -