This will do what you want(Select first 2 columns)Use pubsDeclare @s varchar(2000)set @s=''Select @s=@s+','+Column_Name from Information_Schema.columns where Table_Name='authors' and Ordinal_Position in (select top 2 Ordinal_Position from Information_Schema.columns where Table_Name='authors' order by Ordinal_Position )set @s =substring(@s,2,len(@s)-1)Exec('select '+@s+' from authors')Create a stored procedure based on this having parameters and supply the table,number of columnsMadhivananFailing to plan is Planning to fail