Forum Replies Created

Viewing 15 posts - 2,626 through 2,640 (of 3,957 total)

  • RE: Multipe letters into one

    ChrisM@Work (10/4/2012)


    <snip>

    Heh nice one, Dwain! I know where you got this idea from 😉

    Actually, I was going to post nearly exactly the same thing as yours but you beat me...

  • RE: Set Lock_Timeout 0

    This must be a side effect of:

    EXEC sp_dbgofast

    After all, if the Prod system doesn't have to wait for locks, then it must be running faster right?

    Seriously, I have no idea....

  • RE: Check for the existence of a file BEFORE processing in SQL Server - SOLUTION

    [wistfully]

    If only you could make the SQL Server reach out and determine whether a file exists on the client.

    [/wistfully]

  • RE: T-sql select - like

    Here's another way:

    WHERE LEN(LastName) - 1 = LEN(REPLACE(LastName, '/', ''))

  • RE: Multipe letters into one

    Eugene Elutin (10/4/2012)


    dwain.c (10/4/2012)

    ...

    This is kinda obscure too.

    SELECT IDENTITY(INT,1,1) AS N

    INTO #t

    FROM (VALUES($),($),($),($),($),($),($),($),($),($))a(N)

    CROSS JOIN (VALUES($),($),($),($),($),($),($),($),($),($))b(N);

    There I go thinking about fortune and glory again! Well fortune anyway. 😛

    No way you...

  • RE: Find sub-tree nodes

    Just goes to show that threads may die off in our memories but they live on forever in the heart of Google! 😛

  • RE: Multipe letters into one

    Eugene Elutin (10/4/2012)


    ChrisM@Work (10/4/2012)


    Eugene Elutin (10/4/2012)


    ChrisM@Work (10/4/2012)


    No undocumented vapourtables, no sort:

    SELECT n = a.n+b.n

    FROM (VALUES(0),(10),(20),(30),(40),(50),(60),(70),(80),(90))b(n)

    CROSS JOIN (VALUES(1),(2),(3),(4),(5),(6),(7),(8),(9),(10))a(n)

    😉

    No sort? I would suggest to add ORDER BY, otherwise order is not guaranteed,...

  • RE: Multipe letters into one

    Jeff Moden (10/4/2012)


    I agree that it should not be used as a "free" Tally Table in production code but someone that knows it's there and what it contains is usually...

  • RE: determine which transactions add up to a specific value?

    I had a bit of an epiphany today that I thought I would share. I figure, if Mr. Magoo can use tricks to speed up the solution, I can...

  • RE: VARCHAR TO DATE

    If it's a learning expedition you're on, try this:

    SET DATEFORMAT DMY

    DECLARE @ImportDate VARCHAR(8) = '10122012'

    SELECT CAST(STUFF(STUFF(@ImportDate, 5, 0, '-'), 3, 0, '-') AS DATETIME)

    ,CAST(CAST(10000*(@ImportDate%10000) +

    ...

  • RE: VARCHAR TO DATE

    BTW. Did you try running this?

    DECLARE @ImportDate VARCHAR(8) = '10122012'

    SELECT CONVERT(VARCHAR(8),@ImportDate,112)

    You'll notice absolutely no change to the string being converted. That's because it is already a VARCHAR(8), i.e.,...

  • RE: VARCHAR TO DATE

    Tava (10/4/2012)


    the CAST(STUFF(STUFF syntax worked but trying to do it as a convert like if possible similar to how i currently have it.

    It works but you don't want to use...

  • RE: VARCHAR TO DATE

    You can try something like this:

    SET DATEFORMAT DMY

    SELECT CAST(STUFF(STUFF('10122012', 5, 0, '-'), 3, 0, '-') AS DATETIME)

    SET DATEFORMAT MDY

    Replace the literal date with your ImportDate.

  • RE: Generating n-Tuples with SQL

    Jeff Moden (10/3/2012)


    It's been fun to watch the permutations in this discussion. Thanks for the article and the followups, Dwain.

    You might be interested to know I'm working on a...

  • RE: Deadlock data gathering questions

    n00bDBA (10/3/2012)


    Hi Gail,

    i just found a Jon K script that im guessing.. no guessing it says it right there.. ill stop being blind!.. it throw out a very nice...

Viewing 15 posts - 2,626 through 2,640 (of 3,957 total)