Copy Code code as follows:
Set ANSI_NULLS on
SET QUOTED_IDENTIFIER ON
Go
-- =============================================
--Author: Hua Ling
--Create date:2008-10-28
--Description: Generate Insert script for table data
--demo:exec Pcreateinsertscript ' bexmcodetype ', ' Dictypeid = 61 '
-- =============================================
ALTER proc [Dbo].pcreateinsertscript (@tablename varchar (2
Stored Procedures | scripts | data | databases
CREATE Procedure Dbgendata
? @tableName? Varchar (m)?--table name
As
DECLARE @columnName VARCHAR (100)?? --Column Name
DECLARE @TypeName VARCHAR (100)?? --Data type
DECLARE @columns VARCHAR (3000)??? --
DECLARE @columnsAndhead VARCHAR (3000)?--
SET @columnsAndhead = ' INSERT into ' + @tableName + ' ('
SET @columns = '
?--Get all field names for a
@ columndata =''Fetch next from syscolumns_cursor into @ name, @ xtypeWhile @ fetch_status BeginIf @ fetch_status BeginIf @ xtype not in (189,34, 35,99, 98) -- timestamp does not need to be processed. Image, text, ntext, SQL _variant will not be processed for the moment.BeginSet @ column = @ column + case when Len (@ column) = 0 then 'else', 'end + @ nameSet @ columndata = @ columndata + case when Len (@ columndata) = 0 then ''else', '','', 'end+ Case when @ xtype in (167,175) Then ''' + '+ @ n
Tags: and ini namespace back erro init Test exe imgADO has a sqlbulkcopy, but the one in XML format, the amount of data transmitted by the network is too large. Implement one yourself, transfer as few bytes as possible. Performance is not compared, you need to take the test.1 usingSystem.Data.SqlClient;2
3 namespaceRaywindstudio.dal {4
5 ///
6 ///MSSQL BULK INSERT Table7 ///
8 Public Static classSqlbulkinsert {9
Ten Priva
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.