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

  • SEARCH
  • Home
  • 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 1957970
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T07:57:16+00:00 2026-05-17T07:57:16+00:00

CREATE TABLE [dbo].[MembershipModule]( [Id] [uniqueidentifier] ROWGUIDCOL NOT NULL, [ParentId] [uniqueidentifier] NULL, [TargetId] [int] NULL,

  • 0
CREATE TABLE [dbo].[MembershipModule](
 [Id] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
 [ParentId] [uniqueidentifier] NULL,
 [TargetId] [int] NULL,
 [WebContentId] [uniqueidentifier] NULL,
 [Name] [varchar](35) NOT NULL,
 [NameUpper]  AS (isnull(upper([Name]),'')) PERSISTED NOT NULL,
 [UriPrefix] [varchar](max) NULL,
 [UriText] [varchar](max) NULL,
 [UriComputed]  AS ??? PERSISTED,
 [Description] [varchar](100) NULL,
 [Created] [date] NOT NULL,
 [Modified] [datetime2](7) NOT NULL,
 [MenuItem] [bit] NOT NULL,
 [Enabled] [bit] NOT NULL,
 [Position] [smallint] NULL,
 CONSTRAINT [PK_MembershipModule] PRIMARY KEY CLUSTERED 
(
 [Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

So far the UriComputed field is computed like this:

lower(replace(isnull([UriPrefix],'/')+coalesce([UriText],[Name]),' ','-'))

This produces output like the following

Results

Now, I’d want to terminate all UriComputed values with '/'. This would be easily accomplished by adding + '/' to the computed field, except for the fact that “textless” uris, would be terminated like //, which I don’t want happening.

since the sql I can put into a computed field is quite limited (and I don’t really know the extents of these limitations) I thought I’d ask here how to add this.

basically I want the output in the image to be

/a/login/
/a/announcements/
/a/
/

my closest attempt at doing this has been:

isnull(convert(varchar(MAX),nullif(len(coalesce([UriText],[Name])),0)),'/')

Which does kind of a mess, and adds a number if it should terminate in ‘/’, and adds ‘/’ when it should, what I’d need is the opposite ( that is, ‘/’ when the length is 0, ” otherwise)

If there’s an inline if or something like that I could use that would basically be it, but I don’t know about that.

Thank you!

  • 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-05-17T07:57:16+00:00Added an answer on May 17, 2026 at 7:57 am

    This worked for me:

    [UriComputed]  AS (CASE 
                         WHEN RIGHT(lower(replace(isnull([UriPrefix],'/')+coalesce([UriText],[Name]),' ','-')), 1) = '/' THEN
                           lower(replace(isnull([UriPrefix],'/')+coalesce([UriText],[Name]),' ','-'))
                         ELSE
                           lower(replace(isnull([UriPrefix],'/')+coalesce([UriText],[Name]),' ','-')) +'/'
                       END) PERSISTED,
    

    Full CREATE TABLE statement:

    CREATE TABLE [dbo].[MembershipModule](
     [Id] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
     [ParentId] [uniqueidentifier] NULL,
     [TargetId] [int] NULL,
     [WebContentId] [uniqueidentifier] NULL,
     [Name] [varchar](35) NOT NULL,
     [NameUpper]  AS (isnull(upper([Name]),'')) PERSISTED NOT NULL,
     [UriPrefix] [varchar](max) NULL,
     [UriText] [varchar](max) NULL,
     [UriComputed]  AS (CASE 
                         WHEN RIGHT(lower(replace(isnull([UriPrefix],'/')+coalesce([UriText],[Name]),' ','-')), 1) = '/' THEN
                           lower(replace(isnull([UriPrefix],'/')+coalesce([UriText],[Name]),' ','-'))
                         ELSE
                           lower(replace(isnull([UriPrefix],'/')+coalesce([UriText],[Name]),' ','-')) +'/'
                        END) PERSISTED,
     [Description] [varchar](100) NULL,
     [Created] [date] NOT NULL,
     [Modified] [datetime2](7) NOT NULL,
     [MenuItem] [bit] NOT NULL,
     [Enabled] [bit] NOT NULL,
     [Position] [smallint] NULL)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables: CREATE TABLE dbo.country ( cntry_id VARCHAR(2) NOT NULL, name VARCHAR(50)
Given a table such as: CREATE TABLE dbo.MyTestData (testdata varchar(50) NOT NULL) ALTER TABLE
CREATE TABLE [dbo].[INVS_ITEM_LOCATIONS] ([DEPARTMENT_CODE] [varchar](3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [IM_INV_NO] [numeric](10, 0) NOT NULL,
CREATE TABLE [dbo].[aspnet_Membership]( [ApplicationId] [uniqueidentifier] NOT NULL, [UserId] [uniqueidentifier] NOT NULL, Is there any
CREATE TABLE [dbo].[user]( [userID] [int] IDENTITY(1,1) NOT NULL, [fcode] [int] NULL, [scode] [int] NULL,
I have this table CREATE TABLE [dbo].[friend_blocked_list]( [subdomain] [varchar](50) NOT NULL, [un] [nvarchar](50) NOT
I have several tables: CREATE TABLE [dbo].[Tracks]( [Id] [uniqueidentifier] NOT NULL, [Artist_Id] [uniqueidentifier] NOT
Here is the SQL: CREATE TABLE dbo.TmpFeesToRules1(Name varchar, LookupId int) INSERT INTO dbo.TmpFeesToRules1(Name, LookupId)
create table person ( name varchar(15), attr1 varchar(15), attr2 varchar(1), attr3 char(1), attr4 int
Here's my table: CREATE TABLE `alums_alumphoto` ( `id` int(11) NOT NULL auto_increment, `alum_id` int(11)

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.