Viewing 15 posts - 226 through 240 (of 287 total)
Also, here is a snippet of code that you might be able to use to avoid PK violations:INSERT
DataIntegrityErrors
(
...
July 15, 2009 at 10:36 am
Is the problem that there are two (or more) rows being generated with duplicate primary keys by your query or that the primary key already exists in the destination table...
July 15, 2009 at 10:01 am
Given your source data when you pass a 2, what do you want as output?
July 15, 2009 at 9:55 am
Just as an FYI, I did get the following query to work. However, I do not think I'd trust it to ALWAYS work in production:SELECT *
FROM
(
...
July 13, 2009 at 2:36 pm
Actually, I was just looking at some old code and apparently SQL is "smart" enough to figure out what is going on so it will, in essence, collapse the query...
July 13, 2009 at 2:26 pm
RBarryYoung (7/13/2009)
July 13, 2009 at 1:35 pm
I was doing a quick scan, so hopefully I did not miss it, but did you try a derived table yet?
July 13, 2009 at 9:38 am
There is probably a more elegant solution, but this handles strings of 15 characters and such:DECLARE @Foo TABLE (Val VARCHAR(50))
INSERT @Foo
SELECT 'michael the greatest thing ever!!'
UNION...
July 10, 2009 at 3:41 pm
Something like:DATEDIFF
(
HOUR,
cast(stuff(stuff(stuff(cast(SAP_CRM_P1_Calls.ED_TST_TO as varchar(17)), 9, 0, ' '), 12, 0, ':'), 15, 0, ':') as datetime),
SAP_CRM_P1_Calls.[Downtime Start]
) AS [Service Order Duration (hours)]
July 10, 2009 at 2:59 pm
Nice article. I've used other commercial geo-location products in the past and it is nice to have a free solution that is able to get reasonable results for BI tasks...
July 10, 2009 at 9:40 am
Whitefang, is that you?
July 9, 2009 at 2:00 pm
Casting to an INT should work just fine. However, you *might* be able to get a slight performance increase by eliminating a function on one the join values and just...
July 9, 2009 at 11:07 am
Carl is correct about tracking changes from Server to Server and database to database. However, if you wanted to track changes within a given database you could, but you would...
July 9, 2009 at 11:00 am
WayneS (7/7/2009)
Note that you don't actually have a NULL value in Field2; instead you have the string "NULL'. The code handles this.
-- with this clustered index, the following...
July 7, 2009 at 5:09 pm
There are much nicer solutions (if you have SQL 2005 or later), but here is one way to do it:DECLARE @test-2 TABLE (
[ID] [int] NOT NULL,
[Field1] [nvarchar](255) NULL,
[Field2]...
July 7, 2009 at 5:00 pm
Viewing 15 posts - 226 through 240 (of 287 total)