Viewing 15 posts - 1,246 through 1,260 (of 2,007 total)
Another method -
DECLARE @startdate DATETIME
SET @startdate = '2011-11-18'
SELECT TOP 1 DATEADD(dd, Num, DATEDIFF(dd, 0, @startdate))
FROM (SELECT 1 AS Num UNION ALL SELECT 2 UNION ALL SELECT 3) AS a
WHERE (DATEDIFF(dd,...
November 30, 2011 at 8:20 am
There's probably a way to do this with just a DATEADD statement, but off the top of my head I can't think of one.
Anyway, this should work: -
DECLARE @startdate DATETIME
SET...
November 30, 2011 at 7:40 am
L' Eomot Inversé (11/30/2011)
November 30, 2011 at 6:40 am
Cadavre (11/30/2011)
Got it wrong because I believe it should say "v3 = v2" not "v2 = v3"
L' Eomot Inversé (11/30/2011)
wloong (11/29/2011)
From the programming logic, "v2 = v3"...
November 30, 2011 at 5:58 am
Got it wrong because I believe it should say "v3 = v2" not "v2 = v3"
November 30, 2011 at 2:30 am
This is a bit of a wild stab in the dark, so probably not quite what you're looking for.
BEGIN TRAN
--Standard TestEnvironment of 1,000,000 rows of random-ish data
IF object_id('tempdb..#testEnvironment') IS NOT...
November 30, 2011 at 2:27 am
Hello and welcome to SSC!
Unfortunately, it seems that your readily consumable sample data and DDL scripts have fallen off your post. Or perhaps you were unaware of the benefits...
November 30, 2011 at 1:26 am
Dev (11/29/2011)
You are right. The terms they are using have wide scope (and pretty much...
November 29, 2011 at 10:08 am
Dev (11/29/2011)
I don't live in US and kind of curious...
November 29, 2011 at 9:54 am
Dev (11/29/2011)
Will it not affect SSC?
No.
That's not to say I support it, since it will affect several other sites that I frequent, but it won't affect SSC.
November 29, 2011 at 9:32 am
Here's a few different methods.
BEGIN TRAN
SET NOCOUNT ON
IF object_id('tempdb..#testEnvironment') IS NOT NULL
BEGIN
DROP TABLE #testEnvironment
END
--1,000,000 Random rows of data
SELECT TOP 1000000 IDENTITY(INT,1,1) AS ID,
varcharDateTime
INTO #testEnvironment
FROM (SELECT TOP 999999
...
November 29, 2011 at 8:17 am
anthony.green (11/29/2011)
nope. thats amazing thanks.now just to get it to drawn the polygons, but that will be a different problem for a different topic
No problem. I'm not sure I know...
November 29, 2011 at 7:18 am
Sorry for the wait, something came up.
OK, first I fixed your sample data.
SET NOCOUNT ON
CREATE TABLE #temp (RowNum INT, PostCodeDistrict CHAR(3), Latitude DECIMAL(18, 3), Longitude DECIMAL(18, 3))
INSERT INTO #temp (RowNum,...
November 29, 2011 at 7:03 am
I'd take a look, but without readily consumable sample data and ddl scripts I'm unwilling to. I don't want to spend my whole lunch hour setting up a test environment...
November 29, 2011 at 5:46 am
Viewing 15 posts - 1,246 through 1,260 (of 2,007 total)