Forum Replies Created

Viewing 15 posts - 6,466 through 6,480 (of 7,164 total)

  • RE: Conditional Counting

    I think you want to use SUM with a CASE statement. Maybe something along these lines:

    SELECT SUM(CASE WHEN B.TRANS_TYPE = '2' THEN 1

    ...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: SSIS -Excel multiple sheet load

    I find it useful to loosely equate Excel Workbook files as databases and to think of a Workbook's Worksheets (aka Tabs) as tables. Just like with SQL Server you cannot...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: SQL Server 2008 / R2 date vs int

    mitch.fh (5/11/2011)


    don't get me wrong. I am in favour of using the datetype for dates,

    I just want to know if anyone made bigger test with those types before I move...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Is there any way to run the query more than 8000 character via openquery?

    lindsaywang (5/8/2011)


    Lutz,

    I only want to create one query has 8000+ charaters, and prove the openquery doesn't work. and see a solution for it. Becasue I can't give you the...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: insert fails with violation of PK on table with identity column as PK

    Please post the table definition including constraints and indexes as well.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Adding "Header" Information to the Beginning of the Root Node in XML

    JCSQL (5/9/2011)


    and can someone tell me how to paste the code so it looks EXACTLY like I have it in T-SQL? IT always looks terrible right after I post it.

    Surround...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Load Hexadecimal value into an Image column

    balasach82 (5/11/2011)


    We have to use Image datatype; thats the requirement. So if is there a way to load bytecode into image field by any means?

    IMAGE is a deprecated data type....

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Convert to bigint

    Ooops...wrong thread.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: SQL Server 2008 / R2 date vs int

    I have not tested them side-by-side however DATE has an edge in terms of its size...the storage size of an INT is 4 bytes while the storage size of the...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Join a query to a table

    Here's a working demo with the GROUP BY that shows the escape issue:

    SET NOCOUNT ON ;

    GO

    IF OBJECT_ID(N'tempdb..#Data') > 0

    DROP TABLE #Data ;

    GO

    CREATE TABLE #Data

    (

    id...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Join a query to a table

    PHXHoward (5/11/2011)


    opc.three (5/11/2011)


    Jason, your solution, while it may produce the correct result, will inevitably perform very poorly when run against a large set of data. I would offer one tweak...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Load Hexadecimal value into an Image column

    If you're using SQL2005 you should not be using the IMAGE data type...use VARBINARY instead.

    You can convert a hex string to VARBINARY using the CONVERT function...make sure you pay attention...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Calculating Median and Percentiles

    Very cool. Thanks for the additional link and for your notes.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Divide By Zero Error

    It could be ANSI_WARNINGS or ARITHABORT.

    ANSI_WARNINGS and ARITHABORT are both ON for new query windows in SSMS 2008 R2 by default which DOES allow Divide By Zero errors to bubble...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Join a query to a table

    PS Be careful with using the XML RAW method as well...it escapes characters like ampersands and angle brackets to their XML-safe equivalents (namely &ampamp; , &amplt; and &ampgt;) so...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

Viewing 15 posts - 6,466 through 6,480 (of 7,164 total)