Eirikur Eiriksson (7/25/2014)
Jeff Moden (7/25/2014)
Chand00 (7/25/2014)
Hi,Thank you. Below one worked for me.
$QueryResults[0].Table.Columns.Count
Apologies. I tried to post but I was unable to post somehow. Once again Thankyou
Still, why does this need to be done from PowerShell? What is the overall task that you're trying to accomplish?
Just to supply the T-SQL answer to the thread, the stored procedure sp_describe_first_result_set does the job.
😎
So does a trip to sys.all_columns or sys.columns or INFORMATION_SCHEMA.columns (to name a couple of methods).
I still want to know why someone needs to do this from PowerShell. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.