Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
i want to project the salary of an employee in the form of *if a salary of an employee is 20 thousand then there should be 20 * in the salary columnssss
James K
Master Smack Fu Yak Hacker
3873 Posts
Posted - 2013-02-08 : 10:58:27
You will need a varchar column to hold this data - you cannot store it in a numeric column. So it would be something like this:
-- first add the salary indicator column.ALTER TABLE YourTable ADD SalaryIndicator VARCHAR(32);-- now populate the column. You could even make this a computed columnUPDATE YourTable SET SalaryIndicator = CAST(ROUND(Salary,-3)/1000 AS VARCHAR(32)) + ' *';