December 2001
Intermediate to advanced
800 pages
17h 55m
English
Sp_readtextfile allows you to read a text file on the SQL Server machine (or a machine accessible to it on the network) and either return it as a result set or store the first 8,000 bytes of it in an output parameter. The code is presented in Listing 21-1.
USE master
GO
IF OBJECT_ID('sp_readtextfile') IS NOT NULL
DROP PROC sp_readtextfile
GO
CREATE PROC sp_readtextfile @textfilename sysname,
@contents varchar(8000)='Results Only' OUT /* Object: sp_readtextfile Description: Reads the contents of a text file into a SQL result set Usage: sp_readtextfile @textfilename=name of file to read, @contents=optional output var to receive contents of file (up to 8000 bytes) Returns: (None) $Author: Ken Henderson ... |
Read now
Unlock full access