Decode URL encoded characters in inline table valued function?Inline table-valued function vs inline sqlT-SQL...

How do I add a strong "onion flavor" to the biryani (in restaurant style)?

How to modify 'inter arma enim silent leges' to mean 'in a time of crisis, the law falls silent'?

How to typeset a small black square as a binary operator?

What does @ mean in a hostname in DNS configuration?

Use intersection in field calculator

Why is Shelob considered evil?

Given the mapping a = 1, b = 2, ... z = 26, and an encoded message, count the number of ways it can be decoded

How do I write a maintainable, fast, compile-time bit-mask in C++?

Why is Bernie Sanders maximum accepted donation on actblue $5600?

What did Putin say about a US deep state in his state-of-the-nation speech; what has he said in the past?

Why is the meaning of kanji 閑 "leisure"?

Aliased pipeline using head and cut

Buying a "Used" Router

What is formjacking?

What is the name of this perspective and how is it constructed?

When distributing a Linux kernel driver as source code, what's the difference between Proprietary and GPL license?

Why do we divide Permutations to get to Combinations?

How do I handle a blinded enemy which wants to attack someone it's sure is there?

Did the characters in Moving Pictures not know about cameras like Twoflower's?

What does "don't have a baby" imply or mean in this sentence?

How can I differentiate duration vs starting time

Why write a book when there's a movie in my head?

Badly designed reimbursement form. What does that say about the company?

How many copper coins fit inside a cubic foot?



Decode URL encoded characters in inline table valued function?


Inline table-valued function vs inline sqlT-SQL View — How to 'pre-fetch' schema using scalar function, then populate using table queryHow to determine the data type of all fields in a result set in SSDT?CROSS APPLY on Scalar functionWhy scalar valued functions need execute permission rather than select?Table valued function VS Stored procedureCommon TVF in SQL server to get results from differnt schemaTable Valued UDF vs Stored Proc for passing values to a SELECT statementEfficiency of Scalar UDF vs TVFForced serialization on inline table valued function













0















I'm looking for a inline table valued function that decodes URL encoded characters (like %20 for space). reference



I see other functions but haven't seen one that is an inline table valued function. I'm tempted in just writing a bunch of REPLACE statements in a function but I'm wondering if there's a better way.



CREATE FUNCTION dbo.itvfURLDecode
(
@StringValue VARCHAR(MAX)
)
RETURNS TABLE

AS
RETURN (
SELECT REPLACE(REPLACE(@StringValue,'%2B','+'),'%20',' ') /* etc..*/ AS DecodedValue
)

;WITH cteData AS
(
SELECT 'This%2Bis%20a%20test%3C%3E%20ok%3F%20100%25' AS example
)
SELECT
example, q.DecodedValue /* returns: This+is a test<> ok? 100% */
FROM cteData c
CROSS APPLY dbo.itvfURLDecode(example) q








share



























    0















    I'm looking for a inline table valued function that decodes URL encoded characters (like %20 for space). reference



    I see other functions but haven't seen one that is an inline table valued function. I'm tempted in just writing a bunch of REPLACE statements in a function but I'm wondering if there's a better way.



    CREATE FUNCTION dbo.itvfURLDecode
    (
    @StringValue VARCHAR(MAX)
    )
    RETURNS TABLE

    AS
    RETURN (
    SELECT REPLACE(REPLACE(@StringValue,'%2B','+'),'%20',' ') /* etc..*/ AS DecodedValue
    )

    ;WITH cteData AS
    (
    SELECT 'This%2Bis%20a%20test%3C%3E%20ok%3F%20100%25' AS example
    )
    SELECT
    example, q.DecodedValue /* returns: This+is a test<> ok? 100% */
    FROM cteData c
    CROSS APPLY dbo.itvfURLDecode(example) q








    share

























      0












      0








      0








      I'm looking for a inline table valued function that decodes URL encoded characters (like %20 for space). reference



      I see other functions but haven't seen one that is an inline table valued function. I'm tempted in just writing a bunch of REPLACE statements in a function but I'm wondering if there's a better way.



      CREATE FUNCTION dbo.itvfURLDecode
      (
      @StringValue VARCHAR(MAX)
      )
      RETURNS TABLE

      AS
      RETURN (
      SELECT REPLACE(REPLACE(@StringValue,'%2B','+'),'%20',' ') /* etc..*/ AS DecodedValue
      )

      ;WITH cteData AS
      (
      SELECT 'This%2Bis%20a%20test%3C%3E%20ok%3F%20100%25' AS example
      )
      SELECT
      example, q.DecodedValue /* returns: This+is a test<> ok? 100% */
      FROM cteData c
      CROSS APPLY dbo.itvfURLDecode(example) q








      share














      I'm looking for a inline table valued function that decodes URL encoded characters (like %20 for space). reference



      I see other functions but haven't seen one that is an inline table valued function. I'm tempted in just writing a bunch of REPLACE statements in a function but I'm wondering if there's a better way.



      CREATE FUNCTION dbo.itvfURLDecode
      (
      @StringValue VARCHAR(MAX)
      )
      RETURNS TABLE

      AS
      RETURN (
      SELECT REPLACE(REPLACE(@StringValue,'%2B','+'),'%20',' ') /* etc..*/ AS DecodedValue
      )

      ;WITH cteData AS
      (
      SELECT 'This%2Bis%20a%20test%3C%3E%20ok%3F%20100%25' AS example
      )
      SELECT
      example, q.DecodedValue /* returns: This+is a test<> ok? 100% */
      FROM cteData c
      CROSS APPLY dbo.itvfURLDecode(example) q






      sql-server sql-server-2017





      share












      share










      share



      share










      asked 3 mins ago









      GabeGabe

      4281918




      4281918






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "182"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f230430%2fdecode-url-encoded-characters-in-inline-table-valued-function%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Database Administrators Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f230430%2fdecode-url-encoded-characters-in-inline-table-valued-function%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Anexo:Material bélico de la Fuerza Aérea de Chile Índice Aeronaves Defensa...

          Always On Availability groups resolving state after failover - Remote harden of transaction...

          update json value to null Announcing the arrival of Valued Associate #679: Cesar Manara ...