DATETIME SELECT SELECT INTO DATE PAD STRING DYNAMIC SQL CURSOR MONEY FORMAT PERCENT STORED PROCEDURE SQL SERVER AGENT JOB OPTIMIZATION WHILE LOOP OVER PARTITION BY UPDATE
SITE SEARCH SQLUSA.com HEADLINES NEWS
SQL E/BOOKS   SQL 2014 PROGRAMMING   DOWNLOADS
SCRIPTS SQL 2005 SQL 2008 ARTICLES
SQL JOBS TWITTER FORMAT VIDEOS
How import and export document column data?

Execute the following Microsoft SQL Server T-SQL script to demonstrate character-based document import and export.

------------

-- SQL Server import/export character-based large objects (CLOBs)

-- File types .txt, .doc, .xls, .xlsx, .pdf, etc.

------------

-- Create file K:\temp\CLOBTest.txt with notepad: 10 lines of 0123456789

USE tempdb;

GO

CREATE TABLE TestCLOB( ID INT IDENTITY(1,1) PRIMARY KEY, Doc nvarchar(max) NOT NULL)

GO

-- Import CLOB

INSERT INTO TestCLOB(Doc)

SELECT *

FROM OPENROWSET (

BULK 'K:\temp\CLOBTest.txt', SINGLE_CLOB) AS CharFile

GO

 

-- Export CLOB

DECLARE @BCPcommand NVARCHAR(1024)

SET @BCPcommand = 'bcp "SELECT TOP 1 Doc FROM tempdb.dbo.TestCLOB" queryout "K:\temp\CLOBTestOut.txt"  -T -c -C RAW -SYOURSERVER'

EXEC xp_cmdshell @BCPcommand

GO

DROP  TABLE TestCLOB

------------

 

SSIS Import / Export Solutions for LOB transfer:

      Export Column & Import Column Transformations

 

Exam Prep 70-461
Exam 70-461
DATETIME SELECT SELECT INTO DATE PAD STRING DYNAMIC SQL CURSOR MONEY FORMAT PERCENT STORED PROCEDURE SQL SERVER AGENT JOB OPTIMIZATION WHILE LOOP OVER PARTITION BY UPDATE