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 8553535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:40:29+00:00 2026-06-11T14:40:29+00:00

I am working on an Intranet helpdesk website that provides a search on some

  • 0

I am working on an Intranet helpdesk website that provides a search on some tables. Each table has the exact same schema, but is presented slightly differently depending on the purpose. For example, the Blog will display author names to the user while the FAQ and Guides sections will not. The tables have the following columns:

id int IDENTITY,
title VARCHAR(255),
body NVARCHAR(MAX),
author VARCHAR(80),
date DATETIME,
lasteditor varchar(80),
lastedited DATETIME,
CONSTRAINT [PK_blog_id] PRIMARY KEY CLUSTERED
([id] ASC)

I would like for the results of each table to return a rank with respect to all of the tables.

I am using Transact SQL (SQL Server 2008), so full text indexes require a primary key to operate on. So far I’ve come up with two possibilities to solve the problem of getting a unique key for the fulltext index:

  1. Create a View every time a search is performed that unions all of the tables, and generates a unique ID column on the View using something like this:

        SELECT id,
        variety,
        1 + (SELECT COUNT(*) FROM tbl WHERE t.id < id) as num
        FROM tbl
    
  2. Merge all of the tables into one big table, and append an extra column denoting the type (i.e “blog”, “faq”, “guides”, etc). Use bigtable’s primary key as the key for the fulltext index, and get the “table” I want using an extra WHERE clause.

Which one is considered better practice, or performs better? It would seem like creating a view and generating an “auto-increment” for the view everytime someone performs a global site search is a bit slow. Maybe there’s an easier way of generating a unique id column for the view?

  • 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-11T14:40:31+00:00Added an answer on June 11, 2026 at 2:40 pm

    I think you answered your own question 1) seems like a bad idea unless you have a compelling reason for there to be 4 tables that are essentially the same.

    Go with 2 and when you add a new text object later you will be glad

    “For example, the Blog will display author names to the user while the FAQ and Guides sections will not. The tables have the following columns”

    This is all business logic. Don’t make this decision in the DB layer. Make the decision based upon the type field.

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

Sidebar

Related Questions

I have a website that I am working on that has both an intranet
I'm working with an intranet system that, on each page, checks the user's cookie,
I'm working on an intranet-only web application (J2EE) that requires some basic security features.
I am working on a website that will only be available via the intranet
I am working on a website that uses Sitecore CMS. An intranet webpart was
I am working for an intranet application. Therefore I have some control on the
I'm working with a intranet website written in ASP.NET and need to be able
I'm working on a project for my companies intranet which requires that multiple attached
I am working on ASP.NET 4.0 MVC3 web application that works in intranet environment.
I'm working on a web product that may be hosted as an intranet site.

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.