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

Pass Variable to Precendant Constraint Expand / Collapse
Author
Message
Posted Monday, May 4, 2009 3:06 PM
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: Wednesday, October 22, 2014 2:51 PM
Points: 3,840, Visits: 3,848
Whoo Hooo!! Glad you got it figured out.



John Rowan

======================================================
======================================================
Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
Post #709759
Posted Friday, October 4, 2013 4:44 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, March 6, 2014 1:35 AM
Points: 175, Visits: 547
Glad you got it working.

Jody Claggett-376930 (5/1/2009)

In an Execute SQL task I have the following configuration:
Result Set = Single Row
SQLStatement = SELECT COUNT(ID) AS CheckData FROM Table_A


Compare these in the execution plan.
SELECT COUNT(ID) AS CheckData FROM Table_A

SELECT TOP 1 CAST(ISNULL([Rows], 0) AS Int) CheckData
FROM sys.Partitions P
WHERE P.[Object_ID] = OBJECT_ID('Table_A')

The bigger the table, the faster the second query will be in comparison.




For better, quicker answers on T-SQL questions, read Jeff Moden's suggestions.

"Million-to-one chances crop up nine times out of ten." ― Terry Pratchett, Mort
Post #1501521
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse