If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > column formula

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-20-02, 04:20
cuneyt cuneyt is offline
Registered User
 
Join Date: Nov 2002
Posts: 59
column formula

Hi everybody,

I have an company table and it has 2 columns, Company Code and User Code, I

am incrementing "User Code" with "column identity" property of MS SQL Server

2K. I have different companies and those companies have different users. When

I increment User Code one by one, of course it doesnt consider whether it is

the same company or not.

Question 1: How can I satisfy this condition below?

EX:

company user
1---------1
1---------2
2---------3
2---------4
3---------5
4---------6


What I want is

company user
1---------1
1---------2
1---------3
2---------1
2---------2
3---------1
3---------2
3---------3

etc.


Question 2: I want to know that whether it is possible to do that by writing

column formula or not?
Reply With Quote
  #2 (permalink)  
Old 12-20-02, 14:42
Steve_LL Steve_LL is offline
Registered User
 
Join Date: Dec 2002
Location: London, Ontario - Canada
Posts: 3
You may want to add a third column for that information, so that you can have a column with PK for joining other tables to. Are you asking whether a script can be written to modify the user codes after they're entered, or as they're being entered?
Reply With Quote
  #3 (permalink)  
Old 12-21-02, 10:45
cuneyt cuneyt is offline
Registered User
 
Join Date: Nov 2002
Posts: 59
thanx

it's ok now, thanx for help
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On