Postgresql Function Store Select Into Variable Sql Server