August 26, 2011 at 10:45 am
Ok.. Here is what I have:
I am using: foreach ($SqlServer in get-content "F:\Powershell_Apps\Zero_Data_Tables\SQL_Servers.txt")
To get all of my Sql Servers that I need to search each database..
My connection is: $con = "server=$SqlServer;database=DBName;Integrated Security=sspi"
My query is: $SqlQuery = "select $SqlServer,DatabaseName,TableName,Rows from Zero_Data_Tables"
But it is not liking the $SqlServer so if I take it out it works fine...
Any suggestions...
August 26, 2011 at 1:10 pm
I found a solution...
$SqlQuery = "select " + $SqlServer + ",DatabaseName,TableName,Rows from Zero_Data_Tables"
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy