To Select from list of values in SQL Server (T-SQL), you just need to re-arrange the VALUES constructor, often used in table inserts.

 

Example

SELECT * FROM

(VALUES

('MV_U', 'TEST1', 'TESTa', getdate(), '1', '2'),
('MV_P', 'TEST2', 'TESTa', getdate(), '1', '2'),
('DM_U', 'TEST3', 'TESTa', getdate(), '1', '2'),
('DM_P', 'TEST4', 'TESTa', getdate(), '1', '2'))

AS temp(a,b,c,d,e,f)

 

Share This Via: