Blog ala Vidar

SQL, AppFrame and other cool technologies

AppEd 2010 – Ølensvåg in ENGLISH

We are happy to announce that AppEd will be in English, and that we’ve opened it for registration for all systems engineers, except Omega PS since we’re going to host their own AppEd “over there”. Your travel will be covered by Advantage Points, but accommodation, food and other stuff will be sponsored by Omega. Before you sign up, please check with your boss if it’s ok for you to go!

For more information about AppEd 2010, please go to http://apped.no. For registration go to “My Advantage” and locate AppEd 2010 Ølensvåg.

Backup Stored Procedure

I’ve had a couple of issues regarding the maintenance plan-tool in management studio (at least before 2008), and therefore I’ve never really put my trust in this tool. Instead of this, I’ve created a SP which now is available as an s-object in AppFrame. Will be available with the next build, but if you need it NOW, here it is:

This will take backups, (full, diff or transactional) using default settings and saving files with the following syntax:
DatabaseName_backup_201006231500.bak

CREATE PROCEDURE sstp_Database_Maintenance_Backup
(
	@BackupType AS CHAR(4) = 'FULL',
	@BackupPath AS NVARCHAR(300)
)
AS

IF @BackupType NOT IN ('FULL', 'DIFF', 'TRAN')
BEGIN
	RAISERROR('BackupType must be set to FULL, DIFF or TRAN!', 18, 1)
	RETURN
END
ELSE IF ISNULL(@BackupPath, '') = ''
BEGIN
	RAISERROR('BackupPath does not have any value!', 18, 1)
	RETURN
END
ELSE IF RIGHT(@BackupPath, 1)  '\'
BEGIN
	SET @BackupPath = @BackupPath + '\'
END


DECLARE
  @DBNAME AS NVARCHAR(128),
  @Filename AS NVARCHAR(128),
  @SQL AS NVARCHAR(MAX)


SET @DBNAME = (SELECT DB_NAME())
SET @Filename =
	@DBNAME +
	'_backup_' +
	CONVERT(VARCHAR(8), GETDATE(), 112) +
	REPLACE(CONVERT(VARCHAR(5), GETDATE(), 108), ':', '')

IF @BackupType = 'FULL'
BEGIN
	SET @Filename = @Filename + '.bak'
	SET @SQL = 'BACKUP DATABASE [' + @DBNAME + '] '
END
ELSE IF @BackupType = 'DIFF'
BEGIN
	SET @Filename = @Filename + '.diff'
	SET @SQL = 'BACKUP DATABASE [' + @DBNAME + '] '
END
ELSE IF @BackupType = 'TRAN'
BEGIN
	SET @Filename = @Filename + '.trn'
	SET @SQL = 'BACKUP LOG [' + @DBNAME + '] '
END

SET @SQL = @SQL + 'TO DISK = N''' + @BackupPath + '' + @Filename + ''' WITH '

IF @BackupType = 'DIFF'
BEGIN
	SET @SQL = @SQL + 'DIFFERENTIAL, '
END

SET @SQL = @SQL + 'NOFORMAT, INIT, NAME = N''' + @DBNAME + ' ' + @BackupType
SET @SQL = @SQL + ' Database Backup'', SKIP, NOREWIND, NOUNLOAD, STATS = 10'

EXEC(@SQL)

You can download the .sql file from skydrive.

AppEd 2010 – Ølensvåg

Everything is now settled. It will be October 1-2. Since it was such a great success last time, most of us will be staying at Løo, and we’ll run the sessions in our meeting rooms here at Omega HQ, Ølensvåg. Unfortunately we were not able to make this available for everyone, so this offer is only available for Norwegian speaking developers. Don’t worry, as last time, we’ve planned having separate events in Singapore, U.S., and this time also Lithuania.

To register for the event, log on to TeamDocuments, Intranet, My Advantage. There you can find “AppEd 2010 – Ølensvåg”. It requires 0 points!

Last time we took a notice of “Lessons Learned”, and this time we’re offering more information about the sessions, more sessions (3 tracks!) and informing everyone at a much earlier stage. We’ve also got a couple of surprises for you, so go ahead and register for the event!

For more information about the agenda with sessions and other stuff, please visit http://apped.no/agenda.

Nordnes.Me

A couple of weeks ago I looked in the mirror. What did I see? I saw a guy that used most of his spare time on Xbox games. So, what did I do? Well, I had to find something else to do. What else? Build a new server! Yeah yeah, I could go outside having some fresh air etc., but fresh air also comes through the windows, at least if you open them. ANYHOW! I bought two domains; nordnes.me and nrdn.es and though I’d have some fun. A while back I bought a Quad Core AMD CPU for my HDPC, but I bought a new Intel CPU for that, so the AMD processor with the main board was just lying around without being used. I bought 8 GB RAM for it, and 2 x 2TB disks. I’ve also got a Microsoft TechNet subscription, which allows me to download almost any Microsoft product for free to use in a testing environment. What’s more testing environment than my home network? 😉

Now, everything is up and running and here are the specs.

Physical server
vs – Hyper-V Server

Virtual servers, all running with 1GB RAM (2-4 while setting them up):
vsAD – Active Directory, DNS and similar
vsHS – Home Server 2003 (not running. Will probably be deleted soon)
vsLINUX – Debian. Not running, but installed in case I need to test some Linux-stuff
vsMAIL – Exchange Server 2010 (hosting vidar@nordnes.me)
vsSQL – SQL Server, running 5 instances (2005, 2008, 2008R2, Express etc)
vsVAIL – Home Server VAIL
vsWEB – Web server, hosting Nordnes.me and nrdn.es

Home Server

I’ve learned a whole bunch of stuff in the process of installing and configuring everything. Today I finished moving over to the new home server (VAIL) which based on Windows Server 2008 R2. It’s awesome! One of the new features is that you can stream your videos via web (using Silverlight). Oh, while I’m talking about home server. If you’ve got more than one computer at home (or at the office), you might want to think about buying one. It makes sharing videos, music, backing up your computers and making sure all computers have updated antivirus etc. a whole lot easier. But wait till VAIL is released! VAIL will only run on x64 bit, while the old version only runs on x86.

One thing worth mentioning: DO NOT add your Home Server to AD. You will be able to do it, but it causes so many problems. The reason I wanted to do it was to use the same username and password as on all my other machines (both physical and virtual). Also, joining machines to the home server should be done on a wired network, not on wireless. When joined, you can put them back on wireless without any problems, but I haven’t been able to join any of my computers while on wireless. Have no clue why though, since my wireless router is set up as an AP (Access Point).

Active Directory

The main reason I installed AD is that I wanted to use the same username and password on all computers, but also to play around with group policies. Also, Exchange is pretty meaningless, if not impossible, without AD.

Web

This is the server I’ve played most with. I installed SharePoint, played with Office Web Apps and most recently Nordnes.me and nrdn.es. The last one (nrdn.es) is my own test-project for bit.ly/tinyurl.com-like sites. If you’re interested I can send you the project for this one, but there’s no rocket science here. I’ve also built Nordnes.me using Master pages in ASP.NET. This is actually my first site ever in ASP.NET!

Nordnes.me is just a place where I’ve gathered all my public feeds (blog, twitter etc) into one stream. I’m using a windows service to poll all the feeds every 15 minutes or something and then using LINQ to XML (which btw is AWESOME!) with ASP.NET to display them.

Exchange

Since Omega just moved over to Exchange, I felt I had to get some more knowledge about this. It would be interesting anyways since 99% of our customers use it, so I would probably eventually “have to” build something that communicated with Exchange. Before starting the installation I was convinced that this was just another “next next next next finish” project, and I was right. At least to get it up and running. To get it to send and receive mail took a couple of hours though. I am still not able to connect to Exchange outside my network although testexchangeconnectivity.com says everything is working as it should be. Since it’s working locally it’s very hard for me to test outside my network, so I might have to pick someone up from Microsoft and get them home to see my server-collection 😀

SQL

All SQL geeks with self-respect should have at least 5 instances running at home. I’m only using 2008 R2 at the moment, where I’ve got mainly two databases. One for the tiny URLs (nrdn.es) and one for polling twitter. The reason I’m polling twitter is to gather very much data, so I can start playing with SSAS (SQL Server Analysis Services). There are two arguments for polling twitter for this; it’s public and there’s A LOT of data being generated (by people) every second.

Have you mooed today?

          (__)
          (oo)
   /——\/
  / |     ||
*  /\— /\
    ~~   ~~
…."Have you mooed today?"…

Find a Debian box and type: apt-get moo

5 minutes interview #24 – Anders Borchsenius (Microsoft)

Anders is MTUG’s contact in Microsoft. June 10th he and Børge Hansen are coming to town (Haugesund) to visit both NNUG and MTUG, and talk about the Windows Azure Platform. Register here for the event.

When did you start in Microsoft and what do you do?
I started in Microsoft January 2010, so I’m quite fresh, but have already found Microsoft a very exciting place to work. I currently in the Server & Tools department and I’m responsible for the day-to-day contact with Norwegian IT-professionals. Everything that Microsoft does towards IT-pro’s in Norway is my responsibility. So, shortly said, I’m working with letting you guys know what we are up to that concerns us geeks. Let me give you some examples. Many of you know MSDN& TechNet Live. This is a joint conference between MSDN and TechNet. I am responsible for the TechNet part. That is, making sure we have the right speakers, and of course making sure guys like you visit and enjoy the seminar. More, I am the contact for any IT-Pro community in Microsoft. It’s my job to help communities focused on Microsoft technology grow and prosper. I am also responsible for the Norwegian TechNet site and TechNet flash. Short said, I’m employed in Microsoft to talk to you, so if there are any questions just email me! If it’s to technical it’s not sure I’m able to answer, but I’ll surely find the answer for you 🙂

What are your goals for MTUG and the community in general?
Make friends! That is my personal goal. As the Community Manager in Microsoft it is my goal to make sure that MTUG reaches its own goals. It is many positive effects for Microsoft of having a large IT-pro community. First of all, it enables Microsoft to communicate directly to our users. And hopefully achieve a good two-way-dialogue. That was cheesy, I know, but it’s sort of the truth. It’s also my job to make sure other Microsoft employees see the value, competence and importance of having good relation with the community.

Other than computers, do you have any hobbies?
I really like to Scuba dive! I got my scuba license in 2004 and have loved it ever since. But it’s the recent 3 years that I have gotten some gear of my own and started diving here in Norway. Even though Oslo is limited in terms of dive locations, I still get to dive other places in Norway. Other than that, I love to spend time at my summer house in Bamble, Telemark. I have this small place by the sea, which my grandfather built. No summer without that place. Other than that, I’ve found myself involved in a conspiracy to steal all my spear time. Yupp, gotten a girlfriend, so not much spare time, but it has its charm 🙂

Links:
v-andbo@microsoft.com
http://blogs.technet.com/anders
@/anders_borch

Outlook tips and tricks

Now that it’s official that Omega’s running Exchange I can share a couple of tips and tricks I’ve found useful. First, let’s start with how to integrate with TeamDocuments. There’s a TeamDoc called “Outlook-plug-in”. If you don’t got access to it, just let me know and I’ll add you. Under Build, you’ll find a 2007 version, which also works on 2010. Install it and then open Outlook. You’ll notice you’ve got a couple of new icons in the “Add-Ins” tab. Press Config, and choose what settings you want. Here you can select calendars to sync, if to enable TeamDoc inside Outlook and to sync contacts. After clicking “OK”, just click on the connect button and it will start to synchronize!

Twitter
There’s a plug-in called TwInbox that you can use to get tweets inside Outlook. It’s pretty easy to set up, but be aware; if you’re following many people (like I do), it can get really naggy, so I’ve unchecked “Home” in preferences, so I only get mentions, directs etc. If I got spare time I only just go to twitter.com 🙂

LinkedIn
There’s also a plug-in for LinkedIn. This is not like TwInbox where you get the messages as mails or similar, but it integrates nicely in contacts and in for example mails showing the profile-pictures of those you’re connected to etc.

RSS Feeds
At the moment I’m subscribing to 218 RSS feeds. I thought it would be a great idea to get them inside Outlook, but found it to be not as good as Google Reader. The main problem was that although I marked a feed as read, it came with the same items over and over again. Pretty annoying. So, therefore I removed all subscriptions (don’t worry, I exported an OPML file from Google Reader) and right clicked the “RSS Feeds” folder, Properties, Home Page and there I put http://www.google.com/reader/ as the address. Now I can at least get Google Reader inside Outlook 🙂

5 minutes interview #23 – Børge Hansen (Microsoft)

Børge Hansen has been working as a developer on Microsoft technology since 1996. The last few years he’s been working as a technology adviser for Microsoft. He’s also been a speaker at several MSDN and NNUG events. He is also the speaker at our next NNUG and MTUG Haugesund meeting!

What have you worked on before you started in Microsoft?
I have previously worked in companies with in-house development for telecom and logistics solutions, as a general dev consultant and I have also been involved in several startups. Being able to work in different industries has led me into many different project types. I have done projects with GIS enabled data warehouses for analyzing mobile networks, I have tried to compete with Amazon.com with Bokkilden and created several types of data entry/reporting solutions. The last few years before I joined Microsoft worked with developing a new supply chain/ERP solution for health care sector. We were early adopters of DDD and TDD on the Microsoft platform. We wrote a complete platform for an ASP.Net 2.0 based MVP architecture. This is still one of my proudest moments. Especially now when I see that the rest of the industry has also taken on a focus on the established design patterns. Even today I would point to our framework as more productive than most of the frameworks out there. I would love to create a new open sourced version of this I could find the time.

What have you been working on in Microsoft?
I have been working in several roles. I started out as an Architect advisor, or evangelist as the Microsoft term is. Advising the big consulting companies and customers was a major part of my work. We also helped TV2 establish TV2 Sumo on a Silverlight based smooth streaming platform. Later on I have worked with SQL Server stuff, mostly working on problem solving for customers and helping with Oracle compete situations.  These days I am on my last few days as Product Manager for SQL Server and BizTalk. During this summer I will go back to the Architect role and shift my focus to new “early adopter” technologies and cloud development stuff.

What’s your favorite topic when it comes to being a speaker?
While I think of myself as a fairly competent techie or geek, I love mostly to speak of the soft skills of development projects. I believe these are the ones that make out great developers. You can be world’s greatest coder, but you only become a superhero if you master the soft skills. Building your skills and pride as an architect has been one of the favorite talks. I am in the board of IASA Norway and this is a recurring theme within that group.

Do you have any hobbies, except computer stuff?
Does family and home maintenance stuff count? He, he, seems that is all I can manage with these days.
But I do love the great outdoors. I go hunting/fishing for a couple of weeks every year. Often we go to locations without cellphone coverage with just a tent and a backpack. I love the feeling of being disconnected from the world a few days and only focus on being present in the wilderness. I also have a cabin in the mountains, just beside a lake. I try to get up there as often as I can. Either alone or with family and friends. This is a classic Norwegian style “hytte” with no electricity and water. It is back to basics. The really cool thing is that the kids love it as much as I do 🙂

Blog: http://www.borge3000.no
Twitter: @borge3000

Windows 7 Keyboard Shortcuts

Yes, I know. There are thousand posts out there with the same name, but for some reason many people haven’t seen them. Here’s a list of my favorite keyboard shortcuts in Windows 7:

Win + D – Show Desktop (minimize all windows)
Win + E – Open Computer
Win + L – Lock your computer
Win + P – Choose presentation display mode (computer only, duplicate etc)
Win + R – Open the Run dialog
Win + Space – “Aero Peak”
Win + Up – Maximize Window
Win + Left/Right – Dock the window to the left or right side of the screen
Win + Down – “Unmaximize” or minimize the window
Win + +/- – Zoom in/out
Ctrl + Shift + N – New folder

And then you’ve got a couple of shortcuts that are nice to know:
Ctrl + Shift + Esc – Open Task Manager
Win + Pause – System Properties (equal to right click computer, properties)

And then some which we’ve used for ages:
Ctrl + Esc – Equal to windows key (or clicking the start menu)
Alt + Tab – Cycle Through Windows
Alt + Shift + Tab – Cycle Through Windows, counter clock
Ctrl + Tab – Cycle through tabs in application.
Ctrl + Shift + Tab – Cycle through tabs in application, counter clock
Ctrl + C – Copy
Ctrl + X – Cut
Ctrl + V – Paste

For the complete list, visit this link: http://windows.microsoft.com/en-US/Windows7/Keyboard-shortcuts

Xbox 360 or PlayStation 3?

I have got this question several times. Probably because I can’t stop talking about Modern Warfare 2 and Bad Company 2 🙂 So, if you’re going to buy a gaming console, which one should you choose? My short answer is Xbox, and here’s my long answer:

There are actually very few differences between these two consoles. Most games are available on both, they both have media-center-alike stuff, and the graphics are more or less the same. So to be honest, it doesn’t really matter if you’re just thinking about these things. What about the price? Well comparing PS3 120GB with Xbox 360 Elite (120GB), there’s almost a 1000 NOK (about $160) difference between them! You can of course argue that it costs money to play online on Xbox, but one year is about 400 NOK (about $65), so you’ve got 2.5 years’ worth of online playing. And, let’s face it. You’re not going to be using it 2.5 years from now 🙂 By then there’s probably a new Xbox out (rumors says fall 2010) anyways. Jokes aside. There’s a new phone OS coming soon: Windows Phone 7. Microsoft has said that they will integrate with both the Zune software and Xbox LIVE, so if you’re going to buy a Windows Phone 7, you really want the complete experience. And, of course want to play against me, Jan Leon and the other Xbox LIVE junkies!

For the record, I have both. My PS3 won’t read disks, but I barely used it when it was working. I find the online “experience” on Xbox being MUCH better. One other thing I’ve noticed is that the Xbox-controller is much heavier than PS3 controls. Now, when playing PS3 at my brother’s house or similar, it feels like playing with paper. I’m afraid to rip it apart, but this is of course just something you’ll get used to. And the last thing I’ve noticed is that the Xbox makes much more noise than PS3.

To sum it up, you should buy Xbox because the online experience is better than PS3, the integration with Windows Phone 7 (and Zune), and because of the difference in price. Oh, btw, if you’re on a tight budget, you can buy Xbox Arcade with a 20GB (?) disk and some other minor differences.