Forum Replies Created

Viewing 15 posts - 6,001 through 6,015 (of 8,731 total)

  • RE: Performance Tuning a query running since more than 13 minutes

    faisalfarouqi (8/13/2014)


    Luis Cazares (8/13/2014)


    Could this be part of the problem? There's a huge difference between estimated and actual number of rows.

    [font="Comic Sans MS"]What do you suggest then? It might be...

    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: Performance Tuning a query running since more than 13 minutes

    Could this be part of the problem? There's a huge difference between estimated and actual number of rows.

    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: Performance Tuning a query running since more than 13 minutes

    Can you post table, index and views definitions?

    My guess is that your problem is with dbo.AGGR_DAY_SUBSCRIPTION_ADDITIVE_METRICS_V. But can't be sure.

    I agree with Gail, no one will look at a report...

    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: problem with ISNULL syntax

    This is another option that might perform better considering that it reads the table once instead of twice. I can't assure that but it could be worth the try.

    SELECT ISNULL(CAST...

    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: Query help, please

    There might be a problem with your data and you might have duplicate ids on either of your tables. A quick solution could be the following but it might not...

    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: Conversion failed when converting the varchar value '3R' to data type int.

    You're comparing strings (LEFT result) with integers. Due to implicit conversion, the strings are being converted to integers and generating an error. Just add some quotes to convert your integers...

    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: Implicit transaction mode

    Ed Wagner (8/12/2014)


    This behavior is a lot more like Oracle (of old, anyway) than SQL Server. Thanks for the question.

    Except that Oracle will auto commit a transaction with any...

    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: Display single row

    Or maybe you could filter the columns with a condition. I'm not sure if it'll be better.

    SELECT column1,

    column2,

    column3,

    ...,

    ...

    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: SQL book for a beginner? -need suggestions

    This might not be the correct version (I'm not sure if there's one for 2014) but it can help you out.

    http://www.amazon.com/Microsoft-Server-Fundamentals-Developer-Reference/dp/0735658145

    You could also read some of the stairways in this...

    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 help with building a view

    This seems horrible because of the triangular join that it includes, but it might get you what you need without dynamic sql. Why are you duplicating the rows? Would an...

    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: creating a SQL View with calculations

    Using a CTE is basically the same but in different order. I prefer this approach but it's just personal preference.

    ALTER VIEW [dbo].[crvKCLPRInsJob]

    AS

    WITH CTE AS(

    SELECT

    ...

    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: Problems with a order of the rows

    Hi Rodrigo,

    Craig has a point and we might need more information. The following query works with the sample data but might not be exactly what you need.

    SELECT *

    FROM #item

    ORDER BY...

    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 for inserting records in batches from one table to another table

    Or you can use Import/Export wizard (or SSIS) to transfer the data in batches.

    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: SQL DBA high ended question (5+ years’ experience)

    Beatrix Kiddo (8/7/2014)


    Or worse "It's Password, with a capital P".

    That isn't policy compliant, it needs to be P4$$w0rd as shown on MS courses.

    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 help pivoting tables

    Using some guesses, this might help you to read the table just once and do the pivot at once.

    SELECT T0.ItemCode AS 'Item Code'

    ,T0.ItemName AS 'Item Name'

    ...

    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 - 6,001 through 6,015 (of 8,731 total)