-
Junior Member
insert query
goodmorning,
let us assume i have a table called dbo.Info with some data, for example:
ClientID Name
111 Phil
112 Steve
113 Victor
114 Ralph
. .
. .
. .
okay, now i wanna add a new column to the table, suppose
alter Table dbo.Info
alter column Age int
go
so my question is i wanna make an insert script which insert data in Age for each Row
sth like that; Insert into dbo.info (Age) values ('25') where name = 'steve'
so i wanna insert each row by itself, how can i correct this script??
10x in advance
-
Junior Member
Re: insert query
well as you can see u have to actually parse through each row to get the names
and also provide the script with correct age
therefore use a cursor to pick the name
and put an insert inside the cursor for that name
insert into dbo.info (Age) where name = @valuegivenbythecursor
-
Junior Member
Re: insert query
hey dipanjan,
10x 4 ur help...plz, can u give me an example so it would be more clear?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules