Forum Replies Created

Viewing 15 posts - 1,351 through 1,365 (of 6,036 total)

  • RE: find substring...and count...

    llouw1 (6/14/2016)


    I have read the article...and I really cannot see the link between my question and the article.

    That's because people provided you with a tool to solve a problem without...

  • RE: TSQL query slower with variable than hard-coded

    tindog (6/21/2016)


    Appreciate the help Sergiy - however think I ditched/resolved this one 6 months ago!

    Well, there is no any sign of it in the thread... 😉

    And since it's a public...

  • RE: Getting the VARBINARY data into a VARCHAR field

    j-1064772 (6/21/2016)


    Isn't the 00 byte a terminator as in other languages ?

    I don't think so.

    But to confirm or dismiss it we need to see how a string longer than...

  • RE: Strange behavior with decimals

    Phil Parkin (6/17/2016)


    Nice example, Luis.

    One thing which is unclear to me in all this is how SQL Server determines precision and scale for a given calculation. For example

    1.00 / 7.1

    which,...

  • RE: Calculating Duration

    whymaravele (6/20/2016)


    I was trying

    WITH cte AS (

    SELECT

    TaskId

    ,CONVERT(DATE ,c.CreatedDate)AS DateSubmitted

    ,CONVERT(TIME ,c.CreatedDate)AS TimeSubmitted

    ,CONVERT(DATE ,c.TakenDate)AS DateTaken

    ,CONVERT(TIME ,c.TakenDate)AS TimeTaken

    ,CONVERT(DATE ,c.CompletedDate)AS DateCompleted

    ,CONVERT(TIME ,c.CompletedDate)AS TimeCompleted

    FROM [dbo].[CONSULTATION] c

    )

    SELECT

    TaskId

    ,DateSubmitted

    ,TimeSubmitted

    ,DateTaken

    ,TimeTaken

    ,DateCompleted

    ,TimeCompleted

    ,(TimeCompleted - TimeTaken) AS Duration

    FROM...

  • RE: Getting the VARBINARY data into a VARCHAR field

    Not sure is it OK to ignore the length value stored in 1st 2 bytes of the string.

    This one puts the length value to use:

    declare @MyTable table

    (id int identity (1,...

  • RE: TSQL query slower with variable than hard-coded

    tindog (4/1/2016)


    Hello,

    I have a query that looks like this, which takes 17 seconds:

    DECLARE@DFrom DATE = '2015-01-01',

    @DTo DATE = '2015-01-31'

    SELECTt.MyID

    FROMTDDB.dbo.TableX tx

    INNER JOINTDDB.dbo.TableY ty ON ty.MyID = tx.MyID

    INNER JOINTDDB.dbo.TableZ tz ON ty.YID...

  • RE: Need help on query performance

    Great!

    Congratulations!

    Keep the query patterns from this thread handy.

    It seems like you have a lot of bad SQL coding habits to overcome. :hehe:

    Wish you luck with this!

  • RE: Computed column with leading static number

    '12345' + replace(STR(ID,9,0), ' ', '0')

  • RE: Interview Questions

    Jeff Moden (6/17/2016)


    Ed Wagner (6/17/2016)


    Sergiy (6/16/2016)


    My point was - the question about finding current time does not have a correct answer without specifying additional conditions.

    And I think that's fine. ...

  • RE: Interview Questions

    Luis Cazares (6/16/2016)

    He didn't, the problem is that Location and time zone are different settings.

    Thanks, found it now!

    Did not have patience to drill so deep down on my own. 🙂

    It...

  • RE: Interview Questions

    FridayNightGiant (6/15/2016)


    In science they say - the shorter the title the deeper the book.

    Your "simple question" is not really that simple.

    Someone who knew that "simple answer on a simple question"...

  • RE: Interview Questions

    Lynn Pettis (6/15/2016)


    So I guess it depends on the company you are interview with as to who may be asking the questions. I would hope that someone not...

  • RE: Interview Questions

    Jeff Moden (6/15/2016)


    GSquared (6/15/2016)


    Jeff Moden (6/14/2016)


    GSquared (6/14/2016)


    Jeff Moden (6/10/2016)


    Eric M Russell (6/10/2016)


    Eric M Russell (6/7/2016)


    They're asking the wrong type of questions for a job interview.

    I'm not saying that string manipulation...

  • RE: Interview Questions

    Jeff Moden (6/15/2016)


    An interview is the one place where volunteering information can do nothing but good... if you know what you're talking about. When someone asks a simple question...

Viewing 15 posts - 1,351 through 1,365 (of 6,036 total)