Forum Replies Created

Viewing 15 posts - 3,706 through 3,720 (of 8,731 total)

  • RE: how to convert recursive CTE's into normal sql queries

    siddharthak024 (11/30/2015)


    @MYDBA

    Yes I want to port this code to other platform.

    Then it might depend on the platform. Oracle has something called START WITH...CONNECT BY which could help you.

    If you give...

    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: Using CROSS APPLY instead of sub queries.

    This should be equivalent, but I don't have data to test.

    SELECT A.SITEID

    ,AeSubCount

    ,SubCnt

    ,ROUND(( CAST(AeSubCount...

    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 on sql query

    Trust me Luis that I understand the difference. 😉

    I know you do, but the OP or others 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: Need help on sql query

    Sean Lange (11/30/2015)


    vineetbhargav (11/30/2015)


    Create table #tab(ID int , COLA char(5), COLB char(5) ,COLC char(5))

    INSERT INTO #tab(ID ,COLA, COLB, COLC)

    VALUES(1001,'1AAA' ,null, null), (1001 ,null,'2BBB', null),(1001,null,null, '3CCC')

    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: Help on understanding recursive cte

    It replaces character by character in the column Data using DataToReplace and ReplacedWithData. One each recursion it replaces one character and removes one character from the auxiliar columns. In 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: how to convert recursive CTE's into normal sql queries

    It depends on what the recursive CTE is doing. Here's an example, but you need to test and be sure it's a better option. It's a while loop, but it's...

    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?

    Brandie Tarvin (11/30/2015)


    Eirikur Eiriksson (11/27/2015)


    Brandie Tarvin (11/27/2015)


    My SO just informed me that he's learned how to write a LEFT INNER JOIN in Oracle.

    And now my head is just spinning with...

    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: Help Needed in dynamic sql

    KGJ-Dev (11/30/2015)


    Hi Jeff,

    I would be using this against real table and not temp table. just to play with test data i gave temp variable and data on my sample....

    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: Happy Thanksgiving 2015

    Larnu (11/30/2015)


    FridayNightGiant (11/26/2015)


    Larnu (11/26/2015)


    Unless I'm doing something funny, when I run D, I actually get 27/11/2015 (when i run it for this year, sorry, I forgot to mention that). Just...

    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 CTE (recursive queries)

    eut.kop (11/26/2015)


    serg-52 (11/26/2015)


    Yes, you can currently have only 2 levels.

    CREATE table categoria(

    [id_categoria] [int] NOT NULL,

    [categoria] [nvarchar](50) NULL

    );

    INSERT INTO categoria

    VALUES

    (1, 'horror'),

    (2, 'fantascienza');

    CREATE table...

    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: trigger - old value new value

    Please stop making new threads for the same problem.

    Focus on a single thread to solve the issue completely and let people follow the advice you've been given.

    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: Trigger result from inserted / Deleted

    You could try using the OUTPUT clause in your code, instead of trying to use dynamic sql in your triggers.

    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?

    Lynn Pettis (11/25/2015)


    Help, I can't read and don't know how to attach a file... Sorry, some people are finding it easier to push my buttons today.

    He really is...

    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: Creation of a record for the loss of a customer

    The last condition can be simplified to

    where

    oa1.AccountID is not null or oa2.AccountID is not null

    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: rows not retrieved with my query

    And by the way, you might want to change your WHERE clause to something like this to make it SARGable:

    where RUN_TIME >= DATEADD( qq, DATEDIFF( qq, 0, GETDATE()), 0)

    ...

    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 - 3,706 through 3,720 (of 8,731 total)