dbTalk Databases Forums  

ActiveX - change global variable

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


Discuss ActiveX - change global variable in the microsoft.public.sqlserver.dts forum.



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

Default ActiveX - change global variable - 02-09-2004 , 05:04 AM






I have no ActiveX skills, so I'm hoping this is going to be easy for those
that do.

I have a Global Variable (type =Date) in a DTS, which I want to set to the
current date (minus the time - ie convert(varchar,getdate,106) ) at the
beginning of the DTS.

How do I do it?!

Thanks. BM



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

Default Re: ActiveX - change global variable - 02-09-2004 , 05:26 AM






And you want it in this format dd mon yy

I would assign this to a String datatype global variable

You can do this using DTS 2000 by using the ExecuteSQL task i.e.

SELECT convert(varchar(50),Getdate(),106) as DateRequired

The click the Parameters button and assign it to your Global Variable there.



--

----------------------------

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


"Beema" <none (AT) supplied (DOT) com> wrote

Quote:
I have no ActiveX skills, so I'm hoping this is going to be easy for those
that do.

I have a Global Variable (type =Date) in a DTS, which I want to set to the
current date (minus the time - ie convert(varchar,getdate,106) ) at the
beginning of the DTS.

How do I do it?!

Thanks. BM





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

Default Re: ActiveX - change global variable - 02-09-2004 , 06:18 AM



Hi I've two questions about this.

1. I added the ExecuteSQL Task, with the "select convert...", clicked on
Parameters and the list of Input Global Parameters was empty. The
GlobalVariable definitely exists though.

2. I am actually planning on using the GlobalVariable as a parameter in an
SQL statement. But the SQL Statement is in a transfer task - as far as I can
see, Global Variables are not usuable in this case are they?


The format "dd mon yyy" is not important, I am using the Global Variable as
a parameter in a Where clause, with the column being a datetime - with the
time part trimmed off.

Thanks,


----------------------------


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

Quote:
And you want it in this format dd mon yy

I would assign this to a String datatype global variable

You can do this using DTS 2000 by using the ExecuteSQL task i.e.

SELECT convert(varchar(50),Getdate(),106) as DateRequired

The click the Parameters button and assign it to your Global Variable
there.




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

Default Re: ActiveX - change global variable - 02-09-2004 , 06:34 AM



Drop down the combo box and you should find the GV. It is not an INput GV
it is an Putput GV.
Yes you can reuse the GV in a datapump. You would do

SELECT ............... FROM Table WHERE col = ?

Click on the parameters button and you can map the GV there.

Watch out for conversions

If you are reusing this in a datapump task then when move it to a GV can you
not do

SELECT ...... FROM Table WHERE col = CONVERT(varchar(50),Getdate(),106)



--

----------------------------

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


"Beema" <none (AT) supplied (DOT) com> wrote

Quote:
Hi I've two questions about this.

1. I added the ExecuteSQL Task, with the "select convert...", clicked on
Parameters and the list of Input Global Parameters was empty. The
GlobalVariable definitely exists though.

2. I am actually planning on using the GlobalVariable as a parameter in an
SQL statement. But the SQL Statement is in a transfer task - as far as I
can
see, Global Variables are not usuable in this case are they?


The format "dd mon yyy" is not important, I am using the Global Variable
as
a parameter in a Where clause, with the column being a datetime - with the
time part trimmed off.

Thanks,


----------------------------


"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:OmZbN#v7DHA.3804 (AT) tk2msftngp13 (DOT) phx.gbl...
And you want it in this format dd mon yy

I would assign this to a String datatype global variable

You can do this using DTS 2000 by using the ExecuteSQL task i.e.

SELECT convert(varchar(50),Getdate(),106) as DateRequired

The click the Parameters button and assign it to your Global Variable
there.






Reply With Quote
  #5  
Old   
Beema
 
Posts: n/a

Default Re: ActiveX - change global variable - 02-09-2004 , 08:01 AM




It's OK to use GV's in a simple "select.. from... where col=?" But the
select statement in my datapump is a lot more complex.

I have declared local variables, and am assigning them based on the value of
the current date..

Here's a rough version of the SQL Statement I am using (the data goes to a
csv file btw)

---------------------
declare @FiscalPeriod varchar(30)
declare @Today datetime

select @Today = convert(varchar,getdate(), 106)

select @FiscalPeriod = FiscalPeriod
from Time_Dim
where Date_Time = @Today

select ColA,
ColB
datename(month, @Today) as Month
@FiscalPeriod,
etc...
from MyTable
inner join Time_Dim on MyTable.InsertDate = Time_Dim.DateTime
where Time_Dim.InsertDate = @Today
---------------------

the results of this query are sent to a CSV file for import into another
system.

My Dilemma is that I need to get the datename of the @Today value, and I'm
pretty sure that this goes beyond the capabilities of GV's. From what I've
read, they can only be used in a where clause.


I think that I am not going to be able to use GV's in my case.








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

Quote:
Drop down the combo box and you should find the GV. It is not an INput GV
it is an Putput GV.
Yes you can reuse the GV in a datapump. You would do

SELECT ............... FROM Table WHERE col = ?

Click on the parameters button and you can map the GV there.

Watch out for conversions

If you are reusing this in a datapump task then when move it to a GV can
you
not do

SELECT ...... FROM Table WHERE col = CONVERT(varchar(50),Getdate(),106)



--

----------------------------

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


"Beema" <none (AT) supplied (DOT) com> wrote in message
news:OTcTlbw7DHA.452 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Hi I've two questions about this.

1. I added the ExecuteSQL Task, with the "select convert...", clicked on
Parameters and the list of Input Global Parameters was empty. The
GlobalVariable definitely exists though.

2. I am actually planning on using the GlobalVariable as a parameter in
an
SQL statement. But the SQL Statement is in a transfer task - as far as I
can
see, Global Variables are not usuable in this case are they?


The format "dd mon yyy" is not important, I am using the Global Variable
as
a parameter in a Where clause, with the column being a datetime - with
the
time part trimmed off.

Thanks,


----------------------------


"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:OmZbN#v7DHA.3804 (AT) tk2msftngp13 (DOT) phx.gbl...
And you want it in this format dd mon yy

I would assign this to a String datatype global variable

You can do this using DTS 2000 by using the ExecuteSQL task i.e.

SELECT convert(varchar(50),Getdate(),106) as DateRequired

The click the Parameters button and assign it to your Global Variable
there.








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

Default Re: ActiveX - change global variable - 02-09-2004 , 08:32 AM



declare @FiscalPeriod varchar(30)
declare @Today datetime

select @Today = convert(varchar,getdate(), 106)



select ColA,
ColB
datename(month, @Today) as Month,
(select FiscalPeriod from Time_Dim where Date_Time =
convert(varchar,getdate(), 106)) as FiscalPeriod ,
etc...
from MyTable
inner join Time_Dim on MyTable.InsertDate = Time_Dim.DateTime
where Time_Dim.InsertDate = convert(varchar,getdate(), 106)



--

----------------------------

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


"Beema" <none (AT) supplied (DOT) com> wrote

Quote:
It's OK to use GV's in a simple "select.. from... where col=?" But the
select statement in my datapump is a lot more complex.

I have declared local variables, and am assigning them based on the value
of
the current date..

Here's a rough version of the SQL Statement I am using (the data goes to a
csv file btw)

---------------------
declare @FiscalPeriod varchar(30)
declare @Today datetime

select @Today = convert(varchar,getdate(), 106)

select @FiscalPeriod = FiscalPeriod
from Time_Dim
where Date_Time = @Today

select ColA,
ColB
datename(month, @Today) as Month
@FiscalPeriod,
etc...
from MyTable
inner join Time_Dim on MyTable.InsertDate = Time_Dim.DateTime
where Time_Dim.InsertDate = @Today
---------------------

the results of this query are sent to a CSV file for import into another
system.

My Dilemma is that I need to get the datename of the @Today value, and I'm
pretty sure that this goes beyond the capabilities of GV's. From what I've
read, they can only be used in a where clause.


I think that I am not going to be able to use GV's in my case.








"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:u13fckw7DHA.2056 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Drop down the combo box and you should find the GV. It is not an INput
GV
it is an Putput GV.
Yes you can reuse the GV in a datapump. You would do

SELECT ............... FROM Table WHERE col = ?

Click on the parameters button and you can map the GV there.

Watch out for conversions

If you are reusing this in a datapump task then when move it to a GV can
you
not do

SELECT ...... FROM Table WHERE col = CONVERT(varchar(50),Getdate(),106)



--

----------------------------

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


"Beema" <none (AT) supplied (DOT) com> wrote in message
news:OTcTlbw7DHA.452 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Hi I've two questions about this.

1. I added the ExecuteSQL Task, with the "select convert...", clicked
on
Parameters and the list of Input Global Parameters was empty. The
GlobalVariable definitely exists though.

2. I am actually planning on using the GlobalVariable as a parameter
in
an
SQL statement. But the SQL Statement is in a transfer task - as far as
I
can
see, Global Variables are not usuable in this case are they?


The format "dd mon yyy" is not important, I am using the Global
Variable
as
a parameter in a Where clause, with the column being a datetime - with
the
time part trimmed off.

Thanks,


----------------------------


"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:OmZbN#v7DHA.3804 (AT) tk2msftngp13 (DOT) phx.gbl...
And you want it in this format dd mon yy

I would assign this to a String datatype global variable

You can do this using DTS 2000 by using the ExecuteSQL task i.e.

SELECT convert(varchar(50),Getdate(),106) as DateRequired

The click the Parameters button and assign it to your Global
Variable
there.










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

Default Re: ActiveX - change global variable - 02-09-2004 , 08:35 AM



Can you not rework the statement to

select ColA,
ColB
datename(month, Getdate()) as Month,
FiscalPeriod as FiscalPeriod ,
etc...
from
MyTable inner join Time_Dim
on MyTable.InsertDate = Time_Dim.DateTime
where
Time_Dim.InsertDate = convert(varchar,getdate(), 106)




--

----------------------------

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


"Beema" <none (AT) supplied (DOT) com> wrote

Quote:
It's OK to use GV's in a simple "select.. from... where col=?" But the
select statement in my datapump is a lot more complex.

I have declared local variables, and am assigning them based on the value
of
the current date..

Here's a rough version of the SQL Statement I am using (the data goes to a
csv file btw)

---------------------
declare @FiscalPeriod varchar(30)
declare @Today datetime

select @Today = convert(varchar,getdate(), 106)

select @FiscalPeriod = FiscalPeriod
from Time_Dim
where Date_Time = @Today

select ColA,
ColB
datename(month, @Today) as Month
@FiscalPeriod,
etc...
from MyTable
inner join Time_Dim on MyTable.InsertDate = Time_Dim.DateTime
where Time_Dim.InsertDate = @Today
---------------------

the results of this query are sent to a CSV file for import into another
system.

My Dilemma is that I need to get the datename of the @Today value, and I'm
pretty sure that this goes beyond the capabilities of GV's. From what I've
read, they can only be used in a where clause.


I think that I am not going to be able to use GV's in my case.








"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:u13fckw7DHA.2056 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Drop down the combo box and you should find the GV. It is not an INput
GV
it is an Putput GV.
Yes you can reuse the GV in a datapump. You would do

SELECT ............... FROM Table WHERE col = ?

Click on the parameters button and you can map the GV there.

Watch out for conversions

If you are reusing this in a datapump task then when move it to a GV can
you
not do

SELECT ...... FROM Table WHERE col = CONVERT(varchar(50),Getdate(),106)



--

----------------------------

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


"Beema" <none (AT) supplied (DOT) com> wrote in message
news:OTcTlbw7DHA.452 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Hi I've two questions about this.

1. I added the ExecuteSQL Task, with the "select convert...", clicked
on
Parameters and the list of Input Global Parameters was empty. The
GlobalVariable definitely exists though.

2. I am actually planning on using the GlobalVariable as a parameter
in
an
SQL statement. But the SQL Statement is in a transfer task - as far as
I
can
see, Global Variables are not usuable in this case are they?


The format "dd mon yyy" is not important, I am using the Global
Variable
as
a parameter in a Where clause, with the column being a datetime - with
the
time part trimmed off.

Thanks,


----------------------------


"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:OmZbN#v7DHA.3804 (AT) tk2msftngp13 (DOT) phx.gbl...
And you want it in this format dd mon yy

I would assign this to a String datatype global variable

You can do this using DTS 2000 by using the ExecuteSQL task i.e.

SELECT convert(varchar(50),Getdate(),106) as DateRequired

The click the Parameters button and assign it to your Global
Variable
there.










Reply With Quote
  #8  
Old   
Beema
 
Posts: n/a

Default Re: ActiveX - change global variable - 02-09-2004 , 09:20 AM



Yes, however I have 15 of these in various datapumps. And periodically I
need to use a past date, instead of getdate()

Thats' the reason I'm trying to set this date using a GV, as I only have to
change the date in one place, rather than editing each of the SQL
Statements.


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

Quote:
Can you not rework the statement to

select ColA,
ColB
datename(month, Getdate()) as Month,
FiscalPeriod as FiscalPeriod ,
etc...
from
MyTable inner join Time_Dim
on MyTable.InsertDate = Time_Dim.DateTime
where
Time_Dim.InsertDate = convert(varchar,getdate(), 106)




--

----------------------------

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


"Beema" <none (AT) supplied (DOT) com> wrote in message
news:OPvqUVx7DHA.3648 (AT) TK2MSFTNGP11 (DOT) phx.gbl...

It's OK to use GV's in a simple "select.. from... where col=?" But the
select statement in my datapump is a lot more complex.

I have declared local variables, and am assigning them based on the
value
of
the current date..

Here's a rough version of the SQL Statement I am using (the data goes to
a
csv file btw)

---------------------
declare @FiscalPeriod varchar(30)
declare @Today datetime

select @Today = convert(varchar,getdate(), 106)

select @FiscalPeriod = FiscalPeriod
from Time_Dim
where Date_Time = @Today

select ColA,
ColB
datename(month, @Today) as Month
@FiscalPeriod,
etc...
from MyTable
inner join Time_Dim on MyTable.InsertDate = Time_Dim.DateTime
where Time_Dim.InsertDate = @Today
---------------------

the results of this query are sent to a CSV file for import into another
system.

My Dilemma is that I need to get the datename of the @Today value, and
I'm
pretty sure that this goes beyond the capabilities of GV's. From what
I've
read, they can only be used in a where clause.


I think that I am not going to be able to use GV's in my case.








"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:u13fckw7DHA.2056 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Drop down the combo box and you should find the GV. It is not an
INput
GV
it is an Putput GV.
Yes you can reuse the GV in a datapump. You would do

SELECT ............... FROM Table WHERE col = ?

Click on the parameters button and you can map the GV there.

Watch out for conversions

If you are reusing this in a datapump task then when move it to a GV
can
you
not do

SELECT ...... FROM Table WHERE col =
CONVERT(varchar(50),Getdate(),106)



--

----------------------------

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


"Beema" <none (AT) supplied (DOT) com> wrote in message
news:OTcTlbw7DHA.452 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Hi I've two questions about this.

1. I added the ExecuteSQL Task, with the "select convert...",
clicked
on
Parameters and the list of Input Global Parameters was empty. The
GlobalVariable definitely exists though.

2. I am actually planning on using the GlobalVariable as a parameter
in
an
SQL statement. But the SQL Statement is in a transfer task - as far
as
I
can
see, Global Variables are not usuable in this case are they?


The format "dd mon yyy" is not important, I am using the Global
Variable
as
a parameter in a Where clause, with the column being a datetime -
with
the
time part trimmed off.

Thanks,


----------------------------


"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:OmZbN#v7DHA.3804 (AT) tk2msftngp13 (DOT) phx.gbl...
And you want it in this format dd mon yy

I would assign this to a String datatype global variable

You can do this using DTS 2000 by using the ExecuteSQL task i.e.

SELECT convert(varchar(50),Getdate(),106) as DateRequired

The click the Parameters button and assign it to your Global
Variable
there.












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

Default Re: ActiveX - change global variable - 02-09-2004 , 11:59 AM



Ahh

OK then

If the ExecuteSQL task and further on the DataPump task is failing to parse
and not doing what you want then this can be a problem. It usually a
problem when the ? is in a subquery but this can be worked around by
buliding a statement with the same metadata and plugging the GVs into that

from what I see though you would quite like to do

CONVERT(varchar(50),?,106)

Correct?

Personally I would build the statement in an Active Script task and then
apply it to the appropiate task. This way you will assign it in only only
place as you require.

Global Variables and SQL statements in DTS
(http://www.sqldts.com/Default.aspx?205)


--

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


"Beema" <none (AT) supplied (DOT) com> wrote

Quote:
Yes, however I have 15 of these in various datapumps. And periodically I
need to use a past date, instead of getdate()

Thats' the reason I'm trying to set this date using a GV, as I only have
to
change the date in one place, rather than editing each of the SQL
Statements.


"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:exKUznx7DHA.3380 (AT) tk2msftngp13 (DOT) phx.gbl...
Can you not rework the statement to

select ColA,
ColB
datename(month, Getdate()) as Month,
FiscalPeriod as FiscalPeriod ,
etc...
from
MyTable inner join Time_Dim
on MyTable.InsertDate = Time_Dim.DateTime
where
Time_Dim.InsertDate = convert(varchar,getdate(), 106)




--

----------------------------

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


"Beema" <none (AT) supplied (DOT) com> wrote in message
news:OPvqUVx7DHA.3648 (AT) TK2MSFTNGP11 (DOT) phx.gbl...

It's OK to use GV's in a simple "select.. from... where col=?" But the
select statement in my datapump is a lot more complex.

I have declared local variables, and am assigning them based on the
value
of
the current date..

Here's a rough version of the SQL Statement I am using (the data goes
to
a
csv file btw)

---------------------
declare @FiscalPeriod varchar(30)
declare @Today datetime

select @Today = convert(varchar,getdate(), 106)

select @FiscalPeriod = FiscalPeriod
from Time_Dim
where Date_Time = @Today

select ColA,
ColB
datename(month, @Today) as Month
@FiscalPeriod,
etc...
from MyTable
inner join Time_Dim on MyTable.InsertDate = Time_Dim.DateTime
where Time_Dim.InsertDate = @Today
---------------------

the results of this query are sent to a CSV file for import into
another
system.

My Dilemma is that I need to get the datename of the @Today value, and
I'm
pretty sure that this goes beyond the capabilities of GV's. From what
I've
read, they can only be used in a where clause.


I think that I am not going to be able to use GV's in my case.








"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:u13fckw7DHA.2056 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Drop down the combo box and you should find the GV. It is not an
INput
GV
it is an Putput GV.
Yes you can reuse the GV in a datapump. You would do

SELECT ............... FROM Table WHERE col = ?

Click on the parameters button and you can map the GV there.

Watch out for conversions

If you are reusing this in a datapump task then when move it to a GV
can
you
not do

SELECT ...... FROM Table WHERE col =
CONVERT(varchar(50),Getdate(),106)



--

----------------------------

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


"Beema" <none (AT) supplied (DOT) com> wrote in message
news:OTcTlbw7DHA.452 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Hi I've two questions about this.

1. I added the ExecuteSQL Task, with the "select convert...",
clicked
on
Parameters and the list of Input Global Parameters was empty. The
GlobalVariable definitely exists though.

2. I am actually planning on using the GlobalVariable as a
parameter
in
an
SQL statement. But the SQL Statement is in a transfer task - as
far
as
I
can
see, Global Variables are not usuable in this case are they?


The format "dd mon yyy" is not important, I am using the Global
Variable
as
a parameter in a Where clause, with the column being a datetime -
with
the
time part trimmed off.

Thanks,


----------------------------


"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:OmZbN#v7DHA.3804 (AT) tk2msftngp13 (DOT) phx.gbl...
And you want it in this format dd mon yy

I would assign this to a String datatype global variable

You can do this using DTS 2000 by using the ExecuteSQL task i.e.

SELECT convert(varchar(50),Getdate(),106) as DateRequired

The click the Parameters button and assign it to your Global
Variable
there.














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.