CHAPTER 10

image

Creating Data Import Scripts

We’ve just seen, in some detail, how the BULK INSERT statement can be used to import files into database tables. Unfortunately, there are some limitations with BULK INSERT, which meant we had to remove one of our contact records from the appropriate files.

Fortunately, T-SQL can come to our rescue. In this chapter, we are going to create a script to insert a contact record and its associated child records (addresses, phone numbers, and so on). I’ll introduce lots of new T-SQL terms in this chapter, so hold your nose and jump in!

Purpose of the Import Script

Our aim is to successfully add Roald Dahl to the ...

Get Introducing SQL Server now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.