Forum Replies Created

Viewing 15 posts - 2,911 through 2,925 (of 8,731 total)

  • RE: Charindex in inner join affects the perfomance

    Please, read these articles and come back.

    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    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: Historical Date

    This is a quick test on the date you would be using when run at different times. Are the values correct? Other than the formula, your code doesn't seem 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: Charindex in inner join affects the perfomance

    Does this help a bit?

    Select a.mycolumn,count(distinct(c.mycolumn))

    from table1 a with (nolock)

    inner join table2 b with(nolock) on a.id=b.id

    inner join table3 c with (nolock) on a.mycolumn LIKE '%' + c.mycolumn + '%'

    group 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: Creating Dynamic SSIS Packages

    Have you checked BIML? it might help you create dynamic SSIS packages.

    Stairway to Biml[/url]

    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: Trying to write a query which fetches total net for sales order that are having same sales order as bevergaes

    If I understand correctly, this is a sample code base loosely on AdventureWorks database.

    SELECT SUM(LineTotal)

    FROM Sales.SalesOrderDetail d

    WHERE d.SalesOrderID IN( SELECT i.SalesOrderID

    ...

    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: Historical Date

    If server is 5 hour ahead of CST, but you're still taking the time from the server. Why would you need to change the time? What time defines "today" and...

    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: Are the posted questions getting worse?

    jeff.mason (5/3/2016)


    The developer needs to get over it. It's a reasonable request and will take him five minutes to do.

    Less if using a template, or more if he's 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: Corrupted index - find out what caused it

    Alan.B (5/2/2016)


    terry999 (5/2/2016)


    Hi

    I got this error on a scheduled integrity check. SQL 2005 sp2

    Data row does not have a matching index row in the index '' (ID 2). Possible...

    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!

    djj (5/3/2016)


    Grumpy DBA (5/3/2016)


    crookj (5/3/2016)


    ThomasRushton (5/3/2016)


    Chips

    Highway (Patrol)

    Ponch (Frank Poncherello)

    Fat

    Fluffy

    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: Update Table if Stored Proc Does Not Complete

    If the procedure is stopped and it's properly written, it might have to rollback everything that has been done. Because you're using a single transaction, right?

    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: Remove duplicates in result set

    Mac1986 (5/2/2016)


    Thanks a million for differing me to the old thread. I got the answer from there .

    ROW_NUMBER() OVER(PARTITION BY ser.servername ORDER BY ser.servername DESC) AS RowID,

    Just a small note....

    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: Remove duplicates in result set

    I'm heading out of the office, but the solution is the same as the one I posted on this thread: http://www.sqlservercentral.com/Forums/Topic1782605-3077-1.aspx

    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: loop through table where one field always has different value

    Your data makes no sense. How do you define a relation between each fruit and its value?

    There's no order in a table, you need additional values. Hopefully, this isn't a...

    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: Trouble with dates

    You just add an INSERT INTO between the CTE and the final SELECT.

    WITH CTE AS(

    SELECT Something

    FROM Somewhere

    )

    INSERT INTO Destination

    SELECT *

    FROM CTE;

    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: Trouble with dates

    I understood this a little different from Smendle.

    WITH CTE AS(

    SELECT *,

    ROW_NUMBER() OVER( PARTITION BY CUST_NUMBER, CAST(CASH_DRWR_DATE AS...

    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,911 through 2,925 (of 8,731 total)