dbTalk Databases Forums  

running s/procedures from activex

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss running s/procedures from activex in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Spud_Monkey
 
Posts: n/a

Default running s/procedures from activex - 01-02-2004 , 06:29 AM






I have the following SP


PROCEDURE sp_Write_Off_Select (@unique_id [char](15))
AS
DECLARE @var1 nvarchar(1)
Set @var1 = 'N'
SELECT @var1 as include, Table1.*
FROM Table1
WHERE Table1.[unique_id] = @unique_id

This works fine within Query Analyzer and within an Execute SQL Task but I
need to run it within an Activex script. It comes back with an empty
recordset when I know there is data.

I can get it to work if I take out all references to @var1 variable but I
need this in.

Any thoughts



Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: running s/procedures from activex - 01-02-2004 , 08:42 AM






In the Sp can you do

SET NOCOUNT ON

SELECT 'N' as include, Table1.*
FROM Table1
WHERE Table1.[unique_id] = @unique_id

Are you sure you are in the correct database on the right server.?

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Spud_Monkey" <spudmonkey (AT) aol (DOT) co> wrote

Quote:
I have the following SP


PROCEDURE sp_Write_Off_Select (@unique_id [char](15))
AS
DECLARE @var1 nvarchar(1)
Set @var1 = 'N'
SELECT @var1 as include, Table1.*
FROM Table1
WHERE Table1.[unique_id] = @unique_id

This works fine within Query Analyzer and within an Execute SQL Task but I
need to run it within an Activex script. It comes back with an empty
recordset when I know there is data.

I can get it to work if I take out all references to @var1 variable but I
need this in.

Any thoughts





Reply With Quote
  #3  
Old   
Spud_Monkey
 
Posts: n/a

Default Re: running s/procedures from activex - 01-02-2004 , 10:00 AM



Thanks Allan

worked a treat but only if omitted the 'SET NOCOUNT ON' line.

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
In the Sp can you do

SET NOCOUNT ON

SELECT 'N' as include, Table1.*
FROM Table1
WHERE Table1.[unique_id] = @unique_id

Are you sure you are in the correct database on the right server.?

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Spud_Monkey" <spudmonkey (AT) aol (DOT) co> wrote in message
news:eRK8CwS0DHA.2752 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
I have the following SP


PROCEDURE sp_Write_Off_Select (@unique_id [char](15))
AS
DECLARE @var1 nvarchar(1)
Set @var1 = 'N'
SELECT @var1 as include, Table1.*
FROM Table1
WHERE Table1.[unique_id] = @unique_id

This works fine within Query Analyzer and within an Execute SQL Task but
I
need to run it within an Activex script. It comes back with an empty
recordset when I know there is data.

I can get it to work if I take out all references to @var1 variable but
I
need this in.

Any thoughts







Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.