Viewing 15 posts - 106 through 120 (of 686 total)
This works but sends an email for every table listed in query .. It's the "For Each" ... How can I issue just 1 email and list all of the
results...
February 7, 2023 at 2:36 pm
Trying to goggle now to find eamples based upon what I have as Input above.
February 7, 2023 at 1:31 pm
Thanks for all comments and suggestions.
foreach ($Row in $DataSet.Tables[0].Rows)
{
write-host "Processing" $Row.Column1
$Capuretbl = $Row.Column1
$queryData = "
Insert into dba_usage.dbo.Tbl_Alerts...
February 6, 2023 at 1:24 am
I changed this piece:
select table_schema+'.'+table_name from INFORMATION_SCHEMA.COLUMNS where COLUMN_NAME like '%DateStored%' order by TABLE_NAME
It's throwing up the error: It's getting the correct schema owner and Table ...
Exception calling "Fill" with...
February 2, 2023 at 2:26 pm
I ran a test with dbo schema, and it works great, but these tables I'm querying have a different schema owner.
February 2, 2023 at 12:30 pm
Just something I wanted to try to use PoSh..
ANy ideas on the schema owner issue ?
Thanks everyone.
February 2, 2023 at 11:38 am
How do I get around schema owner <> dbo.. ?
Thanks.
February 2, 2023 at 2:13 am
This is what I came up with.
$server = "sqltest"
$database = "dbastuff"
$tablequery = "select table_name from INFORMATION_SCHEMA.COLUMNS where COLUMN_NAME like '%DateStored%' order by TABLE_NAME"
#Delcare Connection Variables
$connectionTemplate =...
February 2, 2023 at 2:04 am
Sorry no tables that are queried will change.. this is a static mature environment ..
February 1, 2023 at 7:52 pm
I would manually update the file from a folder, and this list of tables won't change. The alert will run daily maybe every x hours..
We had an issue where table...
February 1, 2023 at 6:06 pm
Thanks Thom for the SQL piece.
February 1, 2023 at 5:30 pm
This DB is running on a SQL2012 box
February 1, 2023 at 5:29 pm
I would use a File as a list.
Thx.
February 1, 2023 at 5:28 pm
Was trying to keep it in script if possible.
Thx.
February 1, 2023 at 4:17 pm
yeah thinking the script in PS so if needed updated adding more tables to list would be easy to update script rather than having someone having to use SSMS to update...
February 1, 2023 at 4:03 pm
Viewing 15 posts - 106 through 120 (of 686 total)