Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7804423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:54:34+00:00 2026-06-02T01:54:34+00:00

Mssql have a function parseURL . But we have moved our database from mssql

  • 0

Mssql have a function parseURL.
But we have moved our database from mssql to mysql.

Mysql doesnot have parse url, Now we need to create parseURL function manually.

How to create parse url function in mysql?

this is mssql function

`

SET QUOTED_IDENTIFIER ON  
SET ANSI_NULLS ON  
GO  
CREATE      FUNCTION [dbo].[parseURL]  (@strURL varchar(1000))  
RETURNS varchar(1000)  
AS  
BEGIN  
IF CHARINDEX('http://',@strURL) > 0 OR CHARINDEX('https://',@strURL) > 0  
-- Ghetto-tastic  
SELECT @strURL = REPLACE(@strURL,'https://','')  
SELECT @strURL = REPLACE(@strURL,'http://','')  
SELECT @strURL = REPLACE(@strURL,'www','')  
-- Remove everything after "/" if one exists  
IF CHARINDEX('/',@strURL) > 0 (SELECT @strURL = LEFT(@strURL,CHARINDEX('/',@strURL)-1))  

-- Optional: Remove subdomains but differentiate between www.google.com and www.google.com.au  
IF (LEN(@strURL)LEN(REPLACE(@strURL,'.','')))/LEN('.') < 3 - if there are less than 3 periods  
SELECT @strURL = PARSENAME(@strURL,2) + '.' + PARSENAME(@strURL,1)  
ELSE -- It's likely a google.co.uk, or google.com.au  
SELECT @strURL = PARSENAME(@strURL,3) + '.' + PARSENAME(@strURL,2) + '.' + PARSENAME(@strURL,1)  
RETURN @strURL  
END  
GO  

`

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T01:54:36+00:00Added an answer on June 2, 2026 at 1:54 am

    SQL Server doesn’t have a function called parseURL either. Wherever you’re calling this function, run:

    EXEC sp_helptext 'parseURL';
    

    If you show us the definition of the function, we can help you translate it and create an equivalent function for MySQL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function that pulls articles records from an MSSQL database. Some are
I have function where I read from a mysql table a set of value.
Do MySQL have any function by which I can split data of a column
I have a PHP function which inserts multiple records into MySQL: function commit_purchase($asset_type_ID, $org_ID,
I have a problem regarding the datediff MYSQL function, I can use it and
...specifically, the fn_listextendedproperty system function in MSSQL 2005. I have added an Extended Property
i have tableA in sql database , and tableB in mysql database , How
I have a mssql database in which my primary keys are GUIDs. I am
Is it at all possible to have a table valued function in MSSQL that
Possible Duplicate: How to run a database script file from Delphi? I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.