▼ SQLPS.exe
"C:\Program Files\Microsoft SQL Server\100\Tools\Binn\SQLPS.exe"
▼ C:\Users\chiaki\PSandSQL.ps1
#&"$home\PSandSQL.ps1"
$strSQL = @"
CREATE TABLE tChiaki (f1 int primary key not null, f2 varchar(50))
INSERT INTO tChiaki VALUES (1, 'PowerShell が大好きです!')
INSERT INTO tChiaki VALUES (2, 'SELECT * FROM が大好きです!')
INSERT INTO tChiaki VALUES (3, '1と2でご飯3杯いけます!!')
SELECT * FROM tChiaki
DROP TABLE tChiaki
"@
Invoke-Sqlcmd -ServerInstance "CHIAKIPC\SQLEXPRESS" -Database "chiakiDB" -Query $strSQL | Format-Table -AutoSize
▼ Bing検索結果
つ|invoke-sqlcmd – Bing|
つ|format-table powershell – Bing|
コメント