Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Write Output to File

$
0
0

Hell everyone.

I'm doing an import into SQL in Powershell and I need a little assistance to learn how to write the results to a file called success.txt.

The code:

Powershell
$ConnectionString="Server=S1701008\MSSQLSERVER;Database=TEST_TempProbeData;User Id=xxx\xxxx;Password=xxxx"$sql="BULK INSERT dbo.HourlyTempsAll FROM 'F:\Data\TempProbeData\tempimport.txt' WITH (FIELDTERMINATOR = '\t',ROWTERMINATOR = '\n',Lastrow = 26)"Invoke-Sqlcmd-ConnectionString$ConnectionString-Query$sql

Any help would be appreciated as I am very new to PS.

Thanks!


Viewing all articles
Browse latest Browse all 15370

Trending Articles