Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Selected values in a macro

Author  Topic 

Ciccic
Starting Member

1 Post

Posted - 2011-10-24 : 10:41:21
Hello, I anticipate you that I just started using sql and I'm not very good.

I need to select an array of value from a table and use them in a macro as parameter 1
exec macro(parameter1, parameter2...)

I tried to write something as
exec macro(
Select array1
from ...
where...
group by array1 ), parameter2...)

but it doesn't work.
Could you help me?

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-10-24 : 10:50:07
macro = function / stored procedure
Are you using sql server?

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-24 : 11:13:20
you need to use cursor or apply operator depending on whether you're using a procedure or function.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -