Forum Replies Created

Viewing 15 posts - 406 through 420 (of 1,468 total)

  • Reply To: Relational Table SQL Query Optimization/Performance Issue?

    I would start by using an INNER JOIN, rather than a sub-query

    SELECT      cs.SuppllierID
    FROM CommoditySupplier AS...
  • Reply To: Execute a procedure with parameter from table, one by one

    As a general rule of thumb, you want to avoid looping.

    So, I would be looking to rewrite the proc that is being called from the loop to process the data...

  • Reply To: SET OPTIONS question

    If you have the value of the SetOptions, this will identify what options are ON|OFF

    DECLARE @options int = 4347;

    SELECT so.SetOption
    , OptionState =...
  • Reply To: Need help to calculate in Single Query

    Adelia wrote:

    Hye all,

    My below T-SQL is that accurate calculation?

    SELECT  
    get_customeVal_3 = ISNULL( SUM( CASE WHEN year_num = 2015 AND chart_code <> '36101' AND chart_code <> '39102'...
  • Reply To: Need help to calculate in Single Query

    Something like this?

    DECLARE @batch_Id uniqueidentifier = '4245a9c9-4e34-4178-94f9-002a0fe7846b';

    DECLARE @year1 int = 2014; /*current year*/
    DECLARE @year2 int = 2013; /*last year*/

    WITH cteBase AS (
    SELECT ...
  • Reply To: Get some row depending of Date of nexts rows

    Although Jonathan's solution works for the given sample data, I believe that this is actually an ISLANDS problem.

    Unfortunately, I don't have the time to put together a solution at this...

  • Reply To: Servername in middle of unc path

    What didn't work?  How are we supposed to help you debug when you don't give us anything to work with?

    Perhaps you are looking for the machine name, and not the...

  • Reply To: Select and update statement

    Show us what you have tried, and what you are trying to achieve.

    Then we can assist you to correct any errors in the code.

  • Viewing 15 posts - 406 through 420 (of 1,468 total)