Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Beginning SQL Server - Limit Your Queries Expand / Collapse
Author
Message
Posted Friday, July 30, 2004 4:52 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Yesterday @ 6:53 PM
Points: 31,177, Visits: 15,623
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnist






Follow me on Twitter:
@way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #129450
Posted Sunday, August 22, 2004 5:52 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, September 25, 2014 8:03 AM
Points: 28, Visits: 151
Perfect for a newbie like me!


-gol
Post #133252
Posted Friday, April 14, 2006 8:08 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Monday, December 27, 2010 2:30 PM
Points: 312, Visits: 17

Isn't this bad since it will lock the rows you're viewing?  I started out with EM, but now I couldn't live without query analyzer.

 

 

Post #273355
Posted Friday, April 14, 2006 9:59 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, October 18, 2012 7:50 AM
Points: 30, Visits: 78
The link to part one goes to the part 2 page. Is it supposed to go to this:
http://www.sqlservercentral.com/columnists/sjones/beginningsqlserver2000administrationpart1.asp
?
Post #273384
Posted Friday, April 14, 2006 11:25 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, October 13, 2014 4:42 PM
Points: 1,618, Visits: 1,549

I think it was a great article for beginners. I also think the EM is a great tool for beginners to start with and Query Analyzer should be tought as the next step up.





My blog: SQL Soldier
Twitter: @SQLSoldier
My book: Pro SQL Server 2008 Mirroring
Microsoft Certified Master: SQL Server 2008
Principal DBA: Outerwall, Inc.
Also available for consulting: SQL DBA Master
Post #273405
Posted Monday, April 17, 2006 8:42 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, October 17, 2014 3:17 PM
Points: 30, Visits: 298
I think the only thing you should teach is how to lock themselves out of they system until they get some training.


Post #273552
Posted Monday, April 17, 2006 10:12 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Thursday, September 25, 2014 2:58 PM
Points: 3,173, Visits: 1,267

Thanks Steve. Great article. I have a question the might be slightly off topic. What would be the best way in sql server 2000 to write a stored proc that takes the row limit as an argument?

 

CREATE PROCEDURE MyTestProc

@rowlimit

AS

 

??????

-Kevin Williams




Post #273585
Posted Tuesday, April 18, 2006 11:07 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 4:48 PM
Points: 2,555, Visits: 603
You could do something like this...

Set Rowcount @rowlimit

select col1, col2 from myTable where...








**ASCII stupid question, get a stupid ANSI !!!**
Post #273723
Posted Tuesday, April 18, 2006 11:12 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Thursday, September 25, 2014 2:58 PM
Points: 3,173, Visits: 1,267
Thanks. Worked great.


Post #273724
Posted Tuesday, April 18, 2006 11:16 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, October 13, 2014 4:42 PM
Points: 1,618, Visits: 1,549

Just be careful. There are certain circumstances where Set RowCount is ignored. Also, the RowCount will stay set within your procedure until the procedure either ends or you turnit off (Set ROWCOUNT = 0 turns it off).

If not used carefully, Set RowCount can cause you a lot of problems, and you won't realize it until it's too late.

Personally, I would advocate building the query dynamically and using Exec() or sp_executesql to execute it.





My blog: SQL Soldier
Twitter: @SQLSoldier
My book: Pro SQL Server 2008 Mirroring
Microsoft Certified Master: SQL Server 2008
Principal DBA: Outerwall, Inc.
Also available for consulting: SQL DBA Master
Post #273725
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse