Forum Replies Created

Viewing 15 posts - 2,206 through 2,220 (of 8,731 total)

  • RE: Need to add AM PM to a datestamp

    You don't, you use 24 hours.

    So, these are AM:

    '2016-08-30 08:00:00.000'

    '2016-08-30 11:59:59.997'

    And these are PM:

    '2016-08-30 20:00:00.000'

    '2016-08-30 23:59:59.997'

    Also, you need to take in account that seconds will always be zero(:00) for smalldatetime...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Temporary Functions?

    ScottPletcher (8/31/2016)


    That doesn't use a "global variable". It creates a proc name that starts with ##. Only table names like that become global temp tables. The proc...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: INSERT RECORDS INTO EXISTING TABLE

    Don't put it at the top of the procedure, put it at the top of the SELECT statement.

    The same way you have INSERT INTO #TMP_AllNeonates

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Today's Random Word!

    Ed Wagner (8/31/2016)


    Grumpy DBA (8/31/2016)


    Ed Wagner (8/31/2016)


    Revenant (8/30/2016)


    Reptile

    Mammal

    Mammaries

    Memories

    Mementos

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Random Values between 0.25-6.5

    Here's an article on generating random integers and floats. The best part is that it doesn't have to go row by row.

    http://www.sqlservercentral.com/articles/Data+Generation/87901/

    DECLARE @Range decimal(5,2) = 6.5-.25, @StartValue decimal(5,2) = .25;

    SELECT...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Datetime as INT

    I would say that it's because of a bad decision applied to the design. However, that could only be answered by the people who actually did the design or at...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: SSIS Syntax question - Using the HHMM from GETDATE() function

    You could use the following:

    (DT_WSTR, 6)( (DATEPART( "HH", GETDATE())*10000) + (DATEPART( "MI", GETDATE())*100) + DATEPART( "SS", GETDATE()))

    Or this other option:

    REPLACE( SUBSTRING( (DT_WSTR, 30)GETDATE(), 12, 8), ":", "")

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Where's the error?

    There were so many possible problems with the view and the update, that I concentrated in the wrong one.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: simple dynomic Transpose 2 column as 2 rows

    I had a good solution, but I won't post anything without seeing some real effort.

    The problem seems to be coming from these 2 threads:

    http://www.sqlservercentral.com/Forums/Topic1808920-3077-1.aspx

    http://www.sqlservercentral.com/Forums/Topic1809713-3077-1.aspx

    Once I see real effort and...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Need to group within a query I'm already grouping

    Here are 2 options along with sample data. Apparently, your counts per date don't match the real values.

    CREATE TABLE #Sample(

    Territory char(8),

    Letter_Code char(10),

    ...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: DDL and TRANSACTIONS

    The DDL and transaction myth might come from Oracle and deformed badly. Hopefully, the myth that DDL is not affected by transactions will be gone eventually.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Today's Random Word!

    Hugo Kornelis (8/29/2016)


    Ed Wagner (8/29/2016)


    Ray K (8/29/2016)


    djj (8/29/2016)


    Hugo Kornelis (8/29/2016)


    Ed Wagner (8/29/2016)


    crookj (8/29/2016)


    djj (8/29/2016)


    Ed Wagner (8/27/2016)


    TomThomson (8/26/2016)


    Grumpy DBA (8/26/2016)


    whereisSQL? (8/26/2016)


    Explode

    Implode

    Collapse

    Fall

    Trip

    ACID (and no - this is not about SQL) :hehe:

    Pink...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Silly question about backup

    Unfortunately, there's no way to downgrade databases or their backups. You'll need to find another way to replicate prod data in your dev server, or simply upgrade it.

    PS. Not a...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Export Output/Log Info to .CSV

    You need to add logging to your package and define a file destination for the log.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Group by with update statement

    Phil Parkin (8/29/2016)


    Luis Cazares (8/29/2016)


    afreenraja (8/29/2016)


    Thanks.

    I will try these.

    Try to understand them, so if there's an error you can correct it.

    There is more than one syntax error here (I thought...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 15 posts - 2,206 through 2,220 (of 8,731 total)