Forum Replies Created

Viewing 15 posts - 541 through 555 (of 1,957 total)

  • RE: Bitwise OR function

    joakim.fenno (3/19/2014)


    Thanks!

    You're welcome 🙂

    Lets start with the "int" flag version, its does not produce the correct output if you add a value 101 (menas true for month 1, false for...

  • RE: Bitwise OR function

    Here are three ways you could tackle this. I prefer number three, which is to store the month number as a tinyint.

    They all produce the same result, but query 2...

  • RE: Why would wrapping a TSQL query in an if statement increase its runtime significantly?

    I have to say "I don't know", but it's interesting and if anyone wants to join in, this AdventureWorks query shows similar symptoms:

    select count(*)

    from sales.salesorderdetail

    where salesorderid not in (select salesorderheader.salesorderid...

  • RE: Split String with row terminator

    The problem is in your sample data at position 407 (highlighted below - unfortunately it is not visible, but that character is the problem)

    Delete that one character from your data...

  • RE: Split String with row terminator

    Jeff's addition of the WHERE clause is designed to prevent SQL Injection and possible data corruption by only allowing data that conforms to the listed character sets.

    You have an illegal...

  • RE: Split String with row terminator

    What is the error and what is the output of

    Print @MyString

    ?

  • RE: Converting datetime to bigint: Native formats: reverse engineering.

    You could inspect the CLR with a tool such as ILSpy, but it looks like it is working out the number of ten millionths of a second since 1/1/0000 taking...

  • RE: Split String with row terminator

    Jeff Moden (3/16/2014)


    then either use BCP/BULK INSERT to load it or use a well written CLR to split it.

    +1

    ...Or split the text in your front end application (that is currently...

  • RE: Pipe Row to Column

    That query works from a TABLE variable - @t, just use your table in place of @t.

    To make things easier and to get better answers, try to provide consumable test...

  • RE: Pipe Row to Column

    Your code nearly worked, here is a tweaked version that does.

    declare @t table ([MemberID] char(8), Codes varchar(4000));

    insert @t values

    ('00000123','012|222|123|333'),

    ('00000233','012|222|332'),

    ('00000244','012|211'),

    ('00000332','012')

    SELECT [MemberID]

    ,x.query('field[1]/text()').value('.','VarChar(10)') CODE1

    ,x.query('field[2]/text()').value('.','VarChar(10)') CODE2

    ,x.query('field[3]/text()').value('.','VarChar(10)') CODE3

    ,x.query('field[4]/text()').value('.','VarChar(10)') CODE4

    ,x.query('field[5]/text()').value('.','VarChar(10)') CODE5

    ,x.query('field[6]/text()').value('.','VarChar(10)') CODE6

    ,x.query('field[7]/text()').value('.','VarChar(10)') CODE7

    ,x.query('field[8]/text()').value('.','VarChar(10)') CODE8

    ,x.query('field[9]/text()').value('.','VarChar(10)') CODE9

    ,x.query('field[10]/text()').value('.','VarChar(10)') CODE10

    ,x.query('field[11]/text()').value('.','VarChar(10)')...

  • RE: Testing if CLR is enabled from within a function

    It's fugly, but have you tried wrapping your clr function in a t-sql function?

    That will prevent the parser error.

    I have tested it on a "hello world" function to...

  • RE: SSRS - show reports like slideshow

    The way I would do this is probably via a customer web page with a ReportViewer control that handled switching reports...

    But, you can do it with a parent report as...

  • RE: ssms Display in Vertical Tabs

    It's a bit hard to visualise what you are trying to achieve, any chance of a screenshot of your 2008 layout?

  • RE: Auto-Refresh Report with new parameter each time

    That example uses a table called runtimestore to keep track of which number/variant of data you require. You could use any table on the server for this.

  • RE: SSRS Display dataset results horizontally

    You can simply add a couple of extra columns and use a matrix in your report, but this assumes you want to order by name...

    e.g.

    select

    names

    , row_number() over(order...

Viewing 15 posts - 541 through 555 (of 1,957 total)