|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, November 29, 2011 4:36 PM
Points: 129,
Visits: 37
|
|
| Thanks Jacob for your valuable suggestion. Definitely I will try to implement it and let you know if I face any issue. Could you please tell me any other solution where I don't have to create any sp in remote server because we are not the owner of that server and it would be difficult to get permission to create a stored procedure in that server. It is fine if I create a SP in our server (the server belongs to our application).
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 2:11 AM
Points: 113,
Visits: 625
|
|
SELECT rows FROM sysindexes WHERE id = OBJECT_ID('YourTableName') AND indid < 2
The above query is good, but it will give the accurate count all the time. Since it takes the count using the index. It depends on the index how you created.
If you need more info on this check msdn help on indexes and rowcount of sysninexs table.
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Tuesday, April 09, 2013 4:24 AM
Points: 318,
Visits: 1,172
|
|
@abhishek:
In that case you will have to use Ramesh's approach (if you want to use sysindexes). Make sure that the local server collation matches the remote server collation exactly, and specify Collation Compatible = True on your linker server definition.
If you want an accurate result you're stuck with COUNT(), in which case collation doesn't matter.
Regards,
Jacob
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 2:11 AM
Points: 113,
Visits: 625
|
|
The above query is good, but it will give the accurate count all the time. Since it takes the count using the index. It depends on the index how you created.
If you need more info on this check msdn help on indexes and rowcount of sysninexs table.
sorry for the typo.. it should be....
The above query is good, but it will not give the accurate count all the time. Since it takes the count using the index. It depends on the index how you created.
If you need more info on this check msdn help on indexes and rowcount of sysnindexs table.
|
|
|
|