Powershell und SQL Insert
Auf http://richardspowershellblog.wordpress.com/2007/04/19/insert-values-to-a-sql-server-table/ habe ich ein kurzes Statement gefunden, um per Powershell Einträge in einer SQL Datenbank vorzunehmen.
# open connection to the server $conn = New-Object System.Data.SqlClient.SqlConnection("Data Source=localhost; Initial Catalog=Posh; Integrated Security=SSPI") $conn.Open() # create command object $cmd = $conn.CreateCommand() # create statement $cmd.CommandText ="INSERT myTable VALUES ('Hello', 'World', 123)" # execute command $cmd.ExecuteNonQuery() # close connection $conn.Close() |