Wednesday, November 16, 2011

Quickly disable triggers and keys

/* run before importing data */
-- SQL disable all triggers - disable all triggers sql server - t sql disable trigger
EXEC sp_MSforeachtable @command1="ALTER TABLE ? DISABLE TRIGGER ALL"
-- SQL disable all constraints - disable all constraints sql server
/* deletes all existing data */
-- SQL disable all constraints - disable all constraints sql server
EXEC sp_MSforeachtable @command1="DELETE FROM ? "

/* run after importing data */
-- SQL enable all triggers - enable all triggers sql server - t sql enable trigger
EXEC sp_MSforeachtable @command1="ALTER TABLE ? ENABLE TRIGGER ALL"
-- SQL enable all constraints - enable all constraints sql server
-- sp_MSforeachtable is an undocumented system stored procedure
EXEC sp_MSforeachtable @command1="ALTER TABLE ? CHECK CONSTRAINT ALL"

Tuesday, May 24, 2011

T410 USB not working - SOLVED

I tried posting this to the Lenovo Community thread but after I registered, everything was in German and it wouldn't let me post.

But, for those struggling with the same issue, here's how I solved it.

1. Right-click on "My Computer"
2. Select Manage
3. Expand the "Universal Serial Bus controllers"
4. Right-click on the first "USB Root Hub"
5. Select Properties
6. Select the "Power Management" tab
7. Uncheck "Allow the computer to turn off this device to save power."
8. Click OK
9. Repeat steps 4-8 for the other "USB Root Hub"
10. Right-click each USB Root Hub and uninstall each one
11. Right-click on the "Universal Serial Bus controllers"
12. Select "Scan for hardware changes"
13. Let all the stuff reconnect (USB hubs, camera, fingerprint, AND MOUSE! :)
14. Done!

Thursday, May 19, 2011

UK CLASSIFIED ADS ........You have to love British humor!

UK CLASSIFIED ADS ........You have to love British humor!
These are classified ads, which were actually placed in a U.K.

8 years old.
Hateful little bastard.

1/2 Cocker Spaniel,
1/2 sneaky neighbour's dog.

Mother is a Kennel Club registered German Shepherd.
Father is a Super Dog, able to leap tall fences in a single bound.

Also 1 gay bull for sale.

Must sell washer and dryer £100.

Worn once by mistake.
Call Stephanie.

**** And the WINNER is... ****

Complete set of Encyclopedia Britannica, 45 volumes.
Excellent condition, £200 or best offer.
No longer needed, got married, wife knows everything.

Friday, April 1, 2011

Breaking news: Microsoft, Google, Twitter and Facebook to merge in $1 trillion deal

This is insider information, please do not repost...

Microsoft, Google, Twitter and Facebook have decided to merge in a one trillion dollar deal. The new company will be named Microgootwitbook.

Tuesday, February 8, 2011

CSS Compressor

I found this the other day. Another nice compressing tool, but this one is for CSS.

So a few of us are starting a free new service website called It helps businesses and bloggers connect by allowing bloggers search through unique offers, samples, etc and work out a deal directly with businesses to review their products or services.

Does it work? At least a few folks think so in the forum.

It's still a work in progress, but the site is definitely gaining momentum. 

Tuesday, October 13, 2009

Dabbling with FileExists and SSIS packages

So I've been trolling around through the www trying to find a quick (and dirty way) to determine if a file exists before executing some SQL. I found a few articles through the wonders of googling and there are a lot of ways (SSIS:: Test for Data Files Existence, Determining if a File Exists in SSIS Using Wildcards, Check if File Exists, Does File Exist Check in SSIS) to skin this cat, but I felt there had to be a simpler way.

Basically, I ended up using the "Set Attributes" operation in a File System Task Editor and an existing SourceConnection.

There are a few assumptions here...
1. The source connection file should exist when first creating the connection.
2. Setting all of the attributes (hidden, read-only, archive, system) to False is ok.
3. You don't mind hacks.

So here are the steps you can take to check if one or more file exists before executing your SQL:
1. Set up a new file connection pointing to the file to be loaded.
2. Create a File System Task using the "Set Attributes" operation.
3. Add your precedence constraint/connectors.

Test the steps by executing the task once (should turn green). Then rename the source file and executing the step again (should turn red).

I haven't tested this in a production environment but figured I'd write it down and see if it works for others.

Good luck and happy coding!