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 2005 Forums
 SQL Server Administration (2005)
 only inserting one row but multiple rows should be

Author  Topic 

mfitz
Starting Member

5 Posts

Posted - 2008-10-09 : 12:12:09
I have an insert statement:

INSERT INTO #tempFinal
SELECT distinct x.RespondentID
From Respondents4 x with (nolock)
inner join #temp y on x.respondentid = y.respondentid
INNER JOIN RespondentSignupSourceStatus RSSS with (nolock) ON RSSS.RespondentID = x.RespondentID
WHERE EligibleFlag = 1 and RSSS.OrgUnitID = 4

When I run the insert, only 1 row gets inserted.
But when I comment out the actual insert line and run the select statement, I get the correct amount of rows (approx. 20K).

Has anyone seen this type of behavior in SQL 2005 Enterprise SP2?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-09 : 12:15:30
Nope. i have not seen it. It doesnt work that way either. Are you getting any error messages?Also how do come to conclusion that only 1 row gets inserted? from messages tab or checking actual data?
Go to Top of Page

mfitz
Starting Member

5 Posts

Posted - 2008-10-09 : 12:23:05
No error message.

Message tab indicates 1 row inserted.
I checked the table and 1 row was inserted.
Go to Top of Page

mfitz
Starting Member

5 Posts

Posted - 2008-10-09 : 12:38:11
I rebuilt the three indexes on RSSS and it works now.

Visakh16 - thanks for the reply.
Go to Top of Page
   

- Advertisement -