如何将记录从另一个表插入数据集? [英] how to insert record from another table to dataset?
问题描述
截至目前我正在使用我的sql server 2000中的存储过程来
从另一个表中插入记录。我现在需要的是如何通过不使用存储过程来插入记录并使用
数据集插入记录。
这是我存储过程中的代码..
创建过程AddRegularLoad
@SchYrSemID为int,@ ProgramID为int,@ Sem为varchar(50),@年为
int
AS
BEGIN
>
SET NOCOUNT OFF
INSERT INTO SchYrSemCourseJoin(CourseID,SchYrSemID)
SELECT CourseID,@ SchyrSemID
FROM RegularLoad INNER JOIN [RegularLoad Details] ON
RegularLoad.RegularLoadID = [RegularLoad Details] .RegularLoadID
WHERE ProgramID = @ ProgramID AND Year = @ Year AND Semester = @ Sem;
结束
GO
as of now i am using a stored procedure from my sql server 2000 to
insert record from another table. what i need now is on how can i
insert record by not using the stored procedure and insert it using
dataset.
here is my code in stored procedure..
CREATE PROCEDURE AddRegularLoad
@SchYrSemID as int, @ProgramID as int, @Sem as varchar(50), @Year as
int
AS
BEGIN
SET NOCOUNT OFF
INSERT INTO SchYrSemCourseJoin ( CourseID, SchYrSemID )
SELECT CourseID, @SchYrSemID
FROM RegularLoad INNER JOIN [RegularLoad Details] ON
RegularLoad.RegularLoadID = [RegularLoad Details].RegularLoadID
WHERE ProgramID=@ProgramID AND Year=@Year AND Semester=@Sem;
END
GO
推荐答案
" jaYPee" ; <喜****** @ yahoo.com> schrieb
"jaYPee" <hi******@yahoo.com> schrieb
截至目前我正在使用我的sql server 2000中的存储过程来从另一个表中插入记录。我现在需要的是如何通过不使用存储过程来插入记录并使用数据集插入它。
[...]
INSERT INTO SchYrSemCourseJoin(CourseID, SchYrSemID)
SELECT CourseID,@ SchYrSemID
FROM RegularLoad INNER JOIN [RegularLoad Details] ON
RegularLoad.RegularLoadID = [RegularLoad Details] .RegularLoadID
WHERE ProgramID = @ ProgramID AND Year = @Year和Semester = @ Sem;
as of now i am using a stored procedure from my sql server 2000 to
insert record from another table. what i need now is on how can i
insert record by not using the stored procedure and insert it
using dataset.
[...]
INSERT INTO SchYrSemCourseJoin ( CourseID, SchYrSemID )
SELECT CourseID, @SchYrSemID
FROM RegularLoad INNER JOIN [RegularLoad Details] ON
RegularLoad.RegularLoadID = [RegularLoad Details].RegularLoadID
WHERE ProgramID=@ProgramID AND Year=@Year AND Semester=@Sem;
IMO,这里的数据集没有意义。你不想把数据加载到
内存中,而这就是数据集的用途。我认为SP已经是最好的解决方案了。
更多ADO.Net:microsoft.public.dotnet.framework.adonet
-
Armin
如何报价以及原因:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
IMO, a dataset doesn''t make sense here. You don''t want to load data into
memory, and that''s where the dataset is used for. I think the SP is already
the best solution.
More ADO.Net: microsoft.public.dotnet.framework.adonet
--
Armin
How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
" Armin Zingler" < AZ ******* @ freenet.de> schrieb
"Armin Zingler" <az*******@freenet.de> schrieb
进入内存,这就是数据集的用途。我认为SP
into memory, and that''s where the dataset is used for. I think the SP
......数据集的用途是什么..
-
Armin
...what the dataset is used for..
--
Armin
不知道你的意思是......这个数据集用于存储来自我的表格的
的数据我的sql server 2000.我是对的吗?
周五,2004年4月23日10:14:12 +0200,Armin Zingler
< az *** ****@freenet.de>写道:
don''t know wat u mean...this dataset is used to stored the data from
my table from my sql server 2000. am i right?
On Fri, 23 Apr 2004 10:14:12 +0200, "Armin Zingler"
<az*******@freenet.de> wrote:
" Armin Zingler" < AZ ******* @ freenet.de> schrieb
"Armin Zingler" <az*******@freenet.de> schrieb
进入内存,这就是数据集的用途。我认为SP
into memory, and that''s where the dataset is used for. I think the SP
..数据集用于什么..
..what the dataset is used for..
这篇关于如何将记录从另一个表插入数据集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!