sql: bcp eporting and xml importing

5
XML Exporting and Importing Presentation by Aaron Buma Development DBA

Upload: aaron-buma

Post on 23-Feb-2017

284 views

Category:

Software


0 download

TRANSCRIPT

Page 1: SQL: BCP Eporting and XML Importing

XML Exporting and Importing

Presentation by Aaron BumaDevelopment DBA

Page 2: SQL: BCP Eporting and XML Importing

Exporting Using BCP

• BCP: Bulk Copy Program– Give a SQL statement, Get a file with results

• Access from Command Prompt/Powershell

• 1) BCP “Statement” queryout {file location} {username/password/Trusted} {Server}

Page 3: SQL: BCP Eporting and XML Importing

Importing XML from a file

• Use OPENROWSET() to pull file into memory

• Use OPENXML to point to the file and shred

Page 4: SQL: BCP Eporting and XML Importing

DEMO

Page 5: SQL: BCP Eporting and XML Importing

Review• BCP data from database to file• OPENROWSET and OPENXML to pull XML out of file

Presentation Recording, Slides and Scripts– Available at:

http://www.aaronbuma.com/category/sql-training/– Contact:

Email: [email protected]