SELECT
myval =
case
when [denominator calculation] IN (0, NULL) then 0
else [full calculation]
end
FROM [table]
Original link here
Thursday, November 17, 2005
Thursday, November 03, 2005
Code sample: How to run a Sql Server DTS Job from VB .Net
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ExecuteDTS("sqlserver", "nameofDTSJob", , )
End Sub
'Reference Microsoft DTSPackage Object Library
Public Sub ExecuteDTS(ByVal sServer As String, ByVal sPackage As String, _
Optional ByVal sUser As String = vbNullString, _
Optional ByVal sPassword As String = vbNullString)
Dim oPackage As DTS.Package2 'The DTS Package Object
' Initialize DTS Package
oPackage = New DTS.Package2
' Run DTS Package
' LoadFromSQLServer can be replaced with LoadFromRepository or
' LoadFromStorageFile depending on the storage location of the package
oPackage.LoadFromSQLServer(sServer, sUser, sPassword, _
DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedConnection, , , , sPackage)
oPackage.Execute()
' Cleanup
oPackage = Nothing
End Sub
End Class
Subscribe to:
Posts (Atom)