You are here: Re: Primary key generating « MsSQL Server « IT news, forums, messages
Re: Primary key generating

Posted by mutemode on 10/02/79 11:56

OK maybe I didn't explain it well enough
I have
TABLE1 TABLE2
First Last ID
First Last
John Smith 1
Lou Price
George Bluth 2
Henry Joe

What I WANT is

TABLE2
ID First Last
1 Lou Price
2 Henry Joe
3 John Smith
4 George Bluth


ZeldorBlat wrote:
> mutem...@gmail.com wrote:
> > ZeldorBlat wrote:
> > > mutemode@gmail.com wrote:
> > > > Help again please,
> > > > I need to insert rows into a table from another table. The tables are
> > > > identical column wise except the table im inserting from does not have
> > > > a primary key value. On insert I need to generate a primary key that
> > > > is consecutive based on the table im inserting into. Also the table im
> > > > inserting into does not have a identity column. Much appreciated.
> > >
> > > Then create an auto-incrementing identity column in the destination
> > > table and insert away.
> >
> > Sorry, both tables don't have an identity column.
>
> Allow me to reiterate my previous response: create an auto-incrementing
> identity column in the destination table, then do an insert.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация