davesnb
asked on
invoke-sqlcmd help
Hello EE,
If I wish to invoke the sql from another server using invoke-sqlcmd, does it have to be a sql input file , or can I use the invoke-sqlcmd remotely ?
If I wish to invoke the sql from another server using invoke-sqlcmd, does it have to be a sql input file , or can I use the invoke-sqlcmd remotely ?
Invoke-Sqlcmd -ServerInstance "SERVER-SQL03" - ((Get-Item SQLSERVER:\SQL\SERVER-SQL03\DEFAULT).ReadErrorLog())
ASKER
If I wish to run a powershell cmdlet such as get-item , can the invoke-sqlcmd be used as per example provided ?
I'm not a PS specialist. I can perform only the basic stuffs.
Let's wait for somebody with better skills in PS.
Let's wait for somebody with better skills in PS.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OK thank you
If you can run a query without providing a script with the query? Then yes, you can, as the below example shows:
Open in new window