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
 Transact-SQL (2005)
 SQL issue

Author  Topic 

gangadhara.ms
Aged Yak Warrior

549 Posts

Posted - 2009-11-30 : 09:10:17
Dear All,

Today i was working with my database,when i get insert a row to a table always only one row get inserted.I am not sure why it is behaving like this.

Any help..

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-11-30 : 09:26:07
Eh...what do you mean by that? when you insert a row to table, how many row do you expect it to return?
Go to Top of Page

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-11-30 : 09:26:40
Hi

May be am not sure

you can check SET ROWCOUNT

SET ROWCOUNT 0
Then run the SELECT query.

-------------------------
R...
Go to Top of Page

gangadhara.ms
Aged Yak Warrior

549 Posts

Posted - 2009-11-30 : 09:34:44
Hi Visakh, Even when i insert multiple records(rows),when i select i used to get only one row.
After running SET ROWCOUNT 0 its returning all the rows.

Thanks a lot rajdaksha..
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-11-30 : 09:39:57
quote:
Originally posted by gangadhara.ms

Hi Visakh, Even when i insert multiple records(rows),when i select i used to get only one row.
After running SET ROWCOUNT 0 its returning all the rows.

Thanks a lot rajdaksha..


oh...i think somebody set rowcount value to 1 which caused this
Go to Top of Page

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-11-30 : 09:43:24
quote:
Originally posted by gangadhara.ms

Hi Visakh, Even when i insert multiple records(rows),when i select i used to get only one row.
After running SET ROWCOUNT 0 its returning all the rows.

Thanks a lot rajdaksha..



WelCome


-------------------------
R...
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-11-30 : 09:51:28
quote:
Originally posted by gangadhara.ms

Hi Visakh, Even when i insert multiple records(rows),when i select i used to get only one row.
After running SET ROWCOUNT 0 its returning all the rows.

Thanks a lot rajdaksha..


This is why you should check it by

select count(*) from your_table

in case if rowcount is set to some number

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-11-30 : 09:57:16
Hi

Yes we can also use
SELECT COUNT(*) FROM <table_name>

thanks madhi..


-------------------------
R...
Go to Top of Page
   

- Advertisement -