Moving an SQlServer database from one machine to a new one with SQLServer 2016

I’ve just come to move to a new windows 10 development laptop and need to install a number of SQLServer databases that were on the old one (also windows 10 with various flavours of SQLServer). I have access to all of the .mdf and ldf files in a backup image.

I have restored these files and put them onto a data disk. However, when I came to attach them using SQL Management Studio (right click on databases and choose “Attach”), I was getting access denied errors. It turns out that all you need to do is give “Full Control” to the files “OWNER RIGHTS”.

Do this by selecting each file in turn, right click and choose properties. In the security tab, click “Edit”. Then click “Add”. Type “OWNER RIGHTS” in the box, click “Check Names” and click Ok. Make sure that “OWNER RIGHTS” is now selected in the top list and then check if “Full Control” is checked in the lower list. If it is not, click on the “Full Control” check box to select it.

Finally click OK on the two dialog boxes to dismiss them. You should now be able to attach the database

Replace Windows 10 Task Manager with the old Windows 7 one

If, like me, you often rely on task manager to diagnose system problems, you may find the new dumbed down task manager in windows 10 somewhat lacking. It’s particularly annoying that:

  1. It doesn’t have the old detailed network tab
  2. It doesn’t remember the column settings that you have added to the view

There is an excellent description of how to get the old one back here:
http://winaero.com/blog/get-classic-old-task-manager-in-windows-10/

I’ve tried this and immediately after running the installer, the task manage is replaced with the old one. Happy Days!

How to use VLC Media player to stream multicast video

When testing networks and routing, it is sometimes useful to be able to send a number of multicast streams across the network. VLC media player can do this, but getting it working is not as trivial as I expected. Here’s how to do it:

  1. In the Media menu, choose “Stream”
  2. In the Open Media dialog file tab, click “add” and choose the file you want to stream  and click “Open”
  3. At the bottom, click the “Stream” button
  4. This opens the “Stream Output” dialog showing the source file you have chosen. Click Next to set destination.
  5. In “Destinations”, choose “RTP /MPEG Transport Stream” and click the “Add” button
  6. In the “Address” box, enter the required multicast address (eg 239.255.0.1) and set the port (or leave default at 5004)
  7. In transcoding options, choose the appropriate settings for your video and PC’s codecs. I chose “Video H.264 + MP3 (MP4)”. I had to set the options by clicking the options (screwdriver and spanner) button immediately to the right of the dropdown. In encapsulation, I chose MPEG-TS. In video codec, I set the bitrate to 4000kb/s
  8. Once the options are set, click “Save”. Then click Next for “Option Setup” and select “Stream all elementary streams” then click stream.

To view the stream, open another instance of VLC media player (try it on the same PC before trying it over the network)

  1. Choose Media/Open Network Stream
  2. In address, enter rtp://@239.255.0.1:5004 – choose the correct address and port you entered when setting up the stream. Don’t forget to enter the “@” symbol after “rtp://” and before the multicast ip address!
  3. Click “Play”

If you want to stream multiple videos, remember to choose an different multicast address and/or port

Blurb Publishing – Part 3 – Make a PDF from your book’s Cover and Upload the Book.

Background

This is part 3 of a series of posts on publishing a book on Blurb via “PDF to Book” using relatively cheap software on Windows.

The first part describes the trials and tribulations I had with Blurb’s standard software and why I had to use the “PDF to Book” approach.

The second part describes how to prepare your book’s internal pages in a suitable PDF file for uploading.

Work Out the Cover Size

Once you’ve produced the book’s contents as a PDF and you know how many pages it contains, you can produce your Cover PDF. To do this we need to go back to the Blurb web site again and revisit the book specifications pages. Log in and choose “PDF to Book” from the Apps Menu. On that page is a big orange button labelled “Get Specs”. Click it and choose the format size of your book. As I stated in Part 1 I have chosen the “Pocket 8*5 inches” size. Then click on the “Specifications” tab below. Choose your cover type, the paper type and Unit of measure (use inches or centimetres). This time, enter the actual number of pages in your book PDF and Click “Get Measurements”. Record the following values from the lower “Cover Specifications” items:

  1. Final, exported PDF/X3 should measure (w x h)
  2. Gutter/Spine (w x h)

Note that the document we are producing contains the whole of the cover, ie the back, the spine and the front. This will “Wrap around” your books pages. You can consider it as three columns: the back cover on the left, the (relatively thin) spine in the middle and the front cover on the right. Note that the spine size depends on the number of pages, so the exact width of the cover will vary slightly depending on how many pages you have in your book.

Create a Custom Paper Size

Now create a custom paper size on your PC which is exactly the same size as your book cover shown in the “Cover Specifications” list item 1. above.  :

  1. Go into Control Panel/System and Security and open “Administrative Tools”. Choose “Print Management”. This Opens the “Print Management” dialog
  2. Open up “Print Servers” in the left tree and select “Forms”. This lists all the known paper sizes.
  3. In the very right pane, expand “Forms” and choose “More Actions” Below. Select “Manage Forms…” to pop up the “Print Server Properties” dialog
  4. Select the “Create a new Form” checkbox and type the name of your new Page Size. I recommend something like “BlurbPocketCoverXXXPages”, where XXX is the number of pages actually in your book. Eg “BlurbPocketCover172Pages”
  5. Enter the size in the “Form description (measurements)” area below.  Use the units you prefer. Only the width and height need to be entered – all the margins should be zero.
  6. Click the “Save Form” button.

Create the Cover Document in Word

We now need to create the single page document in Word that will be your book cover.

  1. In Word, create a new document
  2. Open the “Print” dialog and choose the “Easy PDF Printer 6” printer. This causes your new custom page size to be loaded into Word.
  3. Go into the “Page Layout” tab in Word, where you will see the button for “Size”
  4. Click the “Size” button and choose “More Paper Sizes…” In the “Paper Size” drop-down, choose your new “BlurbPocketCoverXXXPages” size (or whatever you called it). Click OK
  5. Save this Cover document with a sensible filename.

How you create and format this document is up to you. It is not easy to do the Spine Text in Word. It is much easier to use a Graphics Editing program to create a Graphic of the correct size. It’s easy to do it in Paint. If you have a favourite graphics program use that instead.

Creating an All in One Cover Graphic in Paint

Firstly, to size the image, you need to decide on a resolution eg 600 pixels per inch. If your PC can’t cope with this resolution, try reducing it to 300 pixels per inch. Work out how many pixels the graphic size is, based on value 1 in the “Cover Specifications” list above. For example, if your cover page is 10.681 x 8.25 inches, at 300 pixels per inch, you will need an image size of 600*10.681 by 600*8.25 = 6408 by 4950 pixels. Then work out the size of the spine based on value 2 in the “Cover Specifications” list. For example, if the spine is 0.431 x 8.25 inches, it will be 0.431 * 600 by 8.25 * 600 = 258 by 4950 pixels.

Create the Spine Text Image

First we will create the spine image. Assuming that you want text to read from top to bottom, it is easiest to create this image in landscape format then rotate it. Open Paint and create a new image. Choose File/Properties and set the units to pixels. Set the width to be the bigger of the spine dimensions and the height the smaller. Click OK, and you should get a short, wide image. Use View/Zoom to get a good view. Now click on the text tool and place the required text, using the font and size of your choice. Usually the title will be at the left and the Author’s name will be at the right hand side. When you are happy, choose “Rotate” on the home ribbon and rotate right 90 degrees. Save the file as a JPEG with a sensible filename.

Create the Full Cover Image

Now create the main cover image. Choose File New. In File/Properties,  set the units to pixels and set the width and height to the numbers you calculated above for the size of the whole cover. Click OK. Choose the View tab and zoom out to a sensible size. Remember the back cover is on the left half and the front cover is on the right, with the spine in between. You probably need to paste images into this new image, so go ahead.  Place any required text too.

Insert the Spine Image

Finally, we need to load the spine image back in. The position of the left edge of the spine is:

Half the cover image width - half the spine width

so for my graphic, the left edge goes at pixel position (6408/2) – (258/2) = 3204-129 = 3075, and the top left corner is at position “3075, 0”

In Paint, zoom right into the image so that you can easily move one pixel at a time (look at the  numbers in the status bar). Choose the Pencil Tool, and colour red. We want to place a red dot at the top left position of where the spine goes. For my image, this will be at pixel position 3075, 0. Once you have placed this dot, choose “Paste From” (drop down under the paste button). Select the Spine graphic that you created and saved earlier. Choose OK. This places the spine on the image and selects it. Drag it to the right until you can see the red dot you just placed. Now place the spine image exactly so that the top right pixel exactly covers the red dot you drew. The spine is now in the correct place. Zoom out to check, then save your completed cover. Then choose “Select All” and “Copy” in the Home ribbon.

Insert the Cover Image into your Word Cover Document

Once you have the graphic, either paste the graphic into Word or use “Insert Picture”. To resize the graphic in Word beyond the margins, choose “Text Wrapping” and choose”Behind Text”. You will be able to move and resize the graphic so that it covers the entire page.

Now re-open your cover document in Word. Paste your cover image into it. Right click on the image and choose “Text Wrapping” and select “Behind Text”. You will now be able to resize the image so that it covers the entire page. Only drag the corners to resize so that the aspect ratio is maintained. When the image fits exactly, you have your cover. Save it.

Create the Cover PDF

We can now print out our cover to PDF.

  1. From Word, choose the “Print…” menu item (not the default print button) to pop up the Printer dialog
  2. Choose “Easy PDFPrinter 6” in the drop-down listing the available printers. Click “Properties” to the right to pop up the “Easy PDFPrinter 6 Document Properties” dialog
  3. In the “Layout” tab choose “Landscape” for “Orientation”
  4. In the “Font and Image” tab deselect the “Downsize Image” checkbox
  5. In the “Standards” tab, select “PDF/X-3:2002” in the PDF/X conformance box
  6. Click OK to close the properties dialog and return to the Print dialog. Click OK to begin the print process
  7. The “Save PDF Output Filename” dialog will appear (or may be flashing in the task bar at the bottom of the screen). Enter the filename to save and click OK
  8. Once the PDF has been generated, it will open in your PDF reader. Choose File/Properties to ensure the paper page size is correct.

Upload Your Book

We have now finally got everything we need for Blurb, so we can upload it.

  1. Log into Blurb, and Choose Apps/”PDF to Book”
  2. Choose the “Upload PDFs” button
  3. Choose the correct paper size, number of pages, print type and cover options and click continue
  4. Enter the Title, Subtitle (optional), Author’s name, search tags (optional), category and description (optional). Choose private to start with, then click next
  5. Click the “Start Uploader” button
  6. You may get some Java warnings – I suggest you install anything required and choose “always run on this page”
  7. The file select dialog opens. Select you cover PDF and click OK. It should upload. If you get any size errors here, recheck your document size calculations and redo.
  8. Once the upload completes, click “Upload Pages PDF”
  9. Once this upload completes, Blurb will check your files offline and email you with the results. It will take a while, so reward yourself with a well earned beverage.

*********

Preview Your Book

Hopefully all the preflight checks have now passed.

If so, click on the link back to Blurb in the email that you receive. You should see your book! Click on it to get through to the detail page, then click on the preview tab below. Select “Show all the pages” in “Book Preview Settings” and click “Save Changes”. You can then click on “Preview Book” on your book cover to see how your work will look.

Finalise and Order

You’ll probably go round this path a couple of times before you are happy. When you are, remember to make your book public. You will also probably want to reduce the number of pages in the preview. Then  order some copies!

 

Blurb Publishing – Part 2 – Make a PDF from your book’s internal pages.

Background

This is the second part of a series of posts describing how to cheaply use the “PDF to Book” feature of Blurb from Windows. This part describes how to make a PDF of the inside pages of your book. Part 1 described why you would need to use this advanced method. Part 3 describes how to produce the cover and upload everything.

First of all, now would be a good time to make sure you have a good backup or two of your book files!

Installing the PDF Printer

Download and install the Easy PDF Creator 6 printer driver from http://www.pdfonline.com/easypdf/pdf-printer/ Start off with the free trial, but you will have to buy it for $29.99 before you create a real book as the trial adds extra graphics your PDF pages.**

Page Size

Now we need to work out exactly what page size to use.  To find this out, you need to go to Blurb, log in and choose “PDF to Book” from the Apps Menu. On that page is a big orange button labelled “Get Specs”. Click it and choose the format size of your book. As I stated in Part 1 I have chosen the “Pocket 8*5 inches” size. Then click on the “Specifications” tab below. Choose your cover type, the paper type and Unit of measure (use inches or centimetres). You leave the number of pages as the default – that’s only important for the working out the size of the cover. Click “Get Measurements” and write down the following values from the top “Page Specifications” items:

  1. The value of “Final, exported PDF/X3 should measure (w x h)”
  2. The value of “Bleed”
  3. The value of “Inset for Margins (Top, Bottom, Outside edge)”
  4. The value of “Inset for Margins (Binding edge)”

Keep this “Page Size List” handy – we’ll refer to it during the rest of this process.

Custom Paper Size

We now create a custom paper size on your PC which is exactly the same size as your book pages. This is the size you wrote down in the top item 1. of the “Page Size List” above. For the pocket size book, this is 5.25 inches by 8.25 inches (Note: I usually use metric measurements but I found it easier to do the paper size in English units):

  1. Go into Control Panel/System and Security and open “Administrative Tools”. Choose “Print Management”. This Opens the “Print Management” dialog
  2. Open up “Print Servers” in the left tree and select “Forms”. This lists all the known paper sizes.
  3. In the very right pane, expand “Forms” and choose “More Actions” Below. Select “Manage Forms…” to pop up the “Print Server Properties” dialog
  4. Select the “Create a new Form” checkbox and type the name of your new Page Size. I recommend something like “BlurbPocketPage”
  5. Enter the size in the “Form description (measurements)” area below.  Use the units you prefer. Only the width and height need to be entered – all the margins should be zero.
  6. Click the “Save Form” button.

Word Page Size

We now set the page size in Word for the book format that you are going to use.

  1. Open your book document in Word. First of all, open the “Print” dialog and choose the “PDF Creator” printer. This causes your custom page size to be loaded into Word.
  2. Now go into the “Page Layout” tab in Word, where you will see the buttons for “Size” and “Margins”
  3. Click the “Size” button and choose “More Paper Sizes…” In the “Paper Size” drop-down, choose your new “BlurbPocketPage” size (or whatever you called it). Click OK

Word Margins

We now need to set the document margins. Again we refer to the “Page Size List” which we wrote out above:

  1. Click “Margins” and select “Custom Margins…”. This takes you into the “Page Setup” dialog.
  2. Your left, right, top and bottom margin need to be at least the values of 2 + 3 in the “Page Size List” above, but I have used the value 1.5 cm. Left and Right Margins must be the same
  3. The “Gutter Margin” plus “Left/Right Margin” needs to be at least the value of item 4. in the “Page Size List” above. I used 1.25 cm for my Gutter Margin.
  4. Still on the margins tab, in the “Pages” section, choose “Mirror Margins” in the “Multiple Pages” drop-down (this adds the binding margin to alternate odd and even pages).
  5. In the “Layout” tab, select “Different Odd and Even” in the “Headers” page.

Complete the Pages Document

Now complete formatting your document with these new page size settings. Don’t worry about getting this all spot on first time. You will probably try an upload, see what it looks like and come back and tweak it a little.

Produce the PDF

Once you are ready to try an upload to Blurb, you need to print out your document as a PDF.

  1. From Word, choose the “Print…” menu item (not the default print button) to pop up the Printer dialog
  2. Choose “Easy PDFPrinter 6” in the drop-down listing the available printers. Click “Properties” to the right to pop up the “Easy PDFPrinter 6 Document Properties” dialog
  3. In the “Layout” tab choose “Portrait” for “Orientation”
  4. In the “Font and Image” tab deselect the “Downsize Image” checkbox
  5. In the “Standards” tab, select “PDF/X-3:2002” in the PDF/X conformance box
  6. Click OK to close the properties dialog and return to the Print dialog. Click OK to begin the print process
  7. The “Save PDF Output Filename” dialog will appear (or may be flashing in the task bar at the bottom of the screen). Enter the filename to save and click OK
  8. Once the PDF has been generated, it will open in your PDF reader. Choose File/Properties to ensure the paper page size is correct.

Now you have your document pages in the correct form of PDF. Give it a good check through. It’s worth at least being sure that there are no blank pages and all the images and tables are present, as you will have to redo the cover if the number  of pages changes.

Once you are happy enough to go to the next stage check how many pages there are in the PDF file. You will need to know this figure to Produce the Cover in part 3

Notes

**Note I have no affiliation with this software and you can use the trial version for testing conversion and Blurb upload before you buy. If you work out how to do the cover using a free product then please let me know. The requirements are that it has to produce a PDF/X-3:2002 compatible document. I had most success with PDF Creator from pdfforge, but ultimately gave up with this. The book’s content PDF was fine but all attempts failed when trying to get it to produce a landscape PDF on a custom paper size for the book cover. Apparently this is a known issue with the underlying Ghost Script engine that isn’t currently being fixed. The associated PDF Architect Software that comes with it can rotate the produced PDF to landscape but unfortunately breaks the PDF/X-3:2002 compatibility in the process.

Blurb Publishing – Part 1 – Initial Troubles.

Background

Blurb is a useful tool to enable you to self publish a book. However, it originates from publishing picture books and not text based novels and the like. My wife Juliet is currently publishing her own book and I have agreed to help her with the technical aspects of actually publishing it. I have initially chosen Blurb, at least for the first few copies.

Word Plugin and Bookify

Blurb has a nice Word plugin which enables you to set your book size. You can format the pages using normal Word operations, then preview your book at any time. When you are happy, you then upload your book into the “Bookify” web interface. This is quite nice, except for one glaring issue: if the miserly choice of 3 cover templates don’t include the one you want, you’re stuffed. Juliet has had a full cover picture designed for her book which looks great. This picture includes the title and Author’s name as part of the design. Unfortunately, Blurb only has templates with a picture taking up some of the space and writing either above or below. If you don’t want the writing, you can’t make the picture occupy the full space. I contacted support, and unfortunately this is just the way it is.

BookSmart

I then tried the “BookSmart” tool. This enabled me to design exactly the cover I wanted, so I thought this slightly more complex method would be the way forward. However, whilst it’s great for designing covers, it’s rubbish for formatting a book. All the first line indents went, and the only way you can get them back is to insert spaces at the start of each paragraph. Worse still, the all the tables simply disappeared. Once the book was in this format, it would have to stay in this format and there was no way I was going to inflict this method for future editing on Juliet.

So we were left with either a perfect internal format with a very poor cover, or a lovely cover with badly formatted contents. Which would I choose? Neither obviously.

PDF to Book

The final choice is to use “PDF to Book”. Making PDFs is pretty easy – you can save as PDF directly from Word, or print through a free printer driver such as CutePDF.

However, Blurb requires a very specific type of PDF. It has to be PDF/X-3:2002 compliant. Blurb’s recommended way of doing this is to use Adobe InDesign, for which templates are provided. The downsides are it’s £400+ and by all reports difficult to use unless you use it regularly and sit at a Mac all day. Adobe Distiller is also mentioned but  that would involve tossing £450 to Adobe too. Let’s be frank – my publishing budget does not include nearly half a grand for Adobe software that I really don’t want.

Easy PDF Creator 6

The good news is I finally worked out how to do this without breaking the bank. I tried a lot of free PDF creation software and almost managed to do the whole job for free using PDF Creator, but in the end it has a fatal flaw that means it can’t produce a landscape PDF on a custom paper size (a requirement for the blurb cover). Therefore I ended up buying Easy PDF Printer 6 from BCL Technologies for $29.99** Read Part 2 to learn how to do the contents* and Part 3 on how to do the Cover*.

Notes

*These posts assume that you already have the contents of your book as a Word Document  in principal, it should work with something like Open Office too). It’s important to have put some thought into what size of book you want and understand the pricing implications of the that size along with the type of cover and colour choices. Note that you still get a colour cover with a black and white book. We have chosen “Pocket 5*8 inches with soft cover and black and white printing”, which, along with “Trade 6*9 inches” are the only formats you are going to be able to use for a text book or novel that is cheap enough for you to be able to make any money from. In the UK, for 172 pages, this costs £5.95 per copy before any volume or coupon discounts.

**Note I have no affiliation with this software and you can use the trial version for testing conversion and Blurb upload before you buy. If you work out how to do the cover using a free product then please let me know. The requirements are that it has to produce a PDF/X-3:2002 compatible document. I had most success with PDF Creator from pdfforge, but ultimately gave up with this. The book’s content PDF was fine but all attempts failed when trying to get it to produce a landscape PDF on a custom paper size for the book cover. Apparently this is a known issue with the underlying Ghost Script engine that isn’t currently being fixed. The associated PDF Architect Software that comes with it can rotate the produced PDF to landscape but unfortunately breaks the PDF/X-3:2002 compatibility in the process.

How to Copy a Large Table from one SQL Server Instance to Another

Today I had a table in one database instance that I needed to copy into another.

I knew I could use “INSERT INTO SELECT ….” for a database in the same instance, but that it wouldn’t “just work” for a database in another instance.

First I tried generating scripts via Sql Server Management Studio 2008’s Tasks/Generate Scripts command including the Schema and the Data.

The script file was over 5 gigabytes and couldn’t be loaded. I tried splitting it up into 1Gb chunks using Hex Editor Neo (a great tool I found today that can happily open and work on really big files), but the scripts still couldn’t be loaded in Sql Server Management Studio .

I started Googling around a bit and found that I could use the “Linked Servers” feature. This is located under the “Server Objects” item under the Server Connection’s root in Sql Server Management Studio. I was simply connecting from one instance to another on the same machine, but it was tricky to get the permissions right. I was connecting from one instance with SQL Server authentication to another using Windows Authentication.

I created a “New Linked Server” in “Linked Servers”. The settings I found that I needed were:

  • under the “General” settings, the “Linked Server” needs to be HOSTNAME\INSTANCENAME
  • Server type is “SQL Server”
  • under the “Security” settings, you need to select the local login name as HOSTNAME\USERNAME and select the “Impersonate” check box
  • Under “For a login not defined in the list above, connections will:” select “Be made using the login’s current security context”

That was it, but as the error messages were particularly unhelpful, it is worth having this checklist.

Once you’ve got the linked server, to copy the data just execute:

SELECT * INTO [dbo].[NEWTABLENAME]
FROM [HOSTNAME\INSTANCENAME].[DATABASENAME].[dbo].[TABLENAME]

Where HOSTNAME\INSTANCENAME is exactly what you entered as the “Linked Server”.

When you run this, it will run in a bulk mode and is surprisingly quick. The data that was represented in my 5GB script was copied over in a few minutes. Job Done.

How to De-Brick a Netgear WNR2200 Router

There are various reasons for installing new firmware on an old router that you may have lying around.  One is that you want to enable new functionality that isn’t supported in the default manufacturer’s firmware.

Picture of WNR2200

A popular project that supplies advanced firmware for household routers is dd-wrt. I had successfully installed this software on my router, but still wanted to add some additional functionality. I experimented with the firmware-mod-kit (see this page for info) and added a package to the distribution. I installed this new firmware on my WNR2200, but unfortunately it rendered my router unbootable. It just rebooted itself over and over again every ten seconds or so. No connectivity to it was possible at all. It really was “bricked” (ie had the same functionality as a house brick).

I tried various ways of trying to regain some control. There are various instructions on how to do a “30/30/30 reset” such as here. However, I couldn’t get the connectivity I required.

Finally I realised that after a single 30 second reset (ie holding the hard reset button that you need a pin to access for 30 seconds), you could access the router via TFTP on the default IP address (192.168.1.1). However, I was using the standard windows 7 TFTP client and the firmware transfer kept getting interrupted part way through.

In my search to find a solution for this, I came across another TFTP client here. Fortunately the first line on that page “The standard TFTP command-line utility does not support some very important features like blocksize option” caught my attention. I downloaded the “WinAgents TFTP Client” from the download page and gave it a try. This is a single .exe file that you can put in any folder and run from the command line. I put my firmware file and the tftp.exe file in the same folder, opened a command prompt and navigated to the folder containing tftp.exe and my default firmware.

I tried increasing the block size from the default 512 bytes to 8192 bytes and the timeout to 255 seconds for good measure. To my very pleasant surprise, this sorted out the problem and the old working dd-wrt firmware was successfully uploaded. My command was:

 tftp.exe -i -v -b8192 -t255 192.168.1.1 PUT wnr2200-factory_WW.img

Note: (Thanks to Ronald’s Comment below) – You need to start the TFTP transfer within seconds after powering on the router

As soon as it completes the upload, the router automatically installs it and reboots, so give it plenty of time to do this (up to 5 minutes).

I promise you that you will be very happy if you are able to log into your router again!

There is no editor available for script.sql?

I had a bizarre error this morning. The good news is that it had a simple solution in the end…

I have been editing a script file to install a default version of a database for a software product. I exported the database schema, data and indexes using SQL Management Studio and edited the resulting script file in TextPad.

I saved the file, but when I tried to test it in Sql Management Studio, it gave me the error message “There is no editor available for script.sql”. Eh?

I checked in explorer, and the “script.sql” file did indeed have the database script icon next to it. Just to be sure, I right clicked on it, chose “open with” and set the default program to “Sql Management Studio”. Sql Management Studio opened ad I still got “There is no editor available for script.sql”. Eh? Eh?

After much head scratching, tearing out of remaining hair and a bit of  Googling, I came up with the answer:  The file was saved in UNICODE rather than ANSI format.

I reopened the file in TextPad, chose “Save As”, chose “ANSI” for Encoding and overwrote the file. Sorted. Sql Management Studio was now happy with the file.

Going through the export process again, I now realise that there is a choice between Unicode and ANSI in the export. And guess what – Unicode is the default, ie “work=no”.

You’d at least have thought that the error message in this situation would be a bit better, given the Unicode default. A slightly more intelligent error message would have prevented a lot of wasted time.  Note quite up there with “Keyboard not detected – press F1 to continue”, but still…

Where have my network icons gone in Windows 7?

If you have multiple network adapters or you frequently do a lot of network setting changes, you may pine for the nice little network status icons that were in windows XP. Today I’ve been reconfiguring a bunch of CCTV transmitters that involved rolling back firmware in the devices. Every time you do this, they reset to their default IP address. Needless to say, this is on a completely different subnet to the one they were configured on, and it’s also different to the one I need to change them to.

I’ve lost count of the number of times I’ve changed the IP address on one of my network cards today. Anyway, partly through the job I got sick of the long winded, dumbed down method in windows 7 and installed a little bit of freware called “Gab Net Stats“. This gives you a network status icon which gives you instant access to the network configuration for any of your connected network adapters.

It’s only one icon for every network adapter, rather than one per adapter as in XP, but it’s still a lot quicker and easier to get to your netwok configuration than the standard windows 7 method. It will only be useful for fewer than 0.1% of windows users, but I’m keeping it!