.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
Imran Ghani
Post New Web Links

set rowcount

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :ASP.Net
 

 there is a stored procedure contrain set rowcount.

create proc a
as
set rowcount 2
select * from tableA
set rowcount 0

create proc b
as
set rowcount 10
select * from tableA
set rowcount 0

is there any problem when i use proc a and proc b in the same time




View Complete Post


More Related Resource Links

Is it possible to prevent seeing results if rowcount is small?

  
Hi, we are about to start a new project. In the project we won't be owning the data to be analysed. The data provider is going to require some special rules for the usage of data. This is because the nature of data the - the data is going to be information sensitive. They are asking if we could implement a restriction which would prevent to see results rows if there is less than five result rows. I couldn't find any ideas how this could be done. Is it possible? How? We are running Sql Server 2008. Thank you in advance, Teemu Ajalin

How to find the rowcount of the dataset in a report

  

I have a report.

In one of the text field i have to show the rowcount of the dataset

How can i do that


Need help in splitting using Rowcount

  

Hi All,

 

I am somewhat new to SSIS, and working on a package which combines combines the data from 3 different sql queries using Union All, then checks the Row Count and decides whether to create the destination flat file or now.

My intention is to skip the creation of a blank file in case if no rows exist in the result set, and create it only if data rows are passed.

My current data flow sequence is as follows:

3* OLE Db source
Union All
RowCount
Conditional Split

I am able to get the data past the RowCount component but unable to use conditional split transform to split the output based on Rowcount, since it does not let any data through based on the value of the Rowcount variable.

I have seen some scenarios that use Script component to get the split done, but not sure how to compare the variable value, and if any input columns need to be passed as inputs.

Can someone please point me on how to get this done?

Thanks

Akhil

 

 


@@ROWCOUNT

  

Hi Experts,

How to execute below query, I'm getting error:-

DECLARE @SIRID INT

SET @SIRID = 0
SET ROWCOUNT 10

CREATE TABLE #TEMP
(
	ID		INT
)

WHILE @@ROWCOUNT > 0
BEGIN

	INSERT INTO #TEMP VALUES (@SIRID);
	SET ROWCOUNT = ROWCOUNT - 1;
	SET @SIRID = @SIRID = 1;

END

SET ROWCOUNT 0

SELECT *
	FROM #TEMP

DROP TABLE #TEMP

Any Help?

Regards,

Kumar


@@Rowcount returning incorrect value on second try

  

Hi all,

I have what I think is some rather strange behavior using @@Rowcount in SQL Server 2005.

Basically, in some T-SQL I'm coding I've been trying to use @@Rowcount after an INSERT to count how many rows were affected.  However, I've been finding that although the code works properly the first time I run it, on subsequent occasions it gives me a zero count for @@Rowcount.  I wrote some test code to see if this is a repeatable problem and it seems to be. 

Below is my test code.  Basically, it goes as follows:

  • Create a table containing some lines of fake data
  • Create a temp table to store the rowcount from a select statement
  • Select all the rows in the fake data table and update the temp table with the value of @@Rowcount
  • Show me the temp table result
  • Delete the temp tables i created

Now the first time I run this code in a query window, the @@Rowcount is stored in the temp table correctly (100 rows affected).  If I rerun it, the value stored is zero.  All subsequent times I run it, I always get zero.  If I add a blank line, or some comment, or otherwise modify the code, sometimes it will run correctly again, but the next time gives me zero.  It seems very odd.

Now I can get around it by storing @@rowcount in a variable instead of a table entr

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend