In this video, learn how to insert data into tables with PowerShell.
- [Narrator] Once we've got our tables created, … next thing we need to do, insert some data. … So, like most things, … there's a couple different ways we can do this. … We can either use SQLPS so we can write data … into the table using the new Write-SqlTableData cmdlet … that was introduced in PowerShell 5, … or we can use Native T-SQL to do the insert. … Really depends on what we want to do. … Now, if you're using an older version of PowerShell, … so you don't have v5 of PowerShell available, … then I would have said the Native T-SQL … is going to be the right way to go, … because writing data to a table through PowerShell … would have been extremely complex … up through PowerShell v4. … Starting with PowerShell v5, however, … now we've got the Write-SqlTableData cmdlet … that we can use to insert data, … and we can do it very, very quickly and easily. … So now I'm switching over from T-SQL … as the right option more towards … the SQL PowerShell might be the way to go … with this Write-SqlTableData cmdlet. …
Author
Updated
6/24/2019Released
6/21/2019- When PowerShell can be particularly useful
- Connecting to SQL Server from PowerShell
- Closing connections
- Creating objects in PowerShell
- Creating tables, views, and procedures
- Querying data in PowerShell
- Using loops in PowerShell
- Exporting CSV files and XML data
Skill Level Intermediate
Duration
Views
Related Courses
-
Learning PowerShell
with Matt Hester1h 23m Beginner -
SQL Server 2017: What's New
with Adam Wilbert1h 22m Beginner
-
Introduction
-
Download tools1m 35s
-
1. PowerShell in SQL Server
-
When PowerShell is useful2m 35s
-
Open-source solutions1m 47s
-
2. Connecting to SQL Server from PowerShell
-
Declaring objects3m 5s
-
Connecting to SQL Server3m 55s
-
Parameters in PowerShell2m 33s
-
Closing connections1m 22s
-
Disposing connections2m 4s
-
Object reuse2m 46s
-
-
3. Creating Objects in PowerShell
-
Creating databases2m 58s
-
Creating tables4m 9s
-
Creating views3m 44s
-
Creating procedures4m 33s
-
-
4. Querying Data in PowerShell
-
Inserting data into tables3m 48s
-
-
5. Looping Through Servers in PowerShell
-
Loops in PowerShell6m 21s
-
Concepts of threading6m 10s
-
Authentication and threading3m 24s
-
Piping between objects3m 17s
-
Exporting CSV files2m 56s
-
Importing CSV files2m 27s
-
Exporting XML data2m 50s
-
Importing XML data2m 26s
-
-
6. PowerShell Remoting
-
What is remoting?5m 18s
-
Removing over HTTP ports2m 11s
-
Enabling remoting via GPO3m 16s
-
Starting a remote session1m 59s
-
Ending a remote session1m 31s
-
Invoking a remote command2m 48s
-
-
Conclusion
-
Next steps33s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Inserting data into tables