Friday, May 08, 2009

How to restore a SQL Server database marked as "suspect"

You've probably got to this page because you received the following error message:
Server: Msg 926, Level 14, State 1, Line 1
Database 'DatabaseName' cannot be opened. It has been marked SUSPECT by recovery. See the SQL Server errorlog for more information.
A database can be ma
rked suspect for one of the following reasons:
  • If one or more database files are not available.
  • If the entire database is not available.
  • If one or more database files are corrupted.
  • If a database resource is being held by the operating system.
Luckily, there are a couple of ways to fix this problem.

FIX 1You can use the sp_resetstatus stored procedure
sp_resetstatus 'DatabaseName'

FIX 2: You cna correct the database status manually
SP_CONFIGURE 'ALLOW UPDATES', 1
GO
RECONFIGURE WITH OVERRIDE
GO

UPDATE sysdatabases SET status = status & ~256 WHERE name = 'DatabaseName'
GO

SP_CONFIGURE 'ALLOW UPDATES', 0
GO
RECONFIGURE WITH OVERRIDE
GO



Tuesday, November 11, 2008

"Could not launch Fireworks" Error Fix

This error was driving me insane and it took me over a week to find the solution on the web so I thought I'd post it here for future reference - and perhaps it will help others with the same problem.


Product affected: Fireworks 8
Error messages: Could not launch Fireworks. An internal error occurred

Possible solutions...
  • Repair the Fireworks installation (install over it)
  • A fresh installation - ie.: completelly unistall Fireworks then install it again
  • Disable plugins (C:\Program Files\Macromedia\Fireworks 8\Plug-Ins\)
If none of those things have worked for you (or if you can't be bothered to try doing things the proper way), try this:
  • Open Windows Explorer
  • Go to C:\Program Files\QuickTime
  • Rename folder "QTSystem" to "QTSystem-OLD"
The problem is that for some crazy reason, Quicktime/iTunes interferre with Fireworks installation. Renaming that folder doesn't stop you using Quicktime, but it disables some of its over-the-top self-updating features - which you don't need.

Better still, you could completely uninstall Quicktime and download a lighter, faster, no-nonsense alternative, the excellent QT Lite.

Thursday, October 16, 2008

Fix for Windows XP Error: The user has not been granted the requested logon type at this computer

So you have 2 computers on a network and when you tried to access the shared folders/files in one of them you receive the following message:

The user has not been granted the requested logon type at this computer
Well, here is your fix:

1. Download Windows Server 2003 Resource Kit Tools from this link.

2. Install the program

3. Go to: Start, All Programs, Windows Resource Kit Tools, Command Shell

4. Type the following commands (PS: case sensitive, press enter after each line)
net user guest /active:yes
ntrights +r SeNetworkLogonRight -u Guest
ntrights -r SeDenyNetworkLogonRight -u Guest
5. Job done, now go make yourself a cuppa!

This solution applies to Windows XP Professional and Windows XP Home - I don't know about the rest but it's worth a try...

Last but not least, here's the boring DISCLAIMER: It's your problem if you mess things up. Don't download anything or follow any of the suggestions on this article unless you know what you're doing and accept full responsibility for your actions.

Tuesday, September 30, 2008

jQuery Multiple File Upload Plugin v1.3

Current version: 1.3
Release date: 30th September 2008



Monday, September 22, 2008

Limit decimal places of MSSQL Money DataType

So you want to store currency values in MSSQL but you keep getting rounding errors because the money datatype uses 4 decimal places? Not to worry! You can limit this to 2 decimal places! And here's how...


Use the data type Numeric(19,2) instead of Money - which is the equivalent of Numeric(19,4). Let's not forget that the Money data type is obsolete so Numeric is the best practice solution anyway.


To make things even easier, you can create a UserDataType for the above so you only have to remember a name - whatever you decide to call it.