Inserting numbers  
Author Message
Selassie





PostPosted: Thu Feb 12 06:01:37 CST 2004 Top

SQL Server Developer >> Inserting numbers

I have table:

Numbers City Name
1 2
1 3
2 2

etc.

I would like to fill out the "Numbers" filed with numbers starting from 1,
so the result would be:

Numbers City Name
1 1 2
2 1 3
3 2 2


On begining I would use:






BEGIN

....... .......................




END


I dont know how to insert those numbers.
Do you have any idea?

SQL Server250  
 
 
Roji





PostPosted: Thu Feb 12 06:01:37 CST 2004 Top

SQL Server Developer >> Inserting numbers


UPDATE yourTable




--
Roji. P. Thomas
SQL Server Programmer


> I have table:
>
> Numbers City Name
> 1 2
> 1 3
> 2 2
>
> etc.
>
> I would like to fill out the "Numbers" filed with numbers starting from 1,
> so the result would be:
>
> Numbers City Name
> 1 1 2
> 2 1 3
> 3 2 2
>
>
> On begining I would use:
>


>
>

> BEGIN
>
> ....... .......................
>
>

>
> END
>
>
> I dont know how to insert those numbers.
> Do you have any idea?
>
>


 
 
Uri





PostPosted: Thu Feb 12 06:06:18 CST 2004 Top

SQL Server Developer >> Inserting numbers Johny
Modify the following script for your needs.
create table amb(i int)
insert amb select 3 union select 7 union select 10 union select 20
select * from amb
go



update amb


select * from amb
go
drop table amb


> I have table:
>
> Numbers City Name
> 1 2
> 1 3
> 2 2
>
> etc.
>
> I would like to fill out the "Numbers" filed with numbers starting from 1,
> so the result would be:
>
> Numbers City Name
> 1 1 2
> 2 1 3
> 3 2 2
>
>
> On begining I would use:
>


>
>

> BEGIN
>
> ....... .......................
>
>

>
> END
>
>
> I dont know how to insert those numbers.
> Do you have any idea?
>
>


 
 
Johny





PostPosted: Thu Feb 12 10:11:24 CST 2004 Top

SQL Server Developer >> Inserting numbers Thank you.