February 20, 2014 at 6:27 pm
Sean Lange (2/20/2014)
Jeff Moden (2/20/2014)
Cast the final ouput as MONEY to get the leading zero.If that works then ...
Oh ye of little faith. 😛
SELECT TOP 10000
CAST(ROUND(ROW_NUMBER()OVER(ORDER BY (SELECT NULL))/1000.0,2) AS MONEY)
FROM master.sys.all_columns ac1
CROSS JOIN master.sys.all_columns ac2
;
--Jeff Moden
Change is inevitable... Change for the better is not.
February 21, 2014 at 7:31 am
Jeff Moden (2/20/2014)
Sean Lange (2/20/2014)
Jeff Moden (2/20/2014)
Cast the final ouput as MONEY to get the leading zero.If that works then ...
Oh ye of little faith. 😛
SELECT TOP 10000
CAST(ROUND(ROW_NUMBER()OVER(ORDER BY (SELECT NULL))/1000.0,2) AS MONEY)
FROM master.sys.all_columns ac1
CROSS JOIN master.sys.all_columns ac2
;
LOL. I was not questioning if what you posted would work. 😉 I was trying to say that since that would work you should remove all the extra garbage that I had thrown into the mix.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
February 24, 2014 at 4:16 am
Alter the precision of the column
ALTER TABLE Testing ALTER COLUMN Testcolumn decimal(16,1)
Viewing 3 posts - 16 through 17 (of 17 total)
You must be logged in to reply to this topic. Login to reply