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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:57:19+00:00 2026-05-30T06:57:19+00:00

In my database, I have a computed column based off of the ID field.

  • 0

In my database, I have a computed column based off of the ID field. Its formula is like so:

('Q'+right('00000'+CONVERT([varchar],[EnquiryID],(0)),(6)))

This means it’ll prepend 0’s upto 6 digits long. For example if my ID was 5, it’ll be Q000005. If its 100 it’ll be Q000100.

I’ve noticed that my ID is already at 4000 after just a few weeks. So my computed column looks like Q004000.

My question is, once it gets to say Q999999. Will it start at 1 again or add another 0 automatically? So will it go back to Q000001 or will it be Q1000000?

  • 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-30T06:57:20+00:00Added an answer on May 30, 2026 at 6:57 am

    Let’s use our brain cells and logically analyze this:

    • your EnquiryID value goes to 1’000’000 – so your CONVERT(varchar, EnquiryID, 0) returns 1000000
    • next you prepend this with five zeroes, which gives you: 000001000000
    • now you take the six right-most characters of that, which are: 000000
    • and you prepend a Q giving you the result of Q000000

    So I guess you better drop that computed column and re-create it with more digits! 🙂

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

Sidebar

Related Questions

I have Database with date field. I see the time like: 1900-01-01 13:38:00.000 How
I have a column like this in 1 of my database tables DateCreated, datetime,
I am using EF4 in my application. In database, I have computed column which
i have database table like this +-------+--------------+----------+ | id | ip | date |
In mysql database i have this column called: Name: Date Type: datetime I have
In the database I have a field with a .mht file. I want to
Scenario: In the database I have a field called Categories which of type string
I have PDF file data in a SQL Server database, in the column type
All tables in the database have one timestamp column [ float ] followed by
How to add an computed column to the model class. I have two models

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.