Forum Replies Created

Viewing 15 posts - 2,491 through 2,505 (of 8,731 total)

  • RE: Pick Records Based On Condition!

    Great, just be sure to understand it perfectly. 😉

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: need t-sql query

    Here are the 2 options I mentioned earlier. The recursive CTE has the advantage of returning the results in a single query. The set-based loop (in my experience) is usually...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: need t-sql query

    This is easily achievable with a recursive CTE or a set-based loop[/url]. The issue is that you mention that C doesn't have a parent, but it has one on the...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Script to stop service using XP_CMDSHELL, restore full and differential .bak files in a single script

    lsalih (7/18/2016)


    I am going to look further into it and see what is happening.

    Meantime may I ask you how you run two CMDSHELL commands in the same transaction. Do...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Script to stop service using XP_CMDSHELL, restore full and differential .bak files in a single script

    lsalih (7/18/2016)


    No, I do not. In such case how you stop two services within TSQL script.

    Transactions are made to handle changes in the database within a certain connection. Stopping/Starting services...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Streaming itvf in CLR to replace special characters

    I didn't remember this when you first posted your problem, but have you tried using SQL#? It has Replace functions that might help you.

    http://www.sqlsharp.com/

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Script to stop service using XP_CMDSHELL, restore full and differential .bak files in a single script

    Do you realize that xp_cmdshell is not affected by explicit transactions?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Today's Random Word!

    Ed Wagner (7/18/2016)


    HappyGeek (7/18/2016)


    Ed Wagner (7/18/2016)


    Revenant (7/18/2016)


    crookj (7/18/2016)


    whereisSQL? (7/18/2016)


    djj (7/18/2016)


    Revenant (7/15/2016)


    Luis Cazares (7/15/2016)


    HappyGeek (7/15/2016)


    Ed Wagner (7/15/2016)


    Luis Cazares (7/15/2016)


    Ed Wagner (7/15/2016)


    Grumpy DBA (7/15/2016)


    Ray K (7/14/2016)


    crookj (7/14/2016)


    Manic Star (7/14/2016)


    Pikachu

    Bless you

    Gesundheit

    Health

    System

    Broken

    Bureaucracy

    Gone mad!!

    Fell in...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Pick Records Based On Condition!

    This could give you an idea.

    SELECT *

    INTO #SampleData

    FROM(

    SELECT 123456, 789, 'N' UNION ALL

    SELECT 123456, 789, 'N' UNION ALL

    ...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Today's Random Word!

    HappyGeek (7/15/2016)


    Ed Wagner (7/15/2016)


    Luis Cazares (7/15/2016)


    Ed Wagner (7/15/2016)


    Grumpy DBA (7/15/2016)


    Ray K (7/14/2016)


    crookj (7/14/2016)


    Manic Star (7/14/2016)


    Pikachu

    Bless you

    Gesundheit

    Health

    System

    Broken

    Bureaucracy

    Gone mad!!

    Fell in love

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: stored procedure to delete or insert values

    itortu (7/15/2016)


    can the second sp be called from within the first sp?

    Yes, but that's not the point.

    You'll delete once and insert multiple times. That's the way to call them from...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: stored procedure to delete or insert values

    Then maybe, you should create one stored procedure to delete and one to insert.

    If you'll always have an array that will have the rows that must remain stored, then you...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: stored procedure to delete or insert values

    Why not use MERGE to do an UPSERT and forget about deleting rows? Just insert or update depending on if a row exists or not.

    Or if you don't want to...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Assistance with CROSS APPLY with multiple tables

    Jabba1963 (7/15/2016)


    Thanks for looking at this Luis...

    The good news is that I had already adopted the windows partitioning approach as you suggested - so good to know I was heading...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Today's Random Word!

    Ed Wagner (7/15/2016)


    Grumpy DBA (7/15/2016)


    Ray K (7/14/2016)


    crookj (7/14/2016)


    Manic Star (7/14/2016)


    Pikachu

    Bless you

    Gesundheit

    Health

    System

    Broken

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 15 posts - 2,491 through 2,505 (of 8,731 total)