https://www.mssqltips.com/sqlservertip/5957/sequential-execution-of-sql-server-stored-procedures/
Monday, May 20, 2019
Friday, May 10, 2019
Sunday, May 5, 2019
Get List of Files and Insert to SQL Server Table
Get-ChildItem -Path C:\ETL\EXPORT_FILES |
Select-Object Name, FullName, Extension, CreationTime, Length |
Write-SqlTableData -ServerInstance localhost -DatabaseName ETL -SchemaName import -TableName ImportFileList -Force
Initially loclhost was working but then it stopped with failed to connect message; changed to actual SQL Server instance name
and that worked:
Initially loclhost was working but then it stopped with failed to connect message; changed to actual SQL Server instance name
and that worked:
Get-ChildItem -Path C:\ETL\EXPORT_FILES |
Select-Object Name, FullName, Extension, CreationTime, Length |
Write-SqlTableData -ServerInstance "DESKTOP-U8PAEJC" -DatabaseName "DEV_STAGING" -SchemaName "import" -TableName "ImportFileList" -Force
Get List of Files in Folder and Pipe to Excel
Get-ChildItem -Path C:\ETL\EXPORT_FILES |
Select-Object Name, FullName, Extension, CreationTime, Length |
Export-Excel -Now
Import Excel to SQL Server Table
Import-Excel -Path C:\ETL\EXCEL-FILES\CONTACT.xlsx |
Write-SqlTableData -ServerInstance localhost -DatabaseName ETL -SchemaName import -TableName Contact -Force
-Force on Write-SqlTableData will create anything that doesn't exist; e.g. Databasename, SchemaName, TableName
Saturday, May 4, 2019
Thursday, May 2, 2019
Strings in PowerShell
https://mcpmag.com/articles/2015/07/23/strings-in-powershell.aspx
Note "HERE" string
@"
string content goes here; can be multiple line; can include variables; e.g. $varname
"@
Another way of evaluating a string within a string"
Note "HERE" string
@"
string content goes here; can be multiple line; can include variables; e.g. $varname
"@
Another way of evaluating a string within a string"
$MyName = "State Your Name" "Hello $($MyName), today is $((Get-Date).DayOfWeek)"
Subscribe to:
Comments (Atom)