Forum Replies Created

Viewing 15 posts - 856 through 870 (of 3,544 total)

  • RE: Query Active Directory from SQL

    khenlevy (1/8/2014)


    can anybody show me the reverse way?

    DECLARE @sid varbinary(39)

    SET @sid = 0x0105000000000005150000008BB113BE47890628D2E79F97E8030000

    SELECT 'S-1-5-21-'

    +CAST(CAST(CAST(REVERSE(CONVERT(binary(4),'0x'+sys.fn_varbintohexsubstring(0,@SID,13,4),1)) as varbinary(4)) as bigint) as varchar(10))

    +'-'+CAST(CAST(CAST(REVERSE(CONVERT(binary(4),'0x'+sys.fn_varbintohexsubstring(0,@SID,17,4),1)) as varbinary(4)) as bigint) as varchar(10))...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: False Error 8152 / String or binary data would be truncated

    If @P2 is IP Adress then you need to make it varchar(15) for IPv4 and upto varchar(39) for IPv6.

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Breaking Down Barriers

    I'm a developer and an

    - accidental

    - pretend

    - you are aren't you?

    - you have to be there is no one else!

    DBA

    so I am always arguing with...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Will SQL Server 2014 Support to Read BLOB (Byte Array)

    DECLARE @test varchar(max)

    SET @test = CHAR(1)+CHAR(87)+CHAR(179)

    SELECT CAST(CAST(SUBSTRING(@test,1,3) as varbinary(3)) as int)

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Find and Replace only the FIRST comma

    COALESCE(STUFF(SampleString,CHARINDEX(',',SampleString),1,';'),SampleString)

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Add Total to the query

    SELECT COALESCE(GroupName,'Total') AS [GroupName],SUM(NumberOfCases) AS [NumberOfCases]

    FROM #TempTable

    GROUP BY GroupName WITH ROLLUP

    ORDER BY GROUPING(GroupName) ASC

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Are the posted questions getting worse?

    Jeff Moden (12/17/2013)


    Damn... SSRS...

    Cursing twice in the same post, shame on you Jeff :w00t:

    Now wash your mouth out with soap and say 3 Hail Mary's 😛

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Pivot Rows to Columns with UnEven amounts of Rows based on Monthly Dates

    asheppardwork (12/17/2013)


    .. but I wanted to let you know I appreciate the thought and have actually gone down that rabbit hole with no success

    No problem 😀

    Just a thought I had,...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Pivot Rows to Columns with UnEven amounts of Rows based on Monthly Dates

    If this data is for SSRS then you do not have to pivot in T-SQL as you can use a matrix to do the pivoting and simplify the query.

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Time issues

    SELECT CONVERT(char(2),Times,108)+':00' AS [Times],SUM(ACD) AS [ACD],SUM(Other) AS [Other]

    FROM SampleData

    GROUP BY CONVERT(char(2),Times,108)

    ORDER BY CONVERT(char(2),Times,108) ASC

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Check box to be used as SSRS report parameter

    To see checkboxes in a parameter you have to set 'Allow multiple values'.

    This will show a drop down list with checkboxes.

    You cannot prevent the user selecting multiple values or the...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: split column into multiple records based on substring fixed lenght

    Richard Cranston (12/12/2013)


    So I was able to split column based on specific substring length and export the data to my target source; at which point I noticed data contained Line...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Banded Column Colors

    Is there a way I can get the value of the column when I have no data for that cell?

    Why?

    Because you are using a matrix when you apply fill to...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Banded Column Colors

    The value should not matter as you are testing the date for the column.

    Please post the expression you are using.

    An example would be

    =Choose(Weekday(Fields!Date.Value),"Red","Blue","Blue","Blue","Blue","Blue","Red")

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: How to check characters from string

    Lowell (12/12/2013)


    there is some support for patterns/regular expressions in SQL

    this does what you are asking, i think. one expression tests exactly ten characters, the other test the first ten characters

    WITH...

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 15 posts - 856 through 870 (of 3,544 total)