dbTalk Databases Forums  

Assigning result of select statement to a variable

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


Discuss Assigning result of select statement to a variable in the microsoft.public.sqlserver.dts forum.



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

Default Assigning result of select statement to a variable - 10-05-2004 , 02:07 PM






Hi,
I'm just starting out with dts.

1. I would like to know how to assign the result of an sql statement to a
variable in an activex vbs script. (Assume the select statement returns only
one value).

2. What is the maximum value that can be returned when checking the string
length using LEN function?

Thanks.
Madhusudhan

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

Default Re: Assigning result of select statement to a variable - 10-05-2004 , 02:16 PM






1. Use the ExecuteSQL task

Your statement would look like this

SELECT value FROM TABLE

Hit the parameters button
Go to output parameters tab | Row value

Drop down the Global variables combobox and either choose or go to the
bottom of the box and create a new one.

Have a look towards the end of this article

How to Use Lookups in DTS
(http://www.sqldts.com/default.aspx?277)


--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com


"Madhusudhan" <Madhusudhan (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi,
I'm just starting out with dts.

1. I would like to know how to assign the result of an sql statement to a
variable in an activex vbs script. (Assume the select statement returns
only
one value).

2. What is the maximum value that can be returned when checking the string
length using LEN function?

Thanks.
Madhusudhan



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

Default Re: Assigning result of select statement to a variable - 10-06-2004 , 12:01 PM



Thanks Allan for replying. I did look at the tutorial you suggested on your
website. twas helpful. but that seems to suggest that i need to create an
execute sql task.

um..is it not possible to embed sql's in the vbs activex script and use the
results of the query in my script?

I have an Activex script task and am hoping to keep most of the
functionality localised in it.

Thanks
Madhusudhan

"Allan Mitchell" wrote:

Quote:
1. Use the ExecuteSQL task

Your statement would look like this

SELECT value FROM TABLE

Hit the parameters button
Go to output parameters tab | Row value

Drop down the Global variables combobox and either choose or go to the
bottom of the box and create a new one.

Have a look towards the end of this article

How to Use Lookups in DTS
(http://www.sqldts.com/default.aspx?277)


--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com


"Madhusudhan" <Madhusudhan (AT) discussions (DOT) microsoft.com> wrote in message
news:18E27B86-862D-4FED-84F1-35424F390BC9 (AT) microsoft (DOT) com...
Hi,
I'm just starting out with dts.

1. I would like to know how to assign the result of an sql statement to a
variable in an activex vbs script. (Assume the select statement returns
only
one value).

2. What is the maximum value that can be returned when checking the string
length using LEN function?

Thanks.
Madhusudhan




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

Default Re: Assigning result of select statement to a variable - 10-06-2004 , 01:23 PM



Then why bother with DTS?

Sure you can do it and a quick Google will reveal hundreds of solutions but
if that is what you want to do in DTS then forget using DTS. Just create a
..vbs file.

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com


"Madhusudhan" <Madhusudhan (AT) discussions (DOT) microsoft.com> wrote

Quote:
Thanks Allan for replying. I did look at the tutorial you suggested on
your
website. twas helpful. but that seems to suggest that i need to create an
execute sql task.

um..is it not possible to embed sql's in the vbs activex script and use
the
results of the query in my script?

I have an Activex script task and am hoping to keep most of the
functionality localised in it.

Thanks
Madhusudhan

"Allan Mitchell" wrote:

1. Use the ExecuteSQL task

Your statement would look like this

SELECT value FROM TABLE

Hit the parameters button
Go to output parameters tab | Row value

Drop down the Global variables combobox and either choose or go to the
bottom of the box and create a new one.

Have a look towards the end of this article

How to Use Lookups in DTS
(http://www.sqldts.com/default.aspx?277)


--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com


"Madhusudhan" <Madhusudhan (AT) discussions (DOT) microsoft.com> wrote in message
news:18E27B86-862D-4FED-84F1-35424F390BC9 (AT) microsoft (DOT) com...
Hi,
I'm just starting out with dts.

1. I would like to know how to assign the result of an sql statement to
a
variable in an activex vbs script. (Assume the select statement returns
only
one value).

2. What is the maximum value that can be returned when checking the
string
length using LEN function?

Thanks.
Madhusudhan






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.