Viewing 15 posts - 1,216 through 1,230 (of 2,894 total)
adonetok (9/13/2012)
select * from ORDER where city='London'
In asp.net app, one dataset will be created based on this store procedure.
How to...
September 13, 2012 at 7:30 am
You don't need to use UDF, there is in-build format for T-SQL CONVERT function:
select convert(varchar, GETDATE(), 107)
September 13, 2012 at 4:35 am
Man, you do really need to read the previous posts.
It's only going to work if you use dynamic sql.
Please note, if you run the following type of query...
September 13, 2012 at 4:04 am
...
Do you realistically expect to write to this table more times that the number of atoms in the Universe?
...
Sorry, I completely forgot this one. Could you please remind me...
September 13, 2012 at 3:53 am
It takes some time to update statistics....
What are you doing exactly in your stored proc?
It can be well justified if it does modify big chunk of a table.
September 13, 2012 at 3:35 am
dwain.c (9/12/2012)
Here's a version of the Tuples solution that runs in about 1/3 the time:...
I like this one, as it's very different approach, but yeah it's still much slower.
I...
September 13, 2012 at 3:32 am
alanspeckman (9/12/2012)
Is it ever considered a best practice to use a UniqueIdentifier(GUID) as a primary key?...
Nowadays, it's not considered as the best practice. However, there are cases where the use...
September 13, 2012 at 3:24 am
ChrisM@Work (9/12/2012)
;WITH SourceNums AS (
SELECT strcol FROM (VALUES ('1'),('2'),('5'),('7'),('8'),('9')) a (strcol)
),
nTuples (n, Tuples) AS (
SELECT 1, CAST(strcol...
September 12, 2012 at 10:07 am
...
The only way to make it more efficient is to shortcut the math. That's why some are hard-coding 3 as the final digit. (It only saves one step...
September 12, 2012 at 10:05 am
Have a look my example. The problem is here:
LEFT JOIN dbo.TBL_VALUATIONS v ON a.pr_id = v.pr_id
WHERE v.date_asset IN
(SELECT MAX(a.date_asset)
FROM TBL_VALUATIONS a LEFT JOIN TBL_PROPERTY b
ON a.pr_id = b.pr_id
GROUP BY a.pr_id)
You...
September 12, 2012 at 9:56 am
Greg Snidow (9/12/2012)
Jeff Moden (9/12/2012)
Greg Snidow (9/11/2012)
The 'id' column in every table was a bit annoying to work with.
It's even more annoying when you need it and it's not there....
September 12, 2012 at 9:49 am
Luis Cazares (9/12/2012)
Try performance by time (miliseconds or nanoseconds)...
And the winner is the one you didn't include in your test:
DECLARE @ddatetime2
SET @d = SYSDATETIME()
;with a (num)
as
( select * from (values...
September 12, 2012 at 9:28 am
I've tried all three methods, INNER JOINs, CROSS APPLY and CROSS JOIN with WHERE: all produce very similar query plans with use of Nested Loops (Inner Join).
Cannot see much...
September 12, 2012 at 9:11 am
Luis Cazares (9/12/2012)
Eugene Elutin (9/12/2012)
You don't really need last join as the last digit of the second number can only be '3'Wouldn't that be cheating?
....
Cheating? No, it's a common...
September 12, 2012 at 8:39 am
Your query for MAX(Date) should be linked somehow to entities you are querying above.
I'm not 100%, may be that way:
ELECT
a.id,
a.new_id,
a.add_id,
b.add_1,
b.add_2,
b.add_3,
c.town,
d.county,
e.val,
e.date
FROM TBL a
LEFT JOIN TBL_ADD b ON a.addir = b.addid
LEFT JOIN...
September 12, 2012 at 8:17 am
Viewing 15 posts - 1,216 through 1,230 (of 2,894 total)