SQL SAMSON

everything sql

Archive for April 2010

SSMS Copy Column Headers

leave a comment »

Needing some sort of variation or at least a break from my certification studies I decided to revisit a title I purchased a while back: “Beginning SQL Server 2008 for Developers” from @Apress written by Robin Dewson. Truly glad I did because one of the problems I have when illustrating data related issues to clients is having to piece together a bloody spreadsheet. I typically would query the tables then query the INFORMATION_SCHEMA.COLUMNS or sys.columns to get the column names to use as headers. Then I would copy and paste them into the predetermined rows.

Well not any more because page 42-43 of this awesome book had life changing screenshots of the Options dialog. Big deal right? Well a big deal for me at least! Following the path of Query Results –> SQL Server –> Results to Grid lead me to a sudden state of euphoria. There I saw it as the lights of heaven filled my home, blurring everything around me as if a spotlight and magnify focused in on the wonderful words that read: “Include column headers when copying or saving the results”. Was it really true, are my days of querying sys.columns or the INFORMATION_SCHEMA.COLUMNS finally over? In a way, maybe, not really, but at the very least delivering requested spreadsheets to clients will be a bit faster. I was so excited I tried this on MSSQL 2005 and sure enough it is there!

What you need to do is: 

Step 1 – Go to Tools –> Options

Step 2 – Expand Query Results –> SQL Server –> Results to Grid

Then check the box titled: Include column headers when copying or saving the results

Step 3 – Copy some cells

If you have tabs opened already, open a new query window and try it. You should see the menu item “Copy with Headers” as a right click option

Step 4 – Then paste your results into the spreadsheet

Just a side note, if you are dealing with datetime data types you should consider making the predetermined columns in the spreadsheet as a text category by formatting the cells, under the Number tab select the “Text” category.

Cover image taken from Apress.

Posted via email from wetmatter nonsense

Written by Samson Loo

April 30, 2010 at 7:15 am

Posted in sql, tsql

Hide Tagged Photos & Videos on Facebook

leave a comment »

A few friends of mine asked me how to hide tagged photos and videos of them on facebook. Well there is a way, but it does not necessarily hide the photos of you entirely. It just hide them from the people who are visiting your profile who happen to be looking through your photos. However if someone else (a friend or stalker) has a photo of you in one of their albums and they tag you then that photo will still visible to the friends of the person who tagged you. Also depending on their privacy settings your photo can be available to nearly anyone for that matter. Yea… instant FAME! Unless it is a non-flatter picture of course. So in short you are only hiding them from being viewed on your profile. With that said if you still want to “pseudo” hide them, then this is how you would do it.

Step 1 – Go to Privacy Settings

Step 2 – Go to Profile Information

Step 3 – Go to Photos and Videos of me

Step 4 – Select the appropriate permission level

Posted via email from wetmatter nonsense

Written by Samson Loo

April 30, 2010 at 1:53 am

Posted in General

Wild Ahi Sliders

leave a comment »

The Wild Ahi Sliders from True food kitchen come with wasabi, radishes, cucumber and a sesame brioche. Don’t be mislead, the wasabi is merely a nice little portion which gives you a perfect essence, no epic nasal burns here. I ordered mine with the sweet potato hash which was absolutely awesome and the Green Arnie (Matcha Green Tea & Honey Lemonade) for my drink which was very refreshing. If you get the opportunity to stop in and look for Nate he the cool guy at the bar. True Food Kitchen is a cool place, great atmosphere, and awesome people. Highly recommended. 

Posted via email from wetmatter nonsense

Written by Samson Loo

April 6, 2010 at 12:31 am

Posted in General