Thursday, June 25, 2015

Can you use a Here-Strings query to retrieve data using PowerShell?

Yes you can.
You need to understand a few items. Let me go over them.

What is meant by here-strings?

Using a variable in a here-strings:

How to query a SQL Server with SQLCMD?

How do you query a database using PowerShell?
If you review the above articles then you can put together all the information in running a query as shown where the query to the database is in here-strings.

That is all folks!

Here-strings come in very handy when the query contains single quote, double quotes and other such ugly characters which a mere string representation cannot handle.

No comments: