Forum Replies Created

Viewing 15 posts - 4,606 through 4,620 (of 10,144 total)

  • RE: Updating field

    The RETURN value of a stored procedure is kinda reserved for the error status. 0 means no error, any other number means an error occurred. Check the stored procedure for...

  • RE: how to concatenate o as perfix in case statment ?

    ravi@sql (5/9/2013)


    Hi All,

    Thank you for your valuble reply .. finally am able to over come my prob .. here is the query

    Declare @date Datetime='2013-06-16 00:00:00.000'

    select...

  • RE: Convert binary string to binary

    j2cagle (5/9/2013)


    I just cut-n-pasted from above:

    DECLARE @VARBINARY VARBINARY (16)

    SET @VARBINARY = CONVERT(VARBINARY (16),'0x0000000000018662',1)

    SELECT @VARBINARY;

    go

    DECLARE @VARBINARY VARBINARY (16)

    SET @VARBINARY = CONVERT(VARBINARY (16),'0x0000000000018662',0)

    SELECT @VARBINARY;

    go

    You missed the @@version...

  • RE: Convert binary string to binary

    Lynn Pettis (5/9/2013)


    When I run the following in SQL Server 2008 R2:

    DECLARE @VARBINARY VARBINARY (16)

    SET @VARBINARY = CONVERT(VARBINARY (16),'0x0000000000018662',1)

    SELECT @VARBINARY;

    go

    DECLARE @VARBINARY VARBINARY (16)

    SET @VARBINARY = CONVERT(VARBINARY (16),'0x0000000000018662',0)

    SELECT @VARBINARY;

    go

    I get;

    0x0000000000018662

    0x30783030303030303030303030313836

    Same here.

  • RE: Convert binary string to binary

    j2cagle (5/9/2013)


    That's what I've been trying, but that results in:

    0x30783030303030303030303030313836

    Interesting - I get the same as you if I execute the batch against SQL Server 2000. Against 2k8 it appears...

  • RE: Convert binary string to binary

    j2cagle (5/9/2013)


    I have a string: '0x0000000000018662' that I want to "use" as a binary: 0x0000000000018662. CONVERT/CAST does not work because, I think, it's converting byte by byte the binary/ascii representation...

  • RE: JOIN on tables dropping records

    How many rows are returned if you comment out the WHERE clause?

  • RE: Need the Recordset with high performance

    -- standard crosstab query

    SELECT [SlNo#] = ROW_NUMBER() OVER(ORDER BY GrandTotal DESC),

    OrganizationName, HumanResourse, Finance, HelpDesk, ITDevision, GrandTotal

    FROM (

    SELECT

    OrganizationName,

    HumanResourse= SUM(CASE WHEN DeptName = 'HumanResourse' THEN Total ELSE 0 END),

    Finance=...

  • RE: Major Challenge - Too Hard to Summarize

    paul.j.kemna (5/9/2013)


    So if I don't want to alter the contents of the SLHIH table directly, do I need to put the results of the query into a temp table and...

  • RE: Query seems to be constrained by single core CPU in multiple core server - any suggestions?

    Thanks for the feedback, and you're welcome. An actual plan for the revised query would be very interesting - if you have the time.

  • RE: do Distinct, Group By, Order By & Union (without All)

    suneet.mlvy (5/9/2013)


    drew.georgopulos (5/8/2013)


    all take the same hit on Sort?

    Is there any way to mitigate that or conditions that make one cheaper than another forcing uniqueness?

    thanks very much

    drew

    I don't think...

  • RE: Query seems to be constrained by single core CPU in multiple core server - any suggestions?

    Eugene Elutin (5/9/2013)


    --WHERE LEFT(CompanyIdentifier, 5) != 'EXCLU' -- NOT SARGABLE

    WHERE CompanyIdentifier NOT LIKE 'EXCLU%' -- SARGABLE

    Yeah, I thought about this one too, but if you check attached execution plan...

  • RE: Major Challenge - Too Hard to Summarize

    paul.j.kemna (5/9/2013)


    I am still walking through these (have to work on something else this morning) but ChrisM, does this UPDATE actually update the SLHIH table, or does it just update...

  • RE: Query seems to be constrained by single core CPU in multiple core server - any suggestions?

    Here's a basic crosstab query to get you started. It might just work 😉

    SELECT

    CompanyIdentifier,

    ,COALESCE(Field1,Field2)

    ,COALESCE(Field3,Field4)

    ,Field5

    FROM (

    SELECT

    CompanyIdentifier,

    Field1 = MAX(CASE WHEN FieldIDNumber = 1 THEN Data END),

    Field2 = MAX(CASE WHEN FieldIDNumber =...

  • RE: Major Challenge - Too Hard to Summarize

    -- Have a look at the result of this:

    -- ('#' is an arbitrary divider between the columns of one table and the columns of another)

    SELECT h.*, '#' '#', x.*

    FROM...

Viewing 15 posts - 4,606 through 4,620 (of 10,144 total)