Dump SQL Server database to INSERT statement script

March 20, 2007

For a long time I’ve wanted a tool to produce ‘MySQL-type’ scripts (backup) for SQL Server – i.e. a text file with all data written as INSERT INTO statements.

I don’t really like the backup function in Enterprise Manager/SQL Studio because it stores all data as a large binary file, and it seems like overkill sometimes. With a text file of INSERT statements I feel more in control, and as a bonus you don’t need special privileges for the DB login (except for being able to read the data/meta-data).

Here is a tool that can do this – released by Microsoft  (on CodePlex)

SQL Server Hosting Toolkit / Database Publishing Wizard

The tool is really meant for generating a script for use with Hosted Servers – but I primarily use it for backups. It is also integrated with Visual Studio.

Advertisements

Windows Mobile 6

February 13, 2007

As you probably know Windows Mobile 6 has been announced, along with a new SDK. The SDK doesn’t seem to be available yet, but according to the What’s New for Developers Guide, you can use the new emulator with WM 5.0 development.

WM6 is also fully backwards-compatible (it uses Compact Framework 2.0 SP1) so any WM5 app that doesn’t use a lot of esoteric code will run just fine as it is on WM6.

edit: Turns out they dropped the .0 from the version, so while it is Windows Mobile 5.0, the new version is just Windows Mobile 6…


Installing SQL Server Compact Edition Tools for Visual Studio

February 1, 2007

Looks like there is some sort of bug with the install program for the Visual Studio Tools.  The error message says that some required component is missing, or that there is an version conflict. There is a fix for this posted at the MSDN Forums by Ginny Caughey, I’ll repeat it here:

Install sqlmobile30devtoolsenu.msi from the Visual Studio install media, located in the folder: \vs\wcu\SQLCE first. Then the CE tools will install.

I had this problem, and it was probably because I uninstalled the SQL Server Mobile Edition tools first. This seems to be a bug from Microsoft in that it requires the previous version of the database or that the uninstaller simply uninstalls too much.

The reason I uninstalled the Mobile Editon tools was because it showed up in the datasource list in Visual Studio. After installing the .msi file above, and installing the CE Tools – everything looks right in Visual Studio finally. 


SQL Server Compact Edition

January 31, 2007

Be sure to download SQL Server Compact Edition quick, before it changes its name again… 🙂

(ps. I recomend downloading both the run-time and the SDK from the download page. The SDK doesn’t put the DLLs in the default directory of C:\%Program Files%\Microsoft SQL Server Compact Edition\v3.1\ referenced in the docs)

Update: SQL Server Express Studio doesn’t currently support SSCE – but it will with Service Pack 2. You can get the CTP of it here.


Data import / export with SQL Server Express using DTS Wizard

January 31, 2007

There are IMHO two major annoyances with SQL Server Express :
 – No Server Agent
 – No Import / Export function (called Data Transformation Services – DTS in SQL Server 2000)
 
Missing the Server Agent means you have to make your own backup (or other) scheduling, but luckily DTS is possible – it is just not installed as default with SQL Server Express (SSE). It’s very strange to me why Microsoft did not just include in the standard install so that it was available from SQL Server Studio, but I’ll settle for just being happy that it exists at all!

Check if you already have it by looking for this file: c:\%programfiles%\Microsoft SQL Server\90\DTS\Binn\dtswizard.exe. If you don’t have a ‘DTS’ directory (or even a ’90’ directory) it has not been installed.

Here is how you get it:
 – It is included in the SQL Server Express Edition Toolkit – and only that. It you have installed another version of SSE, it works fine to install this package afterwards without uninstalling the others. Get it here: http://go.microsoft.com/fwlink/?LinkId=65111
– The DTS Wizard is included in the option “Business Intelligence Development Studio” so be sure to select that for install 
– If you have installed another version of SSE, the installer might report that there is nothing to install. Override this by checking the checkbox that displays the version number (in the installer wizard)

After install has finished, the DTS Wizard is available at c:\<programfiles>\Microsoft SQL Server\90\DTS\Binn\dtswizard.exe
you might want to make a shortcut, or even include it on the tools menu of SQL Studio.


ActiveSync and Comodo Firewall

November 15, 2006

I recently installed the Comodo Firewall since my old one Sygate FW has become obsolete, and although it seems quite nice and powerful there are some issues with it. One problem is that it often give false warnings about ‘parents’ (a program that launches another program), e.g. claiming that notepad tries to start Internet Explorer, when I have done it myself (this was a problem with Sygate too, but it actually seems worse here).

The other problem is that it seems to block quite a few things silently – for instance ActiveSync. To get it to work I had to turn off the whole thing, which might be a bad idea if you are not behind a hardware firewall. Seems like it blocks the mobile device from getting an automatic IP or somesuch. You have to make a custom rule to get it to work. I suggest you change this rule a little to allow a IP range instead of just the one IP just in case.  I’ll repeat the walkthrough by Egemen here in case the URL goes missing:

( in Comodo: )
1- Go to “Security->Nework Montitor”,
2- Right click on the first rule(Rule Id = 0)
3- Select Add Rule->Add Before
4-  Action “Allow”, Protocol “TCP”, Direction “In”
5- Source IP : “Single IP” = “169.254.2.1”,
6- Remote IP : “Any”
6- Source Port : “Any”
8- Remote Port : “Any”
9- Click Ok button.

My alternative is to change step 5 so that you get 101 available IPs:
5-Source IP : “IP Range” = “169.254.2.0”  to “169.254.2.100”

Thanks to this I at least learned that there are more reserved IP ranges than the 192.168.x.x range, and that the 192.254.0.0 to 192.255.255.255 is reserved for “Automatic Private IP Addressing” – making this rule quite safe to install.

(To be fair there are some things that I really like with Comodo, for instance that you can disallow certain URL or IPs for each program, so that you can allow a program to access the Internet, but you can disallow it from calling home by banning the home IP only.)


Reinstalling Compact Framework 2.0

November 13, 2006

I recently did a hard reset on my device, but had problems installing CF2 because the installer complained that I already had installed it. (This seems like a bug to me – what if I had two Windows Mobile devices?)

Anyway, I didn’t want to uninstall then reinstall CF2 as suggested by the installer because I was afraid that it would mess up my settings and paths in Visual Studio.

To manually install CF2 just follow the instructions as for setting up the emulator – i.e. install the file NETCFv2.wm.armv4i.cab.