•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 427,203 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,176 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser: Programming Forums
Views: 494 | Replies: 1
![]() |
•
•
Join Date: Jul 2005
Posts: 91
Reputation:
Rep Power: 4
Solved Threads: 0
Hi, sorry for a newbie question but I was wondering if the following is possible:
I have to select some information from a table which I have already created a query for. This information then has to be inserted into a new table but needs another column with another unique custom identifer for each record in the format EX01 which is incremented by 1 for each record. I was wondering how is it possible to do this?
My approach was to create a view and then insert the values form the view into the new table but I still have no idea how to do the unique identifer. Was the first part of my approach correct or have been wrong from the start?
Thanks.
I have to select some information from a table which I have already created a query for. This information then has to be inserted into a new table but needs another column with another unique custom identifer for each record in the format EX01 which is incremented by 1 for each record. I was wondering how is it possible to do this?
My approach was to create a view and then insert the values form the view into the new table but I still have no idea how to do the unique identifer. Was the first part of my approach correct or have been wrong from the start?
Thanks.
•
•
Join Date: Feb 2008
Posts: 21
Reputation:
Rep Power: 1
Solved Threads: 5
I think you can create identity columns.
create table #tmpTemp (ID int identity(1,1), Code varchar(255), Name varchar(255)) insert #tmpTemp (Code, Name) select 'A', 'AA' --> replace with your view union all select 'B', 'BB' select * from #tmpTemp drop table #tmpTemp
Hence Wijaya
www.ex-Soft.tk
www.ex-Soft.tk
![]() |
•
•
•
•
•
•
•
•
DaniWeb MS SQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Other Threads in the MS SQL Forum
- Previous Thread: One user per database
- Next Thread: Rangevalidator Problem.. Urgent..


Linear Mode