Tuesday, February 12, 2013

[excel] How to force a newline in formula?

Case:
I want to bring together three columns of text into 1 column. For example:
A = CommentA
B = CommentB
C = CommentC

If you concatenate (=A&B&C) you get CommentACommentBCommentC. I know you can put in characters and spaces using "" inbetween the & (e.g =A&","&B&","&C), but is there a way to get excel to move the next comment onto a new line within the same cell so it looks like:
CommentA
CommentB
CommentC

Answer:
1. Try using the function CHAR to generate a newline character in your formula. It should look something like this ...
=A1&CHAR(10)&B1&CHAR(10)&C1

2. You will probably need to format the cell so that alignment has Text Wrap activated.

Monday, January 28, 2013

[mssql] mdf is Compressed But Does not Reside in a Read-only Database or Filegroup. The File Must be Decompressed

Last night I loaded a massive ASP.NET 2.0 project I did some years ago in VB.NET. It used a SQL 2000 database for data storage, so I had to attach the mdf file to get it to work. So I opened SQL Server Management Studio, opened a connection to the server instance, and went for the Attach database option.

When I selected the file, the following error came up:

“Store.mdf is Compressed But Does not Reside in a Read-only Database or Filegroup. The File Must be Decompressed.”

So here’s a quick tip for anyone who faces a similar issue. It took a few seconds to understand the problem but then I remembered file compression options. Opened my mdf file properties dialog box, and in the advance tab the problem was revealed: the “compress content” checkbox was checked.

After unchecking and saving changes, SQL Server accepted the attach with no problem whatsoever.