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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:53:30+00:00 2026-05-22T01:53:30+00:00

I was wondering if someone can help me out. I am creating a simple

  • 0

I was wondering if someone can help me out. I am creating a simple script where I want to auto increment a number into a field with the number being lead by 7 0’s.

Example: 00000001

Here is my script: its a small update script

DECLARE @EDI NVARCHAR(55)
SET @EDI=0000000
UPDATE TESTER11111
SET @EDI=EDI=@EDI+1
WHERE ssq='education'

instead of incrementing the numbers as 00000001, 00000002.
its incrementing as 1, 2, 3, etc.

what am I doing wrong? how can i insert those leading 7 0’s?

EDI is the column that I am inserting the increments.

  • 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-22T01:53:31+00:00Added an answer on May 22, 2026 at 1:53 am

    Let the table increment (and just store integers), but there’s no reason I can think of not to go ahead and format on the select statement; a fixed number format is as much data as business logic

     SELECT Right(Replicate('0',8)+Convert(nvarchar(8),EDI),8)
    

    EDIT: if you must save the formatted values:

    DECLARE @EDI NVARCHAR(55) 
    SET @EDI=0
    UPDATE TESTER11111 
    SET @EDI=EDI=Right(Replicate('0',8)+Convert(nvarchar(8),@EDI+1),8) 
    WHERE ssq='education'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was wondering if someone can help me out - working on a bit
I was wondering if someone can help me out with this issue. I have
I'm wondering if someone can help me out. I have a form_dropdown which I'm
Just wondering if someone can help me figure out why my menu is doing
I have a small problem and wondering if someone can help me out. I'm
I am wondering if someone can help me figure out the best approach to
Hey guys, I'm wondering can someone help me out. I'm using javascript to serialize
I am wondering of someone could help me out. I want to display random
Just wondering if someone can help me out with this quickly. I have a
Just wondering if someone could help me with a very simple SQL query. I

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.