Viewing 15 posts - 901 through 915 (of 1,229 total)
I'd try adding IvTo to that clustered index on IvFrom. Guessing wildly, both versions of the query would take about the same time, and rather less than you're currently getting....
April 25, 2011 at 9:18 am
This...
SET ROWCOUNT 2;
INSERT INTO #Test_Rowcount (Value)
SELECT TOP 4 * FROM (
SELECT 'One' V UNION ALL ...
April 21, 2011 at 11:09 am
Hi Martin, sorry for not making it sufficiently clear. What I'm after is data in both tables, and your query, to replicate your findings. So...
INSERT INTO Company ([columnlist]) VALUES ([Valuelist])
INSERT...
April 21, 2011 at 9:38 am
-- Correct result, dodgy logic
(SELECT *
FROM #TABLE1
EXCEPT
SELECT * FROM #TABLE2)
UNION ALL
(SELECT *
FROM #TABLE2
EXCEPT
SELECT * FROM #TABLE1)
-- correct result, correct logic
SELECT t1.*
FROM #TABLE1 t1
WHERE EXISTS (
SELECT 1...
April 21, 2011 at 7:46 am
Dorian Gray (4/21/2011)
ps: Sorry - couldn't resist. I'd say go with your gut instinct. Typically...
April 21, 2011 at 6:30 am
You will get a wide range of responses from folks who've been in this position. Here's my experience, from being there twice in 20 years of contracting.
If you don't mind...
April 21, 2011 at 5:55 am
v-anand (4/21/2011)
I need to create a temporary table so as to do some calculation.
For example there is a table named Product having columns -ProductID, ProductName, Price and there is...
April 21, 2011 at 4:42 am
Also, INSERT statements to create data in both tables which will generate this result:
CompanyName StreetNumber StreeName StreetType Suburb Postcode State
123 Acc Brisbane 4000 QLD
123 Acc 123 Pitt Street Brisbane 4000...
April 21, 2011 at 3:48 am
ananda.murugesan (4/21/2011)
In SQL SERVER 2000.
Blocked process not clear after restarting SQL SERVICES, please tell me what could be reason? once restart the service all transaction will be terminated...
April 21, 2011 at 3:44 am
Dynamic SQL isn't necessary:
ALTER PROCEDURE dbo.MyTest
AS
SELECT TOP 10 [name] FROM sys.columns ORDER BY [name]
RETURN 0
GO
CREATE TABLE #ColumnNames ([name] VARCHAR(200))
INSERT INTO #ColumnNames ([name]) EXEC dbo.MyTest
SELECT * FROM #ColumnNames
April 21, 2011 at 3:34 am
David Burrows (4/21/2011)
Jeff Moden (4/20/2011)
If we don't know the length, then we can force the max length for positive BIGINTs and simply remove all spaces afterwards.
Also if you append the...
April 21, 2011 at 3:24 am
Hi Ananda
Your first point - rewriting the code - if the code you posted is a representative sample then I'd agree. Find the worst-performing code and begin there. Grant Fritchey...
April 21, 2011 at 3:19 am
Hi Ananda
Let's have a closer look at that stored procedure. It's a series of DELETE/INSERT statements separated by conditionals - depending on what's already in the db, one of them...
April 21, 2011 at 2:19 am
Hi Martin
Please can you post CREATE TABLE statements for both tables. Some sample data for each would be awesome. Also, the simple query which returns:
CompanyName, StreetNumber, StreeName, StreetType, Suburb, Postcode,...
April 21, 2011 at 12:31 am
Michael Valentine Jones (4/20/2011)
ChrisM@home (4/20/2011)
...
@michael-2 - I can't believe you posted that!
I'm just hoping to see someone use it in production code. :satisfied:
Actually, I started wondering if a function...
April 21, 2011 at 12:01 am
Viewing 15 posts - 901 through 915 (of 1,229 total)