使用C#.NET 2.0的SQL BULK复制问题 [英] SQL BULK Copy Problem using C#.NET 2.0

查看:49
本文介绍了使用C#.NET 2.0的SQL BULK复制问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我是使用C#.NET和SQL Server 2005进行.NET可视化编程的初学者

i am beginner in .NET visual programming using C#.NET with SQL Server 2005

我正面临着SQL Server中的一个问题。假设我有一张下面的表格。
-------------------------------------- ----------
表名是"A"
---------------------------- --------------------
1米歇尔管理员
2约翰消费者财务官
3杰克逊雇主
4 Goeffery Empl0yer

i am facing a problem in SQL Server. suppose I have a table given below..
------------------------------------------------
Table name is "A"
------------------------------------------------
1     Michle      Administrator
2     John        Consumer Finance Officer
3     Jackson    Employer
4     Goeffery   Empl0yer

------------------------------------------- -----
这里的标识列是第一个。现在,如果我删除第二行,这个表就像那样-------------------------------- --------------
表名是"A"
------------------------ ------------------------
1 Michle管理员
3杰克逊雇主
4 Goeffery Empl0yer

------------------------------------------------
Here the identity column is the first one. Now if i delete the 2nd row the this table becomes like that
------------------------------------------------
Table name is "A"
------------------------------------------------
1     Michle      Administrator
3     Jackson    Employer
4     Goeffery   Empl0yer

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

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

现在我有另一个表"B"具有相同的结构(3列,第一列是标识列)。现在,如果我将表"A"中的所有数据移动到表"B",那么原始序列将被取消,表"B"包含这样的数据。

Now i have an another table "B" having same structure (3 columns and first column is the identity column). Now if i move the all the data from table "A" to table "B" then the original seqeunce is distrubed the table "B" contains the data like this.


- -----------------------------------------------结果表名是"B"
----------------------------------------- -------
1米歇尔管理员
2杰克逊雇主
3 Goeffery Empl0yer


------------------------------------------------
Table name is "B"
------------------------------------------------
1     Michle      Administrator
2     Jackson    Employer
3     Goeffery   Empl0yer

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

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


但是我需要第一列是标识列,但编号顺序必须与表"A"中的编号相同才能保留关系......就像那样......


but i need that what ever the first column is identity column but sequence of numbering must be same as the numbering in the table "A" to preserve the relationships.... like that...

结果----------------------------------------------- -
表名是"B"
------------------------------------- -----------
1 Michle管理员
3杰克逊雇主
4 Goeffery Empl0yer


------------------------------------------------
Table name is "B"
------------------------------------------------
1     Michle      Administrator
3     Jackson    Employer
4     Goeffery   Empl0yer

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

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

<等你的r esponce。我非常感谢你解决我的问题。


waiting for ur responce. i will very thankful to you to solve my problem.

注意: - 使用SQLBULKCOPY命令移动.....

Note:- the is moved using SQLBULKCOPY command.....


谢谢....
上帝保佑你无论如何。


Thanks....
God Bless u By all means.

推荐答案

转移到更合适的论坛。

这篇关于使用C#.NET 2.0的SQL BULK复制问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆