Showing posts with label entry. Show all posts
Showing posts with label entry. Show all posts

Tuesday, March 27, 2012

Basic formatting questions

I have two questions concerning formatting output in SQL.

I have a processer speed column that I would like to make usable. A sample entry is 2793, which I would like to be returned as '2.8 GHz'. I am using the following successfully, but when I try to append the ' GHz' it gives me a conversion error (I have tried putting both a cast and convert around the round statement).
ROUND(CONVERT(DECIMAL,PCCPUSpeed_IN) / 1000,1) + ' GHz'

Secondly, I have a RAM colum that stores values such as 534753280. I would like the results to fallin into 64 Mb buckets. So values between 512000 & 532480 should return '512 Mb'. I realize I can do this using a CASE statement, but is there a better way?

Thanks,

RobAll formatting really ought to be done on the client or at least in the middle tier. Doing formatting in the database is suicidal from both a performance and a scaling perspective in the long term.

-PatP

Tuesday, March 20, 2012

Balancing the Data ,Replication ?

Hi,

I have two sets of data i.e two instances of SQL server in two different cities. Data entry happens at both the places.I need to balance the data in two servers i.e. I need to Synchronize the data.

Currently I am Exchanging the data between two sides and using a Buffer database to update the incremental infromation.(Running a SQL script).

I have GUID columns in my database. I am too new to replication.I wanted to know whether I can implement repliaction and what changes i need to make?(e.g. Replacing GUID columns with Identity columns).
Permanent connectivity between two databases is required or Replication can be performed whenever connected?

Best Regards
RohitCan two databases having GUID columns can be replicated or needs to be altered to Integer column