Archive for January, 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” :) .

Creating DotNetNuke 4 Modules with LINQ

DotNetNuke is awesome, I can’t believe I have lived without it for these many years as a .NET developer. It’s a plug-and-play website with tons of useful features that you can simply insert into content panes in a matter of seconds. Things like blogs, surveys, shopping carts, reports… you name it, there will already be a DotNetNuke module available online for it.

What is a DotNetNuke module? It’s a feature that you add to a DotNetNuke site; for example, FAQ is a module you drop into your DNN site once its installed on the site correctly. Similarly, shopping carts, blogs and surveys are also built-in modules that come with DNN 4 when you install the site on a web host.

But what happens if you want to create your own module? Good question. That’s what I’m about to find out from Michael Washington’s tutorial:

http://www.adefwebserver.com/dotnetnukehelp/LinqTutorial/LinqTutorial2.htm

The tutorial also gives you hands on experience with LINQ, for anyone (like myself) that doesn’t have much exposure to the technology.  Here are the basic steps for creating DotNetNuke 4 Modules with LINQ:

  1. Setup Your Project
  2. Create Tables
  3. Setup the Module
  4. Create LINQ to SQL Class
  5. Create the Module
  6. Create the Code-Behind
    1. Code-Behind for LINQ Datasource Control
    2. Code-Behind for Add My Listing Link
    3. Code-Behind for the Gridview (if any)
    4. Add additional Methods to the Code-Behind
  7. Create the Module Definition

Is An MBA Worth It?

There are already countless articles on this topic posted on the web already, I admit. This post is purely for the selfish purpose of reassuring myself why I am spending roughly $20k on an MBA here at James Cook University in Australia. Perhaps someone else out there in cyberland may benefit from this reassurance? In any case, here goes:

Reasons for getting an MBA:

  1. Money: Apparently you will be making on average $10k-30k more than my counterparts with undergrad degrees, and this is not counting the fact that you may be working in IT. Experience in the world of information technology pays off in itself, but having a master’s degree in business earns an even fatter paycheck for IT professionals (1).
  2. Career Advancement: an MBA is still important to reach senior management ranks within most companies(2).
  3. Self-Improvement: Leadership skills, managment skills, networking skills… even if you choose the non-profit world, the possibilities of being a big dog in your field seem more real than without education in these areas.
  4. Networking: I haven’t even started the MBA program yet, and already people seem to be hooking me up with business opportunities and contacts after learning that I am doing an MBA. Just meeting people and telling them what are you doing opens doors for you, it’s remarkable.
  5. More opportunities: A fellow undergrad student in the USA once told me that the more you study, the more you can “see” the world for what it really is. He added that getting an MBA is like moving up to a higher floor of a building and seeing more of the world below you (he probably wanted me to take this comment both literally as well as philosphically). I must agree with him – if you gain a general understanding of how businesses work and why they make the decisions that they do, then you can use this knowledge to help the business profit, rather than simply working hard in your assigned job and hoping that the business does well enough for you to get your $4k pay rise every year.
  6. Fewer Hours Working: Think about it – you are a manager, and you are getting other people to do your work for you. If you have the management and personable skills necessary to get people to work for you, then you don’t have to do the work yourself! My managers have all told me that they work less than 40 hours per week. They are very talented individuals, however it is their influence and ability to communicate effectively with people, along with their understanding of the business that makes their lives easier, not, for example, how talented at programming they are.
  7. Learn How to Start or Fine-Tune Your Own Business : This is perhaps a primary reason why many people pursue the MBA.
  8. Greater Job Security: MBAs are in demand, regardless of what jealous people tell you.
  9. Credibility: Especially among peers. Unfortunately there is that “part of the club” executive type feel, but it is useful for gaining respect.
  10. Communication Skills: Effective communication is supposedly learnt through various projects and presentations in an MBA program (3).
  11. Real-World Applications: MBA students can apply their studies to their work.

References:

(1) http://www.newswise.com/articles/view/512170/?sc=dwtr
(2) http://www.quintcareers.com/MBA_degree.html
(3) http://www.cio.com/article/122508/_Reasons_Why_You_Should_Get_an_MBA/3