Viewing 15 posts - 1 through 15 (of 33 total)
thanks praveen,
Do you archive data by using this type of flag column?
November 17, 2013 at 5:08 am
Lutz, Steve,
thanks for your valuable suggestions.
I think, union all will be a solution for me.
thanks again.
November 16, 2013 at 9:31 pm
thanks for your reply.
Every social networking site face this situation. E.g. : when we delete any photo or or when we delete our profile etc.
They doesn't delete data physically. I...
November 16, 2013 at 6:09 am
If I use any other column which is in NCI (& not PK), then this is a seek.
NCI is same in both situations. Difference is only is Row_Number order by...
February 24, 2013 at 9:19 pm
thanks for this valuable advice.
February 24, 2013 at 10:15 am
thanks Gail !
This link is really very helpful.
But I am not able to understand that if I use AdID (which is primary key & Clustered Index also) in Row_Number order...
February 24, 2013 at 9:25 am
Both are using same execution plan.
but I am still concerned about "CreatedDate" filter.
because all the filters which comes after date, are not coming under seek predicate.
February 24, 2013 at 4:09 am
another version is:
DECLARE @intPageNumber INT = 1, @intPageSize INT = 20;
SELECT A.AdID, A.AdTitle, A.AdFor, A.AdCondition, A.AdExpPrice, A.CreatedDate, A.ModifiedDate, A.AdUID
FROM
(
SELECT TOP(@intPageNumber * @intPageSize) ROW_NUMBER() OVER (ORDER BY vaa.CreatedDate) AS RowNum,
vaa.AdID, vaa.AdTitle,...
February 23, 2013 at 11:25 pm
I found a bit better situation.
DECLARE @intPageNumber INT = 1, @intPageSize INT = 20;
WITH SQLPaging
AS
(
SELECT TOP(@intPageNumber * @intPageSize) ROW_NUMBER() OVER (ORDER BY vaa.CreatedDate) AS RowNum,
vaa.AdID, vaa.AdTitle, vaa.CityID, vaa.AdFor, vaa.AdCondition,
vaa.AdExpPrice,...
February 23, 2013 at 11:09 pm
Gail,
I have attached the required details.
& please ignore the data rows count because I have generated in local server not in production server.
February 23, 2013 at 9:14 pm
For the date comparison, I am using
CreatedDate > DATEADD(dd, -90, GETUTCDATE())
Should I change the ">" to "between"?
Currently, I am using below query:
WHERE CategoryID = 1 AND CountryCode = 'GB'...
February 23, 2013 at 9:00 pm
Mate,
Thanks for your reply.
What will you suggest for:
Question 1: If I am searching for a city(or state) then Should I use
Country = @country AND StateID = @stateID AND CityID...
February 22, 2013 at 6:01 am
one more thing which forgot to include the Time Difference between IST & GMT.
It depends on your DB server/you that in which time zone you are saving your date time...
February 22, 2013 at 5:34 am
I hope this can help you.
SELECT CONVERT(DATETIME, LTRIM(RTRIM(A.FormattedDate)))
FROM
(
SELECT CASE
WHEN PATINDEX('%CEST%', dr.date) > 0 THEN SUBSTRING(dr.date, PATINDEX('%CEST%', dr.date)+5, 4) + ' ' + SUBSTRING(dr.date, 5, (PATINDEX('%CEST%', dr.date)-5))
WHEN PATINDEX('%IST%', dr.date)...
February 22, 2013 at 5:28 am
Viewing 15 posts - 1 through 15 (of 33 total)