Viewing 15 posts - 121 through 135 (of 189 total)
Because you didn't go into the IF.
Test it:
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Function Main()
If 1=1 Then
MsgBox "one equals one."
Else
MsgBox "hell froze over."
End If
Main = DTSTaskExecResult_Success
End Function
Since none of your...
[font="Courier New"]ZenDada[/font]
June 30, 2004 at 9:33 am
This is a DTS connection object, not an ADO connection object. You can definitely code this with the DTS object model. DTS connection objects have child objects that execute SQL. ...
[font="Courier New"]ZenDada[/font]
June 29, 2004 at 12:38 pm
Try one of these flavors:
If Len(EmpID) < 1 Or IsEmpty(EmpID) Or IsNull(EmpID) Then
MsgBox "EmpID was not found."
End If
Don't use a msgbox on the Server! That's where it'll appear if...
[font="Courier New"]ZenDada[/font]
June 29, 2004 at 11:04 am
This will create a reference to your connection:
Dim oPkg
Set oPkg = DTSGlobalvariables.parent
Dim oConn
Set oConn = oPkg.Connections("myConn")
However you cannot execute a sql statement against this connection.
I take it you are trying...
[font="Courier New"]ZenDada[/font]
June 29, 2004 at 10:24 am
By the way, when using transformations - if all you are doing is copy columns, go into the transformations tab, delete all, select all, and select copy columns. You will...
[font="Courier New"]ZenDada[/font]
June 29, 2004 at 9:27 am
If all you want to do is run an execsql, you will only have one conn object. You won't "connect" it to anything with a workflow. The execsql will use...
[font="Courier New"]ZenDada[/font]
June 29, 2004 at 9:22 am
And you can substitute fields with select statements like this. Say when you want the next value in a series - you can use a correlated subquery:
select * from #t...
[font="Courier New"]ZenDada[/font]
June 28, 2004 at 12:09 pm
It's called a "derived table". Search on that term. Select title, "using the FROM clause" in the location "Accessing and changing relational data".
[font="Courier New"]ZenDada[/font]
June 28, 2004 at 9:56 am
"What I'm looking for is something that will return me only the date part of a date time..."
The equivalent of Oracle's TRUNC is this:
select cast(convert(varchar(15), getdate(), 101) as datetime) which...
[font="Courier New"]ZenDada[/font]
June 25, 2004 at 10:57 am
"The method that doesn't use string manipulation is slightly faster. Which of course has no importance unless the number of times the algorithm runs is ridiculously large."
Exactly - that's why...
[font="Courier New"]ZenDada[/font]
June 23, 2004 at 9:15 am
declare @str as varchar(10)
declare @ptr as integer
declare @ascii as varchar(1000)
set @str = 'FOOD\r¦ BOX 2'
set @ptr = 1
while @ptr <= len(@str)
begin
print char(ascii(substring(@str,@ptr,1)))
print ascii(substring(@str,@ptr,1))
print '----'
set @ptr=@ptr+1
end
F
70
----
O
79
----
O
79
----
D
68
----
92
----
r
114
----
¦
166
----
32
----
B
66
----
O
79
----
[font="Courier New"]ZenDada[/font]
June 22, 2004 at 1:57 pm
That's snazzy. I'm keepin' that one!
[font="Courier New"]ZenDada[/font]
June 22, 2004 at 11:05 am
Here's your function:
CREATE FUNCTION dbo.lastdayofmonth
(@ReportDt datetime)
RETURNS datetime
AS
BEGIN
declare @fmonth datetime
declare @lastday datetime
set @ReportDt = cast(convert(varchar(15), @ReportDt, 101) as datetime)
set @fmonth = @ReportDt - Day(@ReportDt) + 1
set @lastday = (@fmonth + 31) -...
[font="Courier New"]ZenDada[/font]
June 22, 2004 at 10:25 am
Declare @Date as smalldatetime,
@Fmonth as smalldatetime,
@EomPrev as smalldatetime,
@EomCurr as smalldatetime,
@EomNext as smalldatetime
set @Date = cast(convert(varchar(15),getdate()+5, 101)as smalldatetime)
set @Fmonth = (@Date - Day(@Date)+1) -- Sets To First Day Of Current Month
set...
[font="Courier New"]ZenDada[/font]
June 22, 2004 at 9:53 am
And for stored procedures:
SQL Server 2000 Stored Procedures Handbook by Wrox
SQL Server 2000 Programming by Wrox
[font="Courier New"]ZenDada[/font]
June 22, 2004 at 9:35 am
Viewing 15 posts - 121 through 135 (of 189 total)