SQL Server: How to iterate over function arguments

Posted by atricapilla on Stack Overflow See other posts from Stack Overflow or by atricapilla
Published on 2010-04-30T11:54:08Z Indexed on 2010/04/30 11:57 UTC
Read the original article Hit count: 271

I'm trying to learn SQL and for demonstration purposes I would like to create a loop which iterates over function arguments. E.g. I would like to iterate over SERVERPROPERTY function arguments (propertynames). I can do single select like this:

SELECT
SERVERPROPERTY('ProductVersion') AS ProductVersion,
SERVERPROPERTY('ProductLevel') AS ProductLevel,
SERVERPROPERTY('Edition') AS Edition,
SERVERPROPERTY('EngineEdition') AS EngineEdition;
GO

but how to iterate over all these propertynames? Thanks in advance.

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server-2005