The Funny Stored Procedure Name

  • Toreador - Friday, February 8, 2019 1:52 AM

    Must admit, I don't quite see the point in teaching us about a feature that most of us have probably never heard of if that feature is deprecated so we won't ever use it...

    I agree with Toreador on this except that you also said it's a security hole.  Explaining how it's insecure might be useful.

  • The reason I added this, and a few other questions, is that you may run into this and should understand how it works. Knowledge might be helpful and the discussion may give you knowledge or reasons to argue against continuing this practice.

    Always remember your frame of reference may change, so having more information, to me, is valuable.

  • I don't know why people call ancient feature a "security hole".  I And the only time it's actually a risk is if you go to drop the proc. You can't define which part to drop.  It's all the procs in the numbered "group".

    We didn't use it for versioning back in the day.  We used it to number steps in an execution order.  I say "we" but it wasn't me.  It was someone else's idea at a company I worked at a very long time ago.  It did help de-declutter things a bit but I still wouldn't use it even if it weren't deprecated because you can't drop a single numbered part.  You can, however, alter a numbered part.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Steve Jones - SSC Editor - Friday, February 8, 2019 8:29 AM

    The reason I added this, and a few other questions, is that you may run into this and should understand how it works. Knowledge might be helpful and the discussion may give you knowledge or reasons to argue against continuing this practice.

    Always remember your frame of reference may change, so having more information, to me, is valuable.

    The question about a replacement for it recently came up on these very forums.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Toreador - Friday, February 8, 2019 1:52 AM

    ...I don't quite see the point in teaching us about a feature that most of us have probably never heard of if that feature is deprecated so we won't ever use it...

    I agree with Steve on this one (he gave his reason in another reply). To state it a little differently: the fact that the feature can still be used means that someone might suggest that you use it. Knowing what it does and why you shouldn't use it is certainly beneficial, as it will help prevent the situation where you unwittingly use it. Deprecated doesn't mean that it will ever be fully removed. So it never really hurts to know as much as possible about the environment in which we are working. People often use inferior / problematic features because they haven't been removed and some people don't know any better, such as not using TEXT / NTEXT / IMAGE datatypes, and a lot of other things. Remember, "knowing is half the battle!" 😉

    Take care, Solomon..

    SQL#https://SQLsharp.com/ ( SQLCLR library ofover 340 Functions and Procedures)
    Sql Quantum Lifthttps://SqlQuantumLift.com/ ( company )
    Sql Quantum Leaphttps://SqlQuantumLeap.com/ ( blog )
    Info sitesCollations     •     Module Signing     •     SQLCLR

  • Jeff Moden - Friday, February 8, 2019 6:31 PM

    The question about a replacement for it recently came up on these very forums.

    Thank you for this question. Hopefully, this will provide some context.

    If you use Crystal Reports (CR) and connect your report to a stored procedure, you have seen this in practice. CR will automatically post-pend the version to a stored procedure - using the example here, CR shows GetOne;1 and GetOne;2 as available options. This is true of the most recent version of the software (2016 / ver. 14). I do not see a way to remove the version manually, nor is there a setting which will ignore it.

    CR reads the available SQL objects to populate its lists. So if a future release of SQL Server no longer provides the version, only the stored procedure name (i.e. GetOne) would be shown. This is not an issue when connecting new reports, but what happens to the old reports with saved connections pointing to a stored procedure with a version? These reports will start to fail.

    Imagine an entire repository of reports that suddenly stop working after a SQL Server upgrade...

  • RLilj33 - Tuesday, February 12, 2019 8:36 AM

    Imagine an entire repository of reports that suddenly stop working after a SQL Server upgrade...

    And this is why many features have been deprecated for years and years and so few of them every actually get removed from functioning. I wish they would take a harder stance on some deprecated features and make them disappear. It is the only way some people will ever go back and update their code.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Sean Lange - Tuesday, February 12, 2019 8:53 AM

    And this is why many features have been deprecated for years and years and so few of them every actually get removed from functioning. I wish they would take a harder stance on some deprecated features and make them disappear. It is the only way some people will ever go back and update their code.

    I still don't understand why text and image (among other things) are yet to be removed, but is it bad that I (kind of) look forward to the day they are? Purely because people will start crying out that their system "broke" after they upgraded to SQL Server 20XX and that the error is "Type text is not a defined system type."; despite that the system was almost certainly designed after 2005, and on an instance that was at least using SQL Server 2005 as well. I know it seems harsh, but considering the data types are still in SQL Server 2019, they would have had at least 16 years to change the datatype.

    Thom~

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

  • Thom A - Tuesday, February 12, 2019 9:04 AM

    I still don't understand why text and image (among other things) are yet to be removed, but is it bad that I (kind of) look forward to the day they are? Purely because people will start crying out that their system "broke" after they upgraded to SQL Server 20XX and that the error is "Type text is not a defined system type."; despite that the system was almost certainly designed after 2005, and on an instance that was at least using SQL Server 2005 as well. I know it seems harsh, but considering the data types are still in SQL Server 2019, they would have had at least 16 years to change the datatype.

    I agree with you both. Personally, I would like the option to go away as well to simplify things - while it would be some extra work on our part, the change is relatively small (based on our report repository, about 1 day of dev work + 1 day of QA work).

    In our case, we can't update our code - the option isn't available to us. So we have to wait for the vendor to create the option; they are simply supporting what is available to them.

  • There is a lot of legacy code out there using text/image, and various other features. Large customers especially, and large vendors (think ERP, Accounting, etc.) that have legacy code they haven't bothered to update because it doesn't buy them anything, but they sell lots of $$ and units of their software, which sells SQL licenses.

    It's non trivial to update and certainly isn't days, but probably  months to clean their code and verify they haven't broken anything.

    I'm not sure if it was SQL 2016 or 2017, but Microsoft noted at a few conferences that they're not likely to deprecate or remove anything moving forward. It's too easy for them to automate testing and regression analysis of that code and removal potentially slows upgrades or causes them pain without benefits. Get used to text/image/numbered procs, dbm, and more being around forever.

  • Thom A - Tuesday, February 12, 2019 9:04 AM

    Sean Lange - Tuesday, February 12, 2019 8:53 AM

    And this is why many features have been deprecated for years and years and so few of them every actually get removed from functioning. I wish they would take a harder stance on some deprecated features and make them disappear. It is the only way some people will ever go back and update their code.

    I still don't understand why text and image (among other things) are yet to be removed, but is it bad that I (kind of) look forward to the day they are? Purely because people will start crying out that their system "broke" after they upgraded to SQL Server 20XX and that the error is "Type text is not a defined system type."; despite that the system was almost certainly designed after 2005, and on an instance that was at least using SQL Server 2005 as well. I know it seems harsh, but considering the data types are still in SQL Server 2019, they would have had at least 16 years to change the datatype.

    A simple reason to keep those types available is that Microsoft is still using them. I just ran this on my 2016 instance with the SSRS databases.

    SELECT OBJECT_NAME( object_id), c.name, t.name
    FROM sys.all_columns c
    JOIN sys.types t ON c.system_type_id = t.system_type_id
    WHERE t.name IN( 'text', 'ntext', 'image');

    SELECT OBJECT_NAME( object_id), p.name, t.name
    FROM sys.parameters p
    JOIN sys.types t ON p.system_type_id = t.system_type_id
    WHERE t.name IN( 'text', 'ntext', 'image');

    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
  • Luis Cazares - Tuesday, February 12, 2019 1:27 PM

    Thom A - Tuesday, February 12, 2019 9:04 AM

    Sean Lange - Tuesday, February 12, 2019 8:53 AM

    And this is why many features have been deprecated for years and years and so few of them every actually get removed from functioning. I wish they would take a harder stance on some deprecated features and make them disappear. It is the only way some people will ever go back and update their code.

    I still don't understand why text and image (among other things) are yet to be removed, but is it bad that I (kind of) look forward to the day they are? Purely because people will start crying out that their system "broke" after they upgraded to SQL Server 20XX and that the error is "Type text is not a defined system type."; despite that the system was almost certainly designed after 2005, and on an instance that was at least using SQL Server 2005 as well. I know it seems harsh, but considering the data types are still in SQL Server 2019, they would have had at least 16 years to change the datatype.

    A simple reason to keep those types available is that Microsoft is still using them. I just ran this on my 2016 instance with the SSRS databases.

    SELECT OBJECT_NAME( object_id), c.name, t.name
    FROM sys.all_columns c
    JOIN sys.types t ON c.system_type_id = t.system_type_id
    WHERE t.name IN( 'text', 'ntext', 'image');

    SELECT OBJECT_NAME( object_id), p.name, t.name
    FROM sys.parameters p
    JOIN sys.types t ON p.system_type_id = t.system_type_id
    WHERE t.name IN( 'text', 'ntext', 'image');

    Yeah sad isn't it??? They deprecate stuff and don't even fix their own code. 🙁

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

Viewing 12 posts - 16 through 26 (of 26 total)

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