Are the posted questions getting worse?

  • Thom A

    SSC Guru

    Points: 98505

    This doesn't surprise me at all, but it does surprise me that BBC realises it's so bad it's a headline: BBC News - Copycat coders create 'vulnerable' apps https://www.bbc.co.uk/news/technology-49960387

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.

  • Eirikur Eiriksson

    SSC Guru

    Points: 182399

    Thomas Rushton wrote:

    BrainDonor wrote:

    SQL Saturday in Edinburghย  - 1st Feb, anybody from here thinking about going?

    I would do, except I'm playing in a show all that week.ย  Bad timing...

    We all do that every day, called going to work ๐Ÿ˜‰

    ๐Ÿ˜Ž

  • drew.allen

    SSC Guru

    Points: 76686

    Steve Jones - SSC Editor wrote:

    Thom A wrote:

    OH gods, it has a WHERE 1=1 clause too. ??

    This is likely built dynamically, so the 1=1 provides a basis for the query.

    But it's easy enough to clean up.ย  Just REPLACE(REPLACE(@sql, '1=1 AND ', ''), 'WHERE 1=1', '').ย  So if there are additional conditions, you remove the 1 = 1 and the following AND, otherwise you remove the WHERE 1 = 1.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • Steve Jones - SSC Editor

    SSC Guru

    Points: 717276

    drew.allen wrote:

    But it's easy enough to clean up.ย  Just REPLACE(REPLACE(@sql, '1=1 AND ', ''), 'WHERE 1=1', '').ย  So if there are additional conditions, you remove the 1 = 1 and the following AND, otherwise you remove the WHERE 1 = 1.

    Drew

    True, but two issues.

    1. No where and this errors out. I have [select .... where order by xxx ]
    2. This code is part of what's buried in plug ins or Project Nami, and we need an author to take a PR and update their code. Otherwise, all upgrades break.

    It is a good idea, and something that I hope we'll implement, but it's not as simple to change as you think

  • Jonathan AC Roberts

    SSCoach

    Points: 17087

    Steve Jones - SSC Editor wrote:

    drew.allen wrote:

    But it's easy enough to clean up.ย  Just REPLACE(REPLACE(@sql, '1=1 AND ', ''), 'WHERE 1=1', '').ย  So if there are additional conditions, you remove the 1 = 1 and the following AND, otherwise you remove the WHERE 1 = 1.

    Drew

    True, but two issues.

    1. No where and this errors out. I have [select .... where order by xxx ]
    2. This code is part of what's buried in plug ins or Project Nami, and we need an author to take a PR and update their code. Otherwise, all upgrades break.

    It is a good idea, and something that I hope we'll implement, but it's not as simple to change as you think

    I think the optimiser will evaluate WHERE 1=1 at compile time. So removing it would make absolutely no difference to the performance of the query.

  • Steve Jones - SSC Editor

    SSC Guru

    Points: 717276

    This does change some parameterization stuff, but I think it prevents simple mode, which I'm not sure would be used here. Not sure, and haven't dug into this as other work is still ongoing.

  • drew.allen

    SSC Guru

    Points: 76686

    Steve Jones - SSC Editor wrote:

    drew.allen wrote:

    But it's easy enough to clean up.ย  Just REPLACE(REPLACE(@sql, '1=1 AND ', ''), 'WHERE 1=1', '').ย  So if there are additional conditions, you remove the 1 = 1 and the following AND, otherwise you remove the WHERE 1 = 1.

    Drew

    True, but two issues.

     

      <li style="list-style-type: none;">

    1. No where and this errors out. I have [select .... where order by xxx ]

     

      <li style="list-style-type: none;">

    1. This code is part of what's buried in plug ins or Project Nami, and we need an author to take a PR and update their code. Otherwise, all upgrades break.

     

    It is a good idea, and something that I hope we'll implement, but it's not as simple to change as you think

    I don't see how you are getting SELECT ... WHERE ORDER BY xxx assuming that you are starting with SELECT ... WHERE 1=1 ORDER BY xxx, the first replace won't match, because there is no trailing AND, so it will leave you with the original string and the second will produce SELECT ... ORDER BY xxx, because the WHERE is included in the matching string 'WHERE 1=1'.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • Steve Jones - SSC Editor

    SSC Guru

    Points: 717276

    Ah, you're right, Drew. I was thinking this was a code replacement that would leave the WHERE, but that would work. However, it's also a PR to upstream modules, not something we want to change directly.

     

  • Jo Pattyn

    SSC-Dedicated

    Points: 31335

    Oracle driver oddities: create table as select * @from_dblink 1 minute. SSIS select * + rowcount: 80 minutes with Oracle Oledb ๐Ÿ™

  • Brandie Tarvin

    SSC Guru

    Points: 172707

    Jo Pattyn wrote:

    Oracle driver oddities: create table as select * @from_dblink 1 minute. SSIS select * + rowcount: 80 minutes with Oracle Oledb ๐Ÿ™

    Does the SSIS time go down if you use a column list instead of *?

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Jo Pattyn

    SSC-Dedicated

    Points: 31335

    Doesn't seem to make a difference. I'll have to try it in a proper testing environment

  • Luis Cazares

    SSC Guru

    Points: 183586

    The normal Oracle drivers for SSIS are really slow. The worst part is that it seems to be by design. I had far better luck exporting to a flat file and getting data from there.

    Have you tried using the Attunity Connectors?

    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
  • Eirikur Eiriksson

    SSC Guru

    Points: 182399

    Jo Pattyn wrote:

    Oracle driver oddities: create table as select * @from_dblink 1 minute. SSIS select * + rowcount: 80 minutes with Oracle Oledb ๐Ÿ™

    Is this on an on-prem or in the "foggy" (cloud)

    ๐Ÿ˜Ž

     

  • Jo Pattyn

    SSC-Dedicated

    Points: 31335

    Is on-premise. Tried the Attunity Connectors but can't find how to use expressions (SQL command from variable) for incremental updates.

  • Eirikur Eiriksson

    SSC Guru

    Points: 182399

    I've found that using the latest Oracle drivers is much more efficient than the MS drivers, is that an option?

    ๐Ÿ˜Ž

    BTW: in a recent project, I experienced up to 10x difference between different drivers ๐Ÿ™

Viewing 15 posts - 64,066 through 64,080 (of 64,368 total)

You must be logged in to reply to this topic. Login to reply