SQL SAMSON

everything sql

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

Free Doritos for a Year!

leave a comment »

Download now or preview on posterous

doritos.pdf (444 KB)

At first I didn't believe this, but my mother actually went to a Walgreens and used this coupon and walked out with a free large bag of Doritos.

Posted via email from wetmatter nonsense

Written by Samson Loo

March 30, 2010 at 7:35 pm

Posted in General

testing 123

leave a comment »

this is only a test to see how this test contrast against the theme of this site.

Posted via web from sql phoenix

Written by Samson Loo

March 27, 2010 at 3:59 am

Posted in General

Creating a Database Snapshot

leave a comment »

This is a quick vid that steps you through the process of creating a database snapshot, restoring a database from a snapshot and dropping a snapshot. I typically use snapshot while I am in a testing mode. I quickly create a snapshot and make all my modifications, run through my test and blow it all away by restoring from my recent snapshot. It is very useful and I use it often on my local development instances. Hopefully you will find it just a useful.

Posted via email from wetmatter nonsense

Written by Samson Loo

March 13, 2010 at 2:44 am

Posted in sql

SQL Saturday Phoenix?

leave a comment »

Is SQL Saturday really coming to Phoenix? Well the announcement was made public at the Arizona PASS chapter in a recent user group meeting. It is headed up by @Hafthor, @Coneybeer and myself @sqlsamson. We have teamed up and are looking to get the community involved! If you don’t know what SQL Saturday is then allow me to brief you on it. It is a one day FREE training event that is conveniently held on a Saturday. In these troubled times FREE training never sounded so good! How great is that? SQL Saturday offers two tracks with four to six sessions for each track lasting about an hour each. The best part is that the speakers are fellow SQL Server enthusiast from our very own local community. You know them and you love them so come out and show your support!

If you are familiar with SQL Saturday then you know it was picked up by (PASS) the Professional Association of SQL Server not long ago and the fact it is in its planning stages here in Arizona is exciting. With such a large and overwhelming amount of knowledge sharing that SQL Saturday has to offer, it will be to valuable asset to the community. Keep in mind that SQL Saturday won’t be a success unless you get involved. We need support from the community in several different areas. If you are apart of another technical group please spread the word that SQL Saturday is coming and we are looking for speakers/presenters, sponsors, volunteers, and of course venues.

If you are willing to present, sponsor, volunteer or can assist with getting locations please contact either one of the following:

For more information about SQL Saturday please visit SQLSaturday.com. I hope to hear from you and more importantly I hope to see you there!!!!

For information about the Arizona PASS chapter please visit Arizona PASS

— samson

Posted via email from wetmatter nonsense

Written by Samson Loo

March 13, 2010 at 12:53 am

Posted in sql

Candy! Candy! Candy!

leave a comment »

Written by Samson Loo

February 24, 2010 at 11:38 pm

Posted in General

Grilled Talapia over basmati rice

leave a comment »

Written by Samson Loo

February 22, 2010 at 12:49 am

Posted in General

Updating SQL Server 2005

leave a comment »

This video steps you through the update process of applying Service
Pack 2 to SQL Server 2005 very quickly and very straightforward.

Music by Kevin MacLeod

Posted via email from wetmatter nonsense

Written by Samson Loo

February 20, 2010 at 3:09 am

Posted in sql server 2005