473,387 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

SQL SERVER 2000 T-SQL Problem

27
i have MAX CODE of 519999
and when i add 1 to this code.. it becomes 520000
Although i want to add only the rest 4 DIGIT(9999) to 1 NOT 51
so that it give me 5110000 (adding Dynamically)
I HAVE THE FOLLOWING Query.. Plz Help to Get the Desire Result..

@Branch=51
and Max CODE is 519999

SELECT @Code = @Branch + RIGHT(MAX(Code),@DIFAG) + 1
FROM tblmember (NOLOCK) WHERE LEFT(Code,2) = @Branch
Jan 21 '10 #1
1 1266
ck9663
2,878 Expert 2GB
Here are your options:

1. If you have a separate column for the Branch Code within your table, you don't need to include that on your CODE. You just concatenate them every time.
2. Use a calculated column
3. Use a trigger

Happy Coding!!!

~~ CK
Jan 21 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Brad Tilley | last post by:
Does Python run on Windows Server 2003? http://www.python.org/download/download_windows.html only lists the following: Python for Windows 95, 98, NT, 2000, ME, XP
2
by: Dave | last post by:
I have developed a VB.net application that transfers a SOAP wrapped message to another server securely(using SSL and sever/client certificates). When I run this app from a Windows 2000...
1
by: Chris | last post by:
I try to read a shared directory. This shared directory is on a 2000 server. When I use DirectoryInfo.Exists, I always have "This directory does not exist". If the shared directory is on a...
2
by: Petr PALAS | last post by:
Hi, when I open ANY ASP.NET application on my computer I get this message: ---------------------------------------------------------------------------- ---- Server Application Unavailable ...
5
by: Ken Cox [Microsoft MVP] | last post by:
MS has posted this here: http://www.asp.net/faq/ms03-32-issue.aspx Fix for: 'Server Application Unavailable' Error after Applying Security Update for IE...
1
by: Reza Sadeghi | last post by:
Hi I am getting this error when I tried to browse any asp.net in visual studio.net. I can build the project but when I try to run and debug the project I get error message that "Unable to start...
4
by: Glenn M | last post by:
I have a shared XML file on a server . i also have one xslt file that performs a simple transform on in to view the data. now i want to have another page that lets users modify the shared xml...
0
by: emu | last post by:
Hi All, I have an unmanaged C++ application that references a mixed mode image DLL (mixed managed and unmanaged). Under .NET 1.1 we could trust the dll (the mixed mode dll) by running the...
3
by: Darren | last post by:
Not sure if this has been covered before....... I have an issue with an asp.net application running on Windows 2000 server and Windows 2003 server:- The name generation of html objects (ie...
4
by: Hrsoft | last post by:
Dear Friends My developer environmment has a Windows 2000 SP4 Server, and I canīt to update to 2003 or 2008, for reasons of... money. But, I need to install in this 2000 Server SP4 the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.