Viewing 15 posts - 76 through 90 (of 97 total)
Hi all,
I will explain a case when I coded a cursor as a good solution to a problem.
Some months ago I coded a Stored Procedure to purge a table based...
February 22, 2011 at 2:35 am
Eugene Elutin (9/29/2010)
September 30, 2010 at 8:17 am
Hello Eugene,
oops, I'm seeing I wrote "...you will always never read this table ordered by ID...", what a mistake, I tried to write "...you will almost never read this table...
September 29, 2010 at 9:14 am
Hello,
as far as I know a clustered index is best for sequential reading. If you create a clustered index using Attrib_Z, any query like
SELECT * FROM Widgets WHERE Attrib_Z =...
September 29, 2010 at 2:45 am
Hello James,
well, not all solutions work all times :crying:. That means that SQL Server solved the CROSS JOIN as a INNER JOIN, then changing the view source code has no...
September 28, 2010 at 8:41 am
Hello,
your query can be rewritten using PIVOT as
SELECT *
FROM (
SELECT ItemNo
, cast(Year as varchar(4)) + ' ' + CONVERT(varchar(3), dateadd(m, mnth, -1), 107) as MnthName
, OrderMade
FROM Order_rep
) P
PIVOT (
SUM(OrderMade)
FOR...
September 28, 2010 at 2:15 am
Hello James and all,
there is another way to try to improve performance in this query; you can create an index for AdvStats using the columns
shift_number
...
September 27, 2010 at 4:38 am
Hello all,
I would suggest two changes to the original view, maybe these changes help.
First: really there is no need for a CROSS JOIN, the query could be rewritten using INNER...
September 27, 2010 at 4:18 am
Hello esilva,
as I read your latest reply you are contradictory, your first paragraph says one thing and your second paragraph states the opposite. As I understand it, you need:
- First...
September 21, 2010 at 7:17 am
Hello,
looking at your code there is something I don't understand, let's me explain:
You define your first cursor, SessionCurs,
DECLARE SessionCurs CURSOR FAST_FORWARD FOR
Select StartDate,...
September 21, 2010 at 3:35 am
hi 999baz,
it depends, doing this update you will lock a big chunk of data.
First of all you must test it, use your development DB and test with 10000 rows, 100000...
September 21, 2010 at 2:57 am
Hi frharkonnen (maybe Feyd-Rautha?),
this is how I understand your schema:
Tag and Topic are master tables with a N:N relationship, TopicTag is the table that sustains this relationship. Rank is a...
September 15, 2010 at 2:37 am
You said you must compare 5 fields. Maybe they are the joining key?, try it:
SELECT A.* FROM A
LEFT JOIN B
ON A.Field1 = B.Field1
...
September 14, 2010 at 2:51 am
Hello,
what indexes your table has?. I suppose you access your data in two ways:
- Asking for contacts in a given campaign.
- Asking for campaigns for a given contact.
To run these...
September 13, 2010 at 3:04 am
Why about changing your BETWEEN clause by a SELECT TOP?, try it:
SELECT TOP 50 *, ROW_NUMBER() OVER (
ORDER BY
CASE WHEN @pSortFieldName = 'column1'
...
August 6, 2010 at 3:21 am
Viewing 15 posts - 76 through 90 (of 97 total)