Archive for April, 2009

Copying tables across databases

So, you’ve got a requirement to move or copy a table from one database to the other? Including data?

Use SELECT INTO.

For example, we have a database called “MyDatabase”
We also have another database – “MyNewDatabase”

MyDatabase contains the table “Customers” – with a bunch of data that we want to preserve.

You need to move this into MyNewDatabase?

Here is an example of the query:
[sql]SELECT * INTO MyNewDatabase.dbo.Customers
FROM MyDatabase.dbo.Customers[/sql]
You could of course predicate your query, include where clauses, select only a few columns etc.

Check out this post on W3Schools for more information, and how to use this in the same database (for temp. backups for example)

Windows Azure – Firefox & “Port Restricted for Security Reasons”

I’ve been starting to delve into the world of Windows Azure this week.

After getting the Azure Samples loaded, I tried running one of them (just by hitting F5 in VS) and, as Firefox is my default browser, got a “Port Restricted For Security Reasons” error.

Of course, it worked fine in IE

Here is what to do –

It turns out, that my application was trying to use port 87 on 127.0.0.1 (127.0.0.1:87)

Load up Firefox. Type about:config in the address bar, and hit enter. You will get something like the following:

image

Right click, and click New -> String.

Set the preference name to: network.security.ports.banned.override

Next, set the value to: 87 (or whatever port your app is using)

Done!

Fonts invisible in Adobe Illustrator CS2

image As you can see from this screenshot, my fonts list has vanished…

This was the first time I’d installed Illustrator CS2 on Vista – it turns out that CS2 does not support OpenType fonts.

It seems the only solution is to upgrade :-(

Fix for Mail Enable – %1 is not a valid Win32 application.

As mentioned in a previous post, I am in the middle of changing my hosting, from a reseller account, to my own VPS.

After working closely with eHosting support, I’ve managed to beat into submission the large majority of the features required.
One thing however, was the installation of MailEnable Standard (the free one)
It didn’t come with any form of web mail client.

Some emailing, and googling later, I discovered the latest version of MailEnable standard (v 3.6)  includes webmail

After installing this on my VPS, and trying it out on a test domain, it threw an error in the web browser:

%1 is not a valid Win32 application.

This caused me quite a lot of trouble to figure out, but the solution – ASP.Net needed re-registering with IIS.
(I had recently installed .net 3.5 – not sure if this had anyrthing to do with it)
To do this, click Start, Run, then type "CMD"

At the command prompt, type (or cut paste, like most people)

C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i -enable

Hit enter.

That fixed it for me, hopefully it will for anyone else.