Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Stored procedure didn't INSERT all records

Author  Topic 

andru
Starting Member

10 Posts

Posted - 2005-03-16 : 05:07:32
I wrote a stored procedure to INSERT roughly 20000 records into a table and called the procedure from ACCESS.

The procedure only entered exactly 10000 records.

So I broke the procedure up into 10 parts and all the records were entered correctly.

But this is a pain and I want t be able to properly automate this procedure.

Does anyone know why SQL Server 2000 would only INSERT 10000 records at a time?

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-03-16 : 05:18:54
is there an error you get back when inserting 20k rows?

Go with the flow & have fun! Else fight the flow
Go to Top of Page

andru
Starting Member

10 Posts

Posted - 2005-03-16 : 05:46:52
Spirit1,

No error reported!!! I found it myself when querying the data.
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-03-16 : 05:58:17
how do you insert it?
can you show us the insert statemnet?
do you have enough space on the disk so your transaction logs can grow?


Go with the flow & have fun! Else fight the flow
Go to Top of Page

andru
Starting Member

10 Posts

Posted - 2005-03-16 : 07:22:43
Here's the code:

INSERT INTO dbo.tbl_T_MarkSheet
(AdNo, TeacherClass)
SELECT CMIS_ADMIN.STUD_ADMIN.STUGROUPS.StudentId + 0 AS adno, dbo.tbl_TeacherClasses.id AS teacherclass
FROM CMIS_ADMIN.STUD_ADMIN.STUGROUPS INNER JOIN
dbo.tbl_TeacherClasses ON dbo.tbl_TeacherClasses.CMIS_GroupId = CMIS_ADMIN.STUD_ADMIN.STUGROUPS.GroupId
WHERE (dbo.tbl_TeacherClasses.InMID = 43) AND (CMIS_ADMIN.STUD_ADMIN.STUGROUPS.SetId = 0405)

The server is getting quite full apparently.

Thanks!!
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-03-16 : 07:24:16
i guess your problem is transaction log growth then.
split the insert into 2 inserts or three, that shouldn't be that much of a problem with anything.

Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -