Forum Replies Created

Viewing 15 posts - 4,711 through 4,725 (of 5,109 total)

  • RE: SQL comma separated values and a loop

    paul 69259 (12/8/2016)


    There is a slight problem in that if J.DELLPOSTCODE is blank in the database it seems to not put any post codes at all in the destination field...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: Disk space full

    What exactly do you mean by "increase"? The only way the literally increase the disk capacity of a drive is to buy a new disk drive, with a larger capacity....

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: SQL comma separated values and a loop

    The WHERE clause I asked you to add is in the Sub Query.... It should be at the bottom, where your WHERE clause goes. No wonder it's taking so long,...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: Looking for SQL Built-in rule to permanently replace a character with another in a string.

    There isn't a blanket "replace all", no. However, with a single quotation, your problem would still arise regardless.

    If you want to blanket replace ' with `, your SQL statement...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: DBA without sa rights???

    It might seem silly, but the SQL Server security is there for a reason. If you're not permitted to do something, then you're not permitted. If there was a a...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: SQL comma separated values and a loop

    paul 69259 (12/8/2016)


    it is something to do with that line

    WHERE J.JOBID IN (SELECT sq.JOBID FROM dbo.Drops sq)

    that it doesn't like

    That statement should have very little effect on your...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: SQL comma separated values and a loop

    paul 69259 (12/8/2016)


    No graphics. It's as if it's stuck in an infinite loop of some sort. It's only a small report that they export to excel and it's filtered down...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: SQL comma separated values and a loop

    What do you mean by "Gets stuck"?

    The query should run just as fast in SSRS as it does in SSMS. The only reason SSRS may be taking longer is due...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: Continue on error

    davidvarga086 (12/8/2016)


    Thom A (12/8/2016)


    What you're looking for is BEGIN TRY:

    BEGIN TRY

    EXEC thisspdoesnotexist_sp;

    END TRY

    BEGIN CATCH

    RAISERROR('Enter your error message here',1,0);

    END CATCH

    That only points...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: SQL comma separated values and a loop

    YOur previous example had a join to DROPS, which has now been omitted. you could amend this by adding the following WHERE clause:

    WHERE J.JOBID IN (SELECT sq.JOBID FROM dbo.Drops sq)

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: Concatenate fields with separator character using XML PATH

    When using values of multiple types, SQL Server will always use Data Type Precedence (Transact-SQL). As you can see, INT is higher in the list than VARCHAR, so INT takes...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: Continue on error

    What you're looking for is BEGIN TRY:

    BEGIN TRY

    EXEC thisspdoesnotexist_sp;

    END TRY

    BEGIN CATCH

    RAISERROR('Enter your error message here',1,0);

    END CATCH

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: SQL comma separated values and a loop

    Your precious example would return no row for that collection if there is no drop. Is that intentional? Hence why I left the NULL.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: SQL comma separated values and a loop

    Phil Parkin (12/7/2016)


    IF my understanding is correct, STUFF should do what you want.

    You had the same idea as me, though STUFF is not doing much here other than removing an...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: SQL comma separated values and a loop

    IF my understanding is correct, STUFF and FOR XML PATH should do what you want. I haven't tested this mind, as I don't have any sample data or DDL.

    CREATE...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

Viewing 15 posts - 4,711 through 4,725 (of 5,109 total)