Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sinjin67
Yak Posting Veteran
53 Posts |
Posted - 2008-04-09 : 20:00:52
|
| I have set a column called "Anumber", I amusing a computed value to get the PK ID # anda the letter "A" to it. ('A'+CONVERT([varchar](10),[requestid],(0)))The above works fine unless I copy a record,The copied record never displays the correctvalue like "A55" it keeps "NULL" as it value.Is their a better way to achieve a result asdescribed above ?I am coming from Foxpro to SQL, Any advice would be great.Thanks |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-04-09 : 20:13:35
|
| When you copy a record, what value is in requestid?Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
sinjin67
Yak Posting Veteran
53 Posts |
Posted - 2008-04-09 : 21:14:04
|
| Its The Primary Key and is Numeric type. It starts at number1001. So it should look at the record I am on like 1002and when I copy the record it should create record 1003 andthe Anumber column should have A1003 |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-04-09 : 21:38:06
|
| Post your code.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
sinjin67
Yak Posting Veteran
53 Posts |
Posted - 2008-04-10 : 18:21:56
|
| I look at the link shown, I hate to say it was over my head.are those examples being used as a trigger ? or how is it appliedin SQL.I am learning so please bare with me..Thanx.. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-04-11 : 04:06:25
|
quote: Originally posted by sinjin67 I look at the link shown, I hate to say it was over my head.are those examples being used as a trigger ? or how is it appliedin SQL.I am learning so please bare with me..Thanx..
Have a procedure to increament the number every time you insert dataor make use of calculated columnBut I prefer doing it in front end applicationMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|