Find All Rows in Table1 That Are Not in Table2 Using JOIN

tech — tags: — rohand @ February 15, 2010 1:06 PM

To find all rows that are in dbo.TABLE1 but not in dbo.TABLE2 using the SQL JOIN operator:

SELECT              COUNT(*)
FROM                dbo.TABLE1 t1 WITH (NOLOCK)
LEFT OUTER JOIN     dbo.TABLE2 t2 WITH (NOLOCK)
ON                  t1.PrimaryKey = t2.PrimaryKey
WHERE               t2.PrimaryKey IS NULL

SQL 2008 – Manage DTS Packages

tech — tags: , — rohand @ January 27, 2010 5:25 PM

I installed the SQL Server 2008 Feature Pack to get the DTS components for SQL Server Management Studio 2008. However, the IDE continued to error until I copied the following files from the SQL Server 2000 manager to the SQL 2008 Manager folders.

You need to have SQL 2000 Enterprise Manager installed on the same machine.

Copy Components into SQL Server 2005

copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\semsfc.dll" "%ProgramFiles%\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\semsfc.dll"
copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\sqlgui.dll" "%ProgramFiles%\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\sqlgui.dll"
copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\sqlsvc.dll" "%ProgramFiles%\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\sqlsvc.dll"
copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\Resources\1033\semsfc.rll" "%ProgramFiles%\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\Resources\1033\semsfc.rll"
copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\Resources\1033\sqlgui.rll" "%ProgramFiles%\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\Resources\1033\sqlgui.rll"
copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\Resources\1033\sqlsvc.rll" "%ProgramFiles%\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\Resources\1033\sqlsvc.rll"

Copy Components into SQL Server 2008

copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\semsfc.dll" "%ProgramFiles%\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\semsfc.dll"
copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\sqlgui.dll" "%ProgramFiles%\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\sqlgui.dll"
copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\sqlsvc.dll" "%ProgramFiles%\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\sqlsvc.dll"
copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\Resources\1033\semsfc.rll" "%ProgramFiles%\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Resources\1033\semsfc.rll"
copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\Resources\1033\sqlgui.rll" "%ProgramFiles%\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Resources\1033\sqlgui.rll"
copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\Resources\1033\sqlsvc.rll" "%ProgramFiles%\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Resources\1033\sqlsvc.rll"

Do Not .IndexOf Without Further Checks

tech — tags: , — rohand @ January 26, 2010 11:42 AM

Do not do this:

if ("A,B,C,D,E".IndexOf(key) > -1)
{
    // CODE REDACTED
}

If key is an empty string, the result is 0 and the code in the IF block is executed. This is probably not what you expected.

Google AppEngine

tech — tags: , — rohand @ January 12, 2010 6:17 PM

I have an application concept in my head and wanted to build it for Google AppEngine.

The AppEngine SDK is offered in two flavors: Python and Java. I wasn’t really sure which SDK to pick. Python has been supported since Day One – it has the most examples and the best API support. In addition, it includes the webapp framework and Django support.

I’ve picked Python as the implementation framework.

Created on a Slate PC

tech — rohand @ November 4, 2009 11:14 PM

This post was created on a Slate PC – a Motion Computing LE1600 -running Windows 7 and "typed" using the handwriting recognition very very quickly :)

I AM Impressed!

DB2 System Properties

tech — tags: — rohand @ August 18, 2009 5:16 PM

These calls will retrieve DB2 system properties.

SELECT *
FROM TABLE(SYSPROC.ENV_GET_INST_INFO()) AS Instance_Info
GO
SELECT *
FROM TABLE(SYSPROC.ENV_GET_PROD_INFO()) AS Product_Info
GO
SELECT *
FROM TABLE(SYSPROC.ENV_GET_SYS_INFO()) AS System_Info
GO

How to Create a Junction in Windows 7

tech — tags: — rohand @ August 9, 2009 5:55 PM

Create a junction in Windows 7 using the MKLINK command.

mklink /j source-path target-path

As an example, create a junction called C:\Volatile that resides on the S: drive.

mklink /j C:\Volatile S:\Volatile

Windows7-mklink

©2010 appytizers. All rights reserved.