Showing posts with label function. Show all posts
Showing posts with label function. Show all posts

Sunday, March 25, 2012

ActiveX Script Task] Error:

Hi,
I'm trying to reset the below Global varialbe in SSIS - Activex script.

Function Main()
DTSGlobalVariables("GxvFilename").value =null
Main = DTSTaskExecResult_Success
End Function

Getting the below Error when executing the package.

[ActiveX Script Task] Error: Retrieving the file name for a component failed with error code 0x060339E4

Please provide me solution for this.

Thanks,

You can read and write global variables from ActiveX Script, but I have to ask why bother when you have the much more powerfull VB.net in the Script Task.

I don't belive null is a valid keyword in VBScript. Nothing is more usual, and use a Set statement. Saying all that I tried and got the same error. Unless anyone can come up with something better I'd say this is a backward compatability issue, and you woudl be better off moving to the Script Task.

|||

Thanks Darren,

The Activex Script is not working as like SQL 2000. We nee to use " " instead of null for resting the global variables.
MS need to give some reasonable error message for this kind of error.

Anyway I made it work in Activex Script iteself.

ActiveX Script Task] Error:

Hi,
I'm trying to reset the below Global varialbe in SSIS - Activex script.

Function Main()
DTSGlobalVariables("GxvFilename").value =null
Main = DTSTaskExecResult_Success
End Function

Getting the below Error when executing the package.

[ActiveX Script Task] Error: Retrieving the file name for a component failed with error code 0x060339E4

Please provide me solution for this.

Thanks,

You can read and write global variables from ActiveX Script, but I have to ask why bother when you have the much more powerfull VB.net in the Script Task.

I don't belive null is a valid keyword in VBScript. Nothing is more usual, and use a Set statement. Saying all that I tried and got the same error. Unless anyone can come up with something better I'd say this is a backward compatability issue, and you woudl be better off moving to the Script Task.

|||

Thanks Darren,

The Activex Script is not working as like SQL 2000. We nee to use " " instead of null for resting the global variables.
MS need to give some reasonable error message for this kind of error.

Anyway I made it work in Activex Script iteself.

ActiveX Script Task/Function Not Found

We have a SQL Server 2005 Cluster that we are trying to send email from to notify when certain jobs have completed, failed, etc. We are having a bit of a problem getting the email to work and I believe that the failure is at the SMTP server, not at the SQL level.

That being said, I'm trying to create a simple SSIS package that I can use to test connectivity to the SMTP server with and send email. I've added an ActiveX Script Task that calls a COM object that actually sends the email. I keep getting a "Function not found." error when I try to execute the package, and I have no idea why I'm getting that. It says that the errors were found during validation.

Can anyone help?

Function not found is most likely the result of an invalid reference.

However, we do not recommend using the ActiveX script task - it is only for backwards compat. Better to move to the Script task which uses VB.Net and which enables a much better development and debugging experience.

Donald

ActiveX Component in Linked Server Function...?

Hi Everyone
I have a question regarding a function I have which is licensed on a
particular server and
uses an ActiveX component to pull a list of names and addresses from a
Post Office Address File.
Its expensive to license the component on another server so I was
wondering if its possible to have a linked server
and open the function to return the data to another server?
Any help would be very much appreciated.
Mattie
Chester Zoo> Its expensive to license the component on another server so I was
> wondering if its possible to have a linked server
> and open the function to return the data to another server?
I haven't actually done this via a linked server but you ought to be able to
encapsulate the ActiveX requests in a stored procedure using the sp_OA*
procs. However, be sure to thoroughly review the vendor licensing agreement
to make sure this use is allowed. Many EULAs have provisions that prohibit
multiplexing.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"MattieG" <mattiegriffin@.hotmail.co.uk> wrote in message
news:1192366692.494333.154910@.i38g2000prf.googlegroups.com...
> Hi Everyone
> I have a question regarding a function I have which is licensed on a
> particular server and
> uses an ActiveX component to pull a list of names and addresses from a
> Post Office Address File.
> Its expensive to license the component on another server so I was
> wondering if its possible to have a linked server
> and open the function to return the data to another server?
> Any help would be very much appreciated.
> Mattie
> Chester Zoo
>|||On 14 Oct, 16:40, "Dan Guzman" <guzma...@.nospam-online.sbcglobal.net>
wrote:
> > Its expensive to license the component on another server so I was
> > wondering if its possible to have a linked server
> > and open the function to return the data to another server?
> I haven't actually done this via a linked server but you ought to be able to
> encapsulate the ActiveX requests in a stored procedure using the sp_OA*
> procs. However, be sure to thoroughly review the vendor licensing agreement
> to make sure this use is allowed. Many EULAs have provisions that prohibit
> multiplexing.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "MattieG" <mattiegrif...@.hotmail.co.uk> wrote in message
> news:1192366692.494333.154910@.i38g2000prf.googlegroups.com...
>
> > Hi Everyone
> > I have a question regarding a function I have which is licensed on a
> > particular server and
> > uses an ActiveX component to pull a list of names and addresses from a
> > Post Office Address File.
> > Its expensive to license the component on another server so I was
> > wondering if its possible to have a linked server
> > and open the function to return the data to another server?
> > Any help would be very much appreciated.
> > Mattie
> > Chester Zoo- Hide quoted text -
> - Show quoted text -
Hi
Thanks for that.
The only other way is to install IIS on the SQL box and transfer the
system to that.
It should be ok as the IIS is not going external so security isnt much
of a problem.
Thanks
Mattie

Friday, February 24, 2012

Access's LAST aggregate function equivalent

Hi,
I am porting an Access application that uses the LAST
aggregate function to SQL Server 7.0. I would like to know
if there is any equivalent to the LAST function in SQL
Server 7.0. I've been looking in the documentation and I
haven't found anything. The problem I'm running into is
that I have to use a LAST-kind of function since the last
record in the group doesn't have anything else to locate
it by. It may be the MAX record, but there are cases where
it won't be. I also can't use SUM, since that last record
is already a SUM of all previous records in that group. If
anyone can help, it would be greatly appreciated.
Thanks in advance,
StephanHello Stephan !
Just post your TSQL code so we can post you how you could avoid using LAST.
(Also DDl, sample data and estimated query result would be helpful)
Jens Süßmeyer.
"Stephan Desmoulin" <sdesmoulin@.huimfg.com> schrieb im Newsbeitrag
news:029f01c37952$cc57a140$a101280a@.phx.gbl...
> Hi,
> I am porting an Access application that uses the LAST
> aggregate function to SQL Server 7.0. I would like to know
> if there is any equivalent to the LAST function in SQL
> Server 7.0. I've been looking in the documentation and I
> haven't found anything. The problem I'm running into is
> that I have to use a LAST-kind of function since the last
> record in the group doesn't have anything else to locate
> it by. It may be the MAX record, but there are cases where
> it won't be. I also can't use SUM, since that last record
> is already a SUM of all previous records in that group. If
> anyone can help, it would be greatly appreciated.
> Thanks in advance,
> Stephan|||Unfortunately, I can't post expected results since the
data I'm running off of in SQL Server is several months
older than the data in Access. The SQL statement looks
like this:
SET DATEFIRST 6
SELECT fldBHSCustID, MAX(fldBHSRunDate), LAST
(fldBHSExtPrice)
FROM tblBklgHistSum
GROUP BY fldBHSCustID, DATEADD(d, 7 - DATEPART(dw,
fldBHSRunDate), fldBHSRunDate)
ORDER BY fldBHSCustID
The calculation with the dates is used to group the
results in one-week chunks with the week end date always
being a Friday. Note that the LAST function isn't actually
there in my query, it's what I would like to use.
The data kind of looks like this:
CustID RunDate ExtPrice
-- -- --
1 9/9/2003 123
1 9/10/2003 123
1 9/11/2003 123
1 9/12/2003 123
2 9/11/2003 450
2 9/12/2003 423
3 9/10/2003 12
3 9/11/2003 45
3 9/11/2003 64
3 9/12/2003 78
The trouble as this sample data shows, is that the
ExtPrice field is fairly random and I only want to use the
very last value entered.
Thanks for the help,
Stephan
>--Original Message--
>Hi,
>I am porting an Access application that uses the LAST
>aggregate function to SQL Server 7.0. I would like to
know
>if there is any equivalent to the LAST function in SQL
>Server 7.0. I've been looking in the documentation and I
>haven't found anything. The problem I'm running into is
>that I have to use a LAST-kind of function since the last
>record in the group doesn't have anything else to locate
>it by. It may be the MAX record, but there are cases
where
>it won't be. I also can't use SUM, since that last record
>is already a SUM of all previous records in that group.
If
>anyone can help, it would be greatly appreciated.
>Thanks in advance,
>Stephan
>.
>|||This is a nice example of one of the problems with the "LAST aggregate". You
didn't tell us the primary key but it would appear that there can be more
than one "last" extprice (because your table allows more than one price on
the same Rundate). If that is the case which price do you choose? The
following query gives the MAX, LAST extprice.
Tip: You can use the DATEDIFF function as shown to avoid any dependency on
the DATEFIRST setting.
Another tip: Get rid of those horrid "tbl" and "fld" prefixes. SQL has
columns not fields. And we know it's a column because it's in a table!
CREATE TABLE tblBklgHistSum (custid INTEGER, rundate DATETIME, extprice
INTEGER, PRIMARY KEY (custid, rundate, extprice))
INSERT INTO tblBklgHistSum VALUES (1, '20030909', 123)
INSERT INTO tblBklgHistSum VALUES (1, '20030910', 123)
INSERT INTO tblBklgHistSum VALUES (1, '20030911', 123)
INSERT INTO tblBklgHistSum VALUES (1, '20030912', 123)
INSERT INTO tblBklgHistSum VALUES (2, '20030911', 450)
INSERT INTO tblBklgHistSum VALUES (2, '20030912', 423)
INSERT INTO tblBklgHistSum VALUES (3, '20030910', 12)
INSERT INTO tblBklgHistSum VALUES (3, '20030911', 45)
INSERT INTO tblBklgHistSum VALUES (3, '20030911', 64)
INSERT INTO tblBklgHistSum VALUES (3, '20030912', 78)
SELECT T.custid, T.rundate,
MAX(T.extprice) AS extprice
FROM tblBklgHistSum AS T
JOIN
(SELECT custid,
MAX(rundate) AS rundate
FROM tblBklgHistSum
GROUP BY custid,
FLOOR(DATEDIFF(DAY,'20000101',rundate)/7)) AS M
ON T.custid = M.custid AND T.rundate = M.rundate
GROUP BY T.custid, T.rundate
--
David Portas
--
Please reply only to the newsgroup
--