Viewing 15 posts - 48,226 through 48,240 (of 49,571 total)
The problem with all of those 'all-in-one' type queries is that they make query plan reuse a very dodgy affair. What may be suitable for one set of parameters often...
November 16, 2007 at 7:00 am
From your description, the temp table sounds better, providing there are appropriate indexes on it. Depends on tempdb space, activity, memory size, ...
My normal answer to questions like this is...
November 16, 2007 at 3:38 am
Matt Miller (11/15/2007)
November 15, 2007 at 11:20 pm
The number of pages that the metadata says belong to the table don't agree with the number of pages actually allocated.
As the error says, try running DBCC UPDATEUSAGE and see...
November 15, 2007 at 12:51 am
Faraz Shuja (11/15/2007)
i am just passing null to @WhereConditions.
Yup. That'll do it. If @WhereCondition is NULL, then when concatenated to the rest of the @sql string, that also becomes null,...
November 15, 2007 at 12:48 am
See my revised reply. Also, make sure that the where conditions you're specifying don't filter out all records.
Can you give an example of how you're calling the proc please?
November 15, 2007 at 12:40 am
Edit: Ah, silly me. The output variable's not getting assigned.
ALTER PROCEDURE dbo.SP_NewClassifiedsMain
@PageIndex INT,
@NumRows INT,
@NewClassifiedsCount INT OUTPUT,
@WhereConditions varchar(200)
AS
BEGIN
declare @sql nvarchar(400);
set @sql = 'Select @count = Count(*) From classifieds_Ads
Where AdStatus=100 ' +...
November 15, 2007 at 12:19 am
Faraz Shuja (11/14/2007)
Still not working. @NewClassifiedsCount is 0 always
Try this
declare @sql nvarchar(400);
declare @test-2 int;
set @sql = 'Select @count = Count(*) From classifieds_Ads
Where AdStatus=100 ' + @WhereConditions
exec sp_executesql @sql, N'@count...
November 14, 2007 at 11:54 pm
Matt Miller (11/14/2007)
November 14, 2007 at 11:01 pm
Matt Miller (11/14/2007)
Giants? Nah - I aint that tall....More like - boys with their toys:)
You said it. 😉
What I'll do is grab one of the string functions that I...
November 14, 2007 at 6:46 am
Wow. You guys have been busy overnight. I think I'll bow out of this race while I'm behind... 😀
November 14, 2007 at 3:22 am
My recomendation would be to find a more appropiate column for the clustered index. Which column it is will depend on how the tables are used.
The problems with guids as...
November 14, 2007 at 1:29 am
Were those rows inserted before or after the 9th Nov backup? If before, then restore that backup to another server and copy the data across.
Look on the bright side. It...
November 14, 2007 at 1:02 am
Viewing 15 posts - 48,226 through 48,240 (of 49,571 total)