Forum Replies Created

Viewing 15 posts - 4,501 through 4,515 (of 8,753 total)

  • RE: Painful datetime conversion

    Jeff Moden (9/19/2015)


    Eirikur Eiriksson (9/17/2015)


    Using my normal test harness, Kristen's DATETIMEFROMPARTS solution is a clear winner, more than twice faster than the next one. Note that the slowest solutions and...

  • RE: Best way to handle like% on column too large for an index

    kevitra (9/18/2015)


    I made a full text index on the column and basic queries such as:

    select * from ourtable where contains(bigcolumn, '\\AReallyLongStringofTextHere') works fine unless there is a space in the...

  • RE: Why are databases showing up in a newly created instance?

    stanlyn (9/18/2015)


    Hi,

    Why are the user databases that were created in the MSSQLSERVER default instance showing up in the newly created ALPHAONE instance? I'm successfully logging into the alphaone database...

  • RE: Painful datetime conversion

    WayneS (9/18/2015)


    Sean Lange (9/17/2015)


    I can't change the table at all. It will violate our support contract. Not to mention it would be possible to get trashed with an update at...

  • RE: SELECT IN THE WHERE

    BSavoie (9/18/2015)


    Is there a better way to handle this sort of thing? It just doesn't feel right putting a SELECT in the WHERE, but it does exactly what I...

  • RE: Need CTE query to find specific record

    Quick suggestion

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON

    IF OBJECT_ID(N'tempdb..#temp') IS NOT NULL DROP TABLE #temp;

    create table #temp (Cabstamp varchar(10), account varchar(10),document varchar(15), origin varchar(2), debit numeric(10,2), credit numeric(10,2), datalc datetime)

    insert into #temp (Cabstamp,account,Document,...

  • RE: Query optimization

    tomisoft (9/18/2015)


    Hello,

    I have a view which I'm trying to optimize.

    Here's original one:

    ALTER VIEW [dbo].[V_Smeny_D]

    AS

    SELECT s.ARBPLNR, s.DATUM, master.dbo.spt_values.number AS smena, DATEADD(hh, CASE number WHEN 1 THEN 0 WHEN 2 THEN 6...

  • RE: Painful datetime conversion

    Kristen-173977 (9/18/2015)


    The front runners were neck-and-neck in Luis's script?

    http://www.sqlservercentral.com/Forums/FindPost1720510.aspx

    I've found the method I use for timing more accurate than the time statistics

    😎

  • RE: Today's Random Word!

    SQLRNNR (9/17/2015)


    DTA

    distrust

  • RE: Painful datetime conversion

    Using my normal test harness, Kristen's DATETIMEFROMPARTS solution is a clear winner, more than twice faster than the next one. Note that the slowest solutions and those generating conversion errors...

  • RE: get week numbers from dates, saturday being start of the week,

    Nomvula (9/17/2015)


    i have the following table I need to select dates grouping them by weeks, my week start is Saturday to Friday

    CREATE TABLE weekdays

    (

    datevalue ...

  • RE: Today's Random Word!

    anthony.green (9/17/2015)


    Eirikur Eiriksson (9/16/2015)


    Revenant (9/16/2015)


    Ed Wagner (9/16/2015)


    SQLRNNR (9/16/2015)


    venom

    Snake

    Eden

    Utopia

    Dystopia

    Inferno

  • RE: Get max of non-unique rows

    Two quick suggestions

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON;

    DECLARE @SAMPLE_DATA TABLE

    (

    Store CHAR(1) NOT NULL

    ,Sales ...

  • RE: Painful datetime conversion

    Jeff Moden (9/16/2015)


    Sean Lange (9/16/2015)


    drew.allen (9/16/2015)


    Try the FORMAT function. It was added in SQL 2012.

    SELECT FORMAT(vhrgdt, '0000-00-00') + ' ' + FORMAT(vhrgtm, '00:00:00.000'), *

    FROM #Something s

    Drew

    Thanks Drew. I don't use...

  • RE: The checksum

    A more common scenario would be something like this, given the facts that:

    a) Inserts and update are relatively inexpensive

    b) Data comparison is relatively expensive

    c) Good enough algorithms...

Viewing 15 posts - 4,501 through 4,515 (of 8,753 total)