We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Connecting to SQL Server from Powershell to retrieve data

YZlat
YZlat asked
on
Medium Priority
542 Views
Last Modified: 2012-05-11
I need a powershell function that takes one parameter, connects to SQL Server database and retrieves data based on input parameter

SELECT Field1 FROm Table1 WHERE Field2=@parameter

Comment
Watch Question

Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT

Author

Commented:
Let me try that.

Is there a way to put it all into a function and then call that function from my script?
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.