BruceRobertson

ExecuteSQL List Operations?

Discussion created by BruceRobertson on Aug 1, 2012
Latest reply on Aug 2, 2012 by Mike_Mitchell

Is it possible to use ExecuteSQL to operate on lists?

 

See for instance this discussion on selecting distinct values from a list:

 

http://stackoverflow.com/questions/1564956/how-can-i-select-from-list-of-values-in-sql-server

 

Which says that this construct works for SQL Server 2008:

 

select distinct * from (values (1), (1), (1), (2), (5), (1), (6)) as X(a)

 

I have tried doing the above as follows but it doesn't work:


ExecuteSQL( "select distinct * from (values (1), (1), (1), (2), (5), (1), (6)) as X(a)"; ""; "")

Outcomes