Forum Replies Created

Viewing 15 posts - 226 through 240 (of 371 total)

  • RE: How to Get Month Using Given two Dates

    No problem. 🙂

    If you need all possible months between two dates you could use something like this:

    DECLARE @STRING VARCHAR(500),

    @DATE1 DATETIME,

    ...

    Best regards,

    Andre Guerreiro Neto

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

  • RE: How to Get Month Using Given two Dates

    You're talking about only two dates?

    If yes, the following should work for you:

    DECLARE @STRING VARCHAR(500),

    @DATE1 DATETIME,

    ...

    Best regards,

    Andre Guerreiro Neto

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

  • RE: IF (1=0) BEGIN SET FMTONLY OFF END

    Wow, that's odd.

    Thank you for the information.

    Interesting behaviour.

    Best regards,

    Best regards,

    Andre Guerreiro Neto

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

  • RE: Query Plan Execution Order

    SQLRNNR (10/27/2011)


    Gianluca Sartori (10/27/2011)


    LadyRuna (10/27/2011)


    I got it right, but only because I've read Grant Fritchey's book about execution plans. 🙂

    Ouch! I read that book as well.

    I'm totally hopeless.

    Ha - I...

    Best regards,

    Andre Guerreiro Neto

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

  • RE: Multi-Database View in SQL Server 2000 - Restricting Permissions

    Wouldn't a distributed partitioned view help achieve that?

    Best regards,

    Best regards,

    Andre Guerreiro Neto

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

  • RE: Spatial Data Types

    Such an easy question since you are allowed to create columns of type GEOMETRY.

    I'm amazed that 41% got it wrong.

    Maybe it's because of the answer #4 that can lead to...

    Best regards,

    Andre Guerreiro Neto

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

  • RE: Violating Foreign Keys

    Thomas Abraham (10/25/2011)


    #7 fails because personname is declared NOT NULL in the table def, I believe.

    Yes, you're right. I was so sure that there were five values being passed.

    Thanks for...

    Best regards,

    Andre Guerreiro Neto

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

  • RE: Violating Foreign Keys

    As Paul White would say, this is one of those questions that turns us into a T-SQL parser. 😀

    But nice question.

    Almost got it wrong because I couldn't see the error...

    Best regards,

    Andre Guerreiro Neto

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

  • RE: Extracting records with the latest date

    Ah, I see.

    Try this:

    SELECT * FROM dbo.TblTemp AS TMP1

    INNER JOIN (SELECT MAX(Date) AS Date, Vendor FROM dbo.TblTemp

    ...

    Best regards,

    Andre Guerreiro Neto

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

  • RE: Extracting records with the latest date

    nfpacct (10/24/2011)


    Sorry Andre,

    I omitted one key item in the request. I would like the max date for by a field in my table called vendor.

    The suggested query works as it...

    Best regards,

    Andre Guerreiro Neto

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

  • RE: Extracting records with the latest date

    You could use something like this:

    SELECT Fields FROM dbo.MyTable

    WHERE MyDate = (SELECT MAX(MyDate) FROM dbo.MyTable);

    Best regards,

    Best regards,

    Andre Guerreiro Neto

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

  • RE: Update table

    Hugo Kornelis (10/24/2011)


    In the relational model, there is no order of a table. Without an ORDER BY, rows can be returned in any order the optimizer sees fit. So while...

    Best regards,

    Andre Guerreiro Neto

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

  • RE: Update table

    wware (10/24/2011)


    OK, I just got it, thanks to mtassin's explanation and my reread of Hugo's original explanation ("there are no other columns in the table.") In this scenario, because...

    Best regards,

    Andre Guerreiro Neto

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

  • RE: Update table

    dg1407 (10/24/2011)


    Sometimes questions here look more like riddles rather than teaching questions, still there thanks for the effort... 😀

    Oh, but they do teach us a lot. 🙂

    Sometimes a QoTD followed...

    Best regards,

    Andre Guerreiro Neto

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

  • RE: Is moving or resizing templog without connecting to the database engine possible?

    caspersql (10/23/2011)


    A prompt for password appears, however the cmd window no longer allows me to type in any text. Hitting keys on my keyboard does not have any effect...

    Best regards,

    Andre Guerreiro Neto

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

Viewing 15 posts - 226 through 240 (of 371 total)