Forum Replies Created

Viewing 15 posts - 76 through 90 (of 371 total)

  • RE: Sequences I

    I chose "1" as the default start value because I thought it would have the same behaviour of the IDENTITY property which defaults to "start with 1, increment 1". Seems...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: Grouping by ten days period

    dwain.c (4/18/2012)


    Here's a solution that will create the 10 day groups for only the groups where you have data.

    DECLARE @startdate DATETIME

    SELECT @startdate = DATEADD(year, DATEDIFF(year, 0, '2010-05-31'), 0)

    ;WITH Dates AS...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: Foreign key

    Thanks for the question.

    I think what the author meant was that a FK cannot reference an external database and the explanation says there is a way to SIMULATE a FK...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: DMV Problem - dm_exec_query_stats

    ggjjbb1983 (4/5/2012)


    Is there any reason why a sample scan would be performed instead of a full scan?

    I may be guessing it wrong here but maybe it's because a statistics update...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: VIEWS 5

    After reading through the excellent debate around views last week, I was sure what to answer even though there were few answers to choose this time. Thank you for making...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: View to show calculated column

    Also Lutz' solution is probably easier to understand and maitain with that OUTER APPLY. ๐Ÿ˜‰

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: View to show calculated column

    How about something like this:

    SELECT X.Description,

    X.DueDate,

    X.Colour

    FROM (SELECT ROW_NUMBER() OVER (PARTITION BY T.Description ORDER BY...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: VIEWS 4

    @alex: indeed. In my last job, views were used everywhere but they were not schema bound. I talked them into using that option whenever new objects were created and we...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: SP_Who_3

    Sorry, misread the error messages.

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: VIEWS 4

    L' Eomot Inversรฉ (3/29/2012)


    the solution is (a) make views schema bound and (b) test the apps properly if you change the schema. Doing either will prevent the particular problem...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: How to use rank over this query

    Thanks a lot for the detailed explanation!

    I got confused thinking that ORDER BY 0 or 1 was about the column order like in:

    SELECT TOP(10) name, type FROM sys.objects ORDER BY...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: SP_Who_3

    If I get this right and you want to run this without creating the procedure, you'll need to declare the variables that are passed as parameters to the procedure.

    DECLARE

    @run_mode NVARCHAR(12)...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: How to use rank over this query

    Mark-101232 (3/30/2012)


    with cte as (

    select stageid,stagestatustypeid, applictaionid,

    row_number() over(partition by applictaionid order by case when stagestatustypeid<>1 then 0 else 1 end,stageid desc) as rn

    from...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: Find Customers Who Bought "A" and "B" But Not "C" (SQL Spackle)

    Jeff Moden (3/29/2012)


    Thanks for the feedback, Andre. I just have to get better at beating the general public at my own game. ๐Ÿ˜›

    I love this forum and this community....

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

  • RE: Find Customers Who Bought "A" and "B" But Not "C" (SQL Spackle)

    Hi, Jeff.

    Indeed. I was at work and couldn't test it properly.

    I should've noticed that the IN clause may bring results from either A OR B. ๐Ÿ™‚

    That's an excellent article by...

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA

Viewing 15 posts - 76 through 90 (of 371 total)