Forum Replies Created

Viewing 15 posts - 1,771 through 1,785 (of 6,036 total)

  • RE: min and group by help

    fabriziodb (12/14/2015)


    yes it's a newspaper, there's only one page for one day.

    And there is always page 1. Which is always min page number.

    Correct?

  • RE: Parse string from URL between...

    Luis Cazares (12/9/2015)


    This should be safer.

    declare @URL varchar(100) = 'http://www.mydomain.info/Customer.aspx?dcc=EUR&h_hmid=2907831&mobiredirect=no&cpn=3790'

    SELECT *, LEFT( initial.pos, CHARINDEX( '&', initial.pos + '&') - 1)

    FROM (VALUES (@URL)) AS x(url)

    CROSS APPLY (SELECT SUBSTRING( x.url, CHARINDEX('h_hmid=', x.url)...

  • RE: Parse string from URL between...

    Using good old Tally table:

    DECLARE @tag VARCHAR(50)

    --SET @tag = 'cpn='

    SET @tag = 'h_hmid='

    SELECT url, SUBSTRING(url, ID_starts, ID_ends - ID_starts) h_hmid

    FROM (

    SELECT url, CHARINDEX(@tag, url)+LEN(@tag) ID_starts, MIN(N) ID_ends

    FROM (SELECT 'http://www.mydomain.info/Customer.aspx?h_hmid=2907831&dcc=EUR&mobiredirect=no&cpn=3790' url...

  • RE: min and group by help

    The solution works only if (date, page) are a unique key.

    If there are 2 or more records with the same (date, page) values you'll be getting randomly selected id from...

  • RE: SQL memory is very high

    WhiteLotus (12/10/2015)


    I hope memory usage also drops after this change .

    No, it won't.

    SQL Server will continue using all the memory you let it to use.

    If you want to let Windows...

  • RE: Description of a TempTables

    The post is now even older, but this command would easier to remember and place in code:

    EXEC tempdb..sp_help #JBMTest

    No need for dynamic SQL.

    Oh, the beauty of system procedures!

    🙂

  • RE: Problem with like

    SELECT * FROM @TESTTABLE WHERE KOD LIKE N'CI%'

    All good. 4 records returned:

    KOD

    CINTERIOUS

    cinterious

    Cinterious

    cInterious

  • RE: Table vs View vs UserDefined Function - Which will give more performance

    Alan.B (12/7/2015)


    I'm with what everyone has said so far. I would add, however, that, if you are doing aggregations, you might want to consider an indexed view with the aggregations...

  • RE: Converting a date

    Jason A. Long (12/6/2015)


    It's probably worth mentioning that the CAST/CONVERT in the predicate only works when using certain datatypes.

    And only on certain versions of CQL Server.

    Microsoft SQL Server 2008 R2...

  • RE: SQL server conversion error issue

    CAST(case id=1 then datestring else null end AS date) = '2015/08/31'

  • RE: network days, for business hours

    Using a calendar table (a form of Tally table having dates instead of numbers) allows both simplify the code and speed up its execution:

    DECLARE @Created_Date ...

  • RE: Generate sequence of numbers between values

    Read this article:

    http://www.sqlservercentral.com/articles/T-SQL/62867/

    You'll find your solution in there.

  • RE: Performance Risk\Impact of Partitioning

    Welsh Corgi (11/30/2015)


    I'm looking at another table that is much worse:

    Yes, the table is horrible.

    Even by the naming you can tell it's made of several different tables.

    Cannot be good.

    But 2.4...

  • RE: Performance Risk\Impact of Partitioning

    Welsh Corgi (12/1/2015)


    I need at least a few items to make a case against partitioning.

    The case against partitioning is that there is no case in favour of partitioning.

    Think of DB...

  • RE: How to run a view every 1000 rows to add in table?

    Jeff,

    There is enough information for one suggestion:

    WHERE CAL.Date<=GETDATE()

    AND ...

Viewing 15 posts - 1,771 through 1,785 (of 6,036 total)