Sharath S
asked on
Retrieving data using select SQL statement in Powershell
This URL stackoverflow.com/question s/1758779/ retrieving -data-usin g-select-s ql-stateme nt-in-powe rshell helped in retrieving data from SQL query into a variable.
I would like to enhance this to retrieve multiple values.
$SqlCmd.CommandText = "select column1,column2 from table1"
$column1 = $SqlCmd.ExecuteScalar()
How can I assign column2 value into a variable.
Thanks
Sharath
I would like to enhance this to retrieve multiple values.
$SqlCmd.CommandText = "select column1,column2 from table1"
$column1 = $SqlCmd.ExecuteScalar()
How can I assign column2 value into a variable.
Thanks
Sharath
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for pointing to use Executereader. Somehow, I am getting issues with this. I used a different approach to get the work done. Thanks.
ASKER