Forum Replies Created

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

  • RE: convert coulmns to row values

    Read the following article:

    http://www.sqlservercentral.com/articles/CROSS+APPLY+VALUES+UNPIVOT/91234/

    It explains what you need to do. It's easy if you understand it.

    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: Different values returned by converting the same value type float to 2 decimal from 2 different tables

    Remember that float is an approximate numeric data type. These things can happen when using it.

    You could try rounding or other options to reduce the errors.

    SELECT CAST( CAST( 2306.7555 as...

    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: Interview Questions Help

    j-1064772 (6/8/2016)


    Luis Cazares (8/5/2015)


    You could use something as the differences of EXEC() and sp_executesql. Or just ask for them. You might want to ask about how to prevent SQL Injection...

    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!

    Manic Star (6/8/2016)


    Ed Wagner (6/8/2016)


    crookj (6/8/2016)


    Grumpy DBA (6/8/2016)


    crookj (6/8/2016)


    Grumpy DBA (6/8/2016)


    Ed Wagner (6/8/2016)


    Printer

    3D

    goggles

    Oakley (the best snow goggles)

    Elementary school (My school - many many years ago)

    Learning

    Testing.

    Failing

    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 formatted output

    If exporting to a flat file, it doesn't have to be on "individual rows", just add some line feeds.

    SELECT Dept + char(10) +

    ( SELECT CAST( id...

    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: Are the posted questions getting worse?

    Ray K (6/8/2016)


    BrainDonor (6/8/2016)


    Many years ago I worked for a company that created a training course for deaf people. And yes, they advertised it on the radio.

    Kinda like wondering why...

    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: Sequential read from table

    Thom A (6/8/2016)


    If the OP wants to follow this solution (yes, we have discussed maybe it's not the "right" one, but my point remains), then it's a good starting point,...

    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: Are the posted questions getting worse?

    What's your impression on this campaign? https://youtu.be/vXeF6Uot8pk

    I feel that the main message is correct, but it's not handled correctly which ends up on the message being lost.

    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: Query taking 6 hrs and counting (HELP!)- how to concatenate rows into single string

    There's something going on with your server. Taking 16 hours to complete a single query is insane.

    We're assuming this is a table, but if it's a view, that could be...

    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: Are the posted questions getting worse?

    BrainDonor (6/8/2016)


    Ed Wagner (6/8/2016)


    djj (6/8/2016)


    Ed Wagner (6/8/2016)


    Jeff Moden (6/7/2016)


    Lynn Pettis (6/7/2016)


    Hugo Kornelis (6/7/2016)


    GilaMonster (6/7/2016)


    What I've advised for years is to notify on lack of success (eg: have a monitoring server...

    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: Sequential read from table

    For a fast sequential read of a table to move data from one system to another, you could also use SSIS.

    You're doing ETL work, use the ETL tool.

    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: Sum of amount per field O.S.s

    pinheiroinfo (6/7/2016)


    Good afternoon,

    I have a SQL code where I can score with 1,2 and 3 the amount of time between the O.S.s , but would like to add the amount...

    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: Microsoft SQL DBA (Large Hedge Fund)

    Lynn Pettis (6/7/2016)


    Sounds interesting, unfortunately New York City isn't really where I would like to work. Too bad this may not be a position open to a remote position.

    Actually,...

    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: Previous Result

    Here's the example for 2008 and 2012.

    DECLARE @Sample TABLE(

    ID int,

    Value money)

    INSERT INTO @Sample

    VALUES

    (1, 70 ),

    (1, 90 ),

    (2, 100),

    (2, 150);

    WITH CTE AS(

    ...

    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: Query taking 6 hrs and counting (HELP!)- how to concatenate rows into single string

    I would guess that blocking is happening somewhere in your db. Maybe there's an open transaction. Even with 2.6m rows, it shouldn't take hours to complete.

    However, this should be faster...

    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,731 through 2,745 (of 8,731 total)