Forum Replies Created

Viewing 15 posts - 8,266 through 8,280 (of 8,753 total)

  • RE: count events on date

    ChrisM@Work (5/12/2014)


    Eirikur Eiriksson (5/12/2014)


    Mike Saunders NL (5/12/2014)


    Hi, this works! Thanks

    The only thing that is missing is that the days with no events are not mentioned. Is there a way to...

  • RE: Help needed in join

    Lynn Pettis (5/12/2014)


    I have no idea what you mean by a POC Index, please explain. Also, please note the changes I did make on the sample data.

    The POC index...

  • RE: count events on date

    Mike Saunders NL (5/12/2014)


    Hi, this works! Thanks

    The only thing that is missing is that the days with no events are not mentioned. Is there a way to display these days...

  • RE: INSERT/SELECT from xml.nodes very slow

    Bill Talada (5/12/2014)


    Q.E.D.

    I added this weird line after the FROM clause and now results are immediate!

    OPTION ( OPTIMIZE FOR ( @xml = NULL ) )

    Good stuff!

    I had forgotten about this,...

  • RE: Help needed in join

    Here is a simpler window function (2012/2014) version. Although simpler than the earlier 12/14 one, it performs similar, mainly because of an sort operator which is around 60% of the...

  • RE: INSERT/SELECT from xml.nodes very slow

    Bill Talada (5/12/2014)


    Here is some further information: I ran the script above on a different server and it ran in a second vs. 30 seconds on mine. Both servers...

  • RE: Question re Check Contraints

    paul 31908 (5/12/2014)


    Hi all,

    I am creating a database where each record is required to have a twin record in the database.

    These is a type a value and a type b...

  • RE: Bean Counting

    Good question, thanks!

    😎

  • RE: How to get data on Quarterly basis?

    If you are on Sql Server 2012 or 2014, you should definitely look into the over clause and the window functions, perfect for this type of work.

    😎

  • RE: count events on date

    Here is one way of doing this

    😎

    USE tempdb;

    GO

    CREATE TABLE #events

    (

    eventID int,

    eventname char(30),

    startdate date,

    enddate date

    )

    INSERT INTO #events VALUES (1,'testevent 1','2014-05-02','2014-05-30');

    INSERT INTO #events VALUES (2,'testevent...

  • RE: Generating Auto Relationship

    Grant Fritchey (5/12/2014)


    madhukars 32911 (5/12/2014)


    Yes,

    I want to use JOINS, but this relationship is to be generated automatically on selection of the tables by the user.

    Right. No way to do this...

  • RE: Generating Auto Relationship

    madhukars 32911 (5/12/2014)


    Hi,

    I want to use the existing relationship to be populated in a text box in vb.net

    Thanks

    Madhukar

    Start by looking at these views in the database

    [font="Courier New"]INFORMATION_SCHEMA.TABLE_CONSTRAINTS

    INFORMATION_SCHEMA.DOMAIN_CONSTRAINTS

    INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE

    INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS

    INFORMATION_SCHEMA.CHECK_CONSTRAINTS

    INFORMATION_SCHEMA.CONSTRAINT_TABLE_USAGE[/font]

    😎

  • RE: Generating Auto Relationship

    madhukars 32911 (5/12/2014)


    Yes,

    I want to use JOINS, but this relationship is to be generated automatically on selection of the tables by the user.

    I don't think it is a good idea...

  • RE: Split row into columns

    This is not a dynamic solution, the number of columns are set in the code.

    😎

    USE tempdb;

    GO

    DECLARE @POLHIST TABLE

    (

    POLICY_DETAILS_ID VARBINARY(16) NOT NULL

    ...

  • RE: Help needed in join

    For comparison, here is a SQL 2012/2014 window function version. Without an POC index, Lynn's code is still faster.

    😎

    SELECT

    IdCompany

    ,CompanyName

    ,CompanyCode

    FROM

    (

    ...

Viewing 15 posts - 8,266 through 8,280 (of 8,753 total)