Forum Replies Created

Viewing 15 posts - 3,391 through 3,405 (of 15,381 total)

  • RE: Help Needed in Avoiding RBAR

    KGJ-Dev (1/20/2015)


    Understood and thanks for your suggestion. What would happen If i use OUTPUT.inserted UserId instead of OUTPUT.deleted UserId

    In an UPDATE or DELETE statement you would get the value...

  • RE: How to sum and group data

    If Steve's guess is correct this is a basic SUM with GROUP BY.

  • RE: How to sum and group data

    tino.lopez (1/20/2015)


    I posted the original data in data example.xls as an attachment.

    Right but we don't know what you want for output and the data is not consumable. It is much...

  • RE: Help Needed in Avoiding RBAR

    KGJ-Dev (1/20/2015)


    In my post i didn't mention about transaction and having try catch block. I am already having that. Didn't include inmy post. So no worries on that piece.

    One more...

  • RE: Help Needed in Avoiding RBAR

    Stephanie Giovannini (1/20/2015)


    Added a transaction. These two update statements should always be grouped in an explicit transaction.

    SET XACT_ABORT ON;

    BEGIN TRAN;

    with cte as

    (

    select userid, SUM(Amount) sumAmount

    ...

  • RE: How to sum and group data

    tino.lopez (1/20/2015)


    Thank you for the advice and pointers. Much appreciated! I am receiving the error attached.

    that's because the code I posted was missing an alias. I don't have anything to...

  • RE: How to sum and group data

    Hi and welcome to SSC! It is not exactly clear what you are trying to do. I would recommend you don't need to load mountains of test data, just enough...

  • RE: query or other solution to find active databases in sql instance

    SQL Guy 1 (1/20/2015)


    You can create a daily/hourly/minutely job that queries sys.databases join sys.sysprocesses and inserts results into a some table, and run it for a while.

    Could also add...

  • RE: Help Needed in Avoiding RBAR

    KGJ-Dev (1/20/2015)


    Hi Sean,

    thanks for the reply and my bad. updated the data on my original post two process happening

    1. Updating the balance on the table @UserBalance

    2. Making the...

  • RE: CASE Statement with NUll, converting to (2) decimals

    You just need to further simplify your case expression. You should replace the whole case expression with this:

    SUM(ISNULL(a.exposure_amt, a.bond_amt) * i.exchange_rate) AS 'Rolling 12 Month Company Exposure'

    This has the added...

  • RE: Help Needed in Avoiding RBAR

    Awesome job with ddl and sample data. The problem here is that your desired output is exactly the same as the data you start with.

  • RE: query or other solution to find active databases in sql instance

    jim.metcalf1974 (1/20/2015)


    I have a database instance with about 80 db's on it.

    I am trying to figure out which db's are actively used.

    is there a way for me to see in...

  • RE: Error Trying to Setup Sys DSN

    scottthompson (1/20/2015)


    I have a Win7 Pro client computer trying to connect to a GreatPlains SQL database using System DSN. I can enter an IP address followed by the instance,...

  • RE: Are the posted questions getting worse?

    Ed Wagner (1/20/2015)


    Brandie Tarvin (1/20/2015)


    Sean Lange (1/20/2015)


    We are finally starting to move our ERP to a new system (well new to us but still rather antiquated). In the process of...

  • RE: ID or Id

    Eric M Russell (1/20/2015)


    Sean Lange (1/20/2015)


    Eric M Russell (1/20/2015)


    I've used product_id. I like typing code in all lowercase, both keywords and identifiers, which is ok so long as underscores are...

Viewing 15 posts - 3,391 through 3,405 (of 15,381 total)