Archive for January 25, 2008

Alternative Method for Copying Databases in SQL Server 2005 Management Studio

How’s this for an awesome post… nevermind global warming, subprime mortgages or national healthcare, this one tops them all: How to easily port that database that you’ve been working on remotely on a hosted web server to your own machine using SQL Server 2005 Management Studio.

Why on earth am I writing this? Because I was trying to do a “Copy Database” in SQL Server 2005 Management Studio for the past hour, and kept getting permissions errors from my web host when using SMO. So in case I forget (likely), I wanted to write some steps for myself. It’s late and I’m too lazy to paste pictures. Just use your imagination on this one:

HOW TO DO IT:

  1. Open SQL Server 2005 Management Studio, and Connect to the database that you will transferring from
  2. Create a new database to copy to
  3. Right-Click on the database you will be copying, select “Tasks” -> “Export Data”
  4. Choose all tables and follow the prompts to Export the data and tables from the original database to the newly created db
  5. After the export finishes (will take a few minutes, most likely) check to make sure all tables, views, stored procs etc have been installed
  6. Right-click the original copy database, select “Tasks”->”Generate Scripts”
  7. Follow the prompts, choose to generate the script into a query for ease
  8. Copy the generated script to your clipboard
  9. Select the new database, open a new query, and paste the generated script into this query.  The query will be run on the new database.
  10. Run the new script.  There will be errors, because the script will not be able to replace existing tables.  We are only running the script to install objects that don’t hold data, such as views and stored procedures.
  11. Check to ensure all the original tables, views, stored procs etc are now in the new database
  12. Close all scripts, don’t save unless you really want to
  13. Feel good about yourself

Well that’s it. I hope you learned a lot in those few seconds of reading my rather ad-hoc instructions. Now if you don’t mind, I’m going to try and tip toe over my roommates dogs and get a cup of joe.

Peace

Why I’ll Always Love San Francisco

Forgive me, but I’m having a Kleenex moment. Yes, the emotions are broiling forth, as I’ve been reminiscing about the last 3 years of my life in the San Francisco Bay area. It wasn’t always roses and sunshine, but it was adversity, success and awakening on a lot of levels for me. So I’m busting out with a list of why I’ll always love San Francisco:

Reasons Why Shan Will Always Love San Francisco

  • San Francisco welcomes people who do not fit into mainstream society with open arms. She always has, and always will. You can never be too extreme for San Francisco, because there is always someone more extreme than you just around the corner.
  • It’s very multicultural, to the point of absurdity. You can travel to most of the world just by visiting different suburbs of San Francisco. Russian Hill, Chinatown, Little Italy, Oakland, Berkeley, the Mission. My fondest memories will be learning about Chinese, Indian and even Brazilian cultures from the friends that I made there.
  • If you have a new idea, you will get support for it in San Francisco. It is entrepreneur heaven. People there embrace new ideologies as if they were gold. Ideas are what San Fran famously produces. Look at the iPod: Made in China, DESIGNED in California.
  • Lots of jobs there for tech people. As a computer science graduate in Arizona, I got my first job with Vertigo Software in Point Richmond, in the Bay Area. Those guys were a crew of elite programmers that were kind enough to give a guy with an average GPA a break. And once I arrived there, the breaks didn’t stop coming. Even if I were to move back to the Bay Area some day, I know that I won’t have trouble finding a good job in San Fran.
  • There is an air of ethics there that transcends religion, politics and even sex. You just don’t make life hard for people that are different than you, that seems to be the unspoken rule.
  • Lots, I mean lots, of organized activities. The main activity being long distance running. If you are a marathon runner, then move to the Bay Area. It seems like every week there is a race with hundreds of participants somewhere in the Bay.

There are a lot of problems in San Fran. Let’s not ignore the fact that SF has the highest rate of AIDs and homelessness in the USA, as well as earthquakes, gangs, environmental pollution, and insane housing costs. But if you use your brain and think outside the box, life there can be quite enjoyable.

Just don’t buy a house there at the moment. If you don’t know what I’m talking about, research “sub-prime mortgages” :) .