EXEC (select... ) problem Help!
- From: Scagnetti <Scagnetti@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 6 Aug 2005 08:20:03 -0700
How can I get this to work?
declare @WkEmpID
declare @sql varchar(1000)
set @sql = 'select distinct @WkEmpID = EmpID from Employee'
exec (@sql)
Now this is a simplified version of a more comples query which is forcing me
to use this method rather than a simple SQL query. The big problem is getting
the 'EmpID' value into the local variable of '@WkEmpID'. Please help!
.
- Follow-Ups:
- Re: EXEC (select... ) problem Help!
- From: Dandy Weyn [Dandyman]
- Re: EXEC (select... ) problem Help!
- From: Hugo Kornelis
- Re: EXEC (select... ) problem Help!
- Prev by Date: Re: Extracting Latest Date
- Next by Date: Re: EXEC (select... ) problem Help!
- Previous by thread: Extracting Latest Date
- Next by thread: Re: EXEC (select... ) problem Help!
- Index(es):