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 |
|
dubo
Starting Member
2 Posts |
Posted - 2002-08-28 : 17:08:31
|
| HI!I have 3 values (2,3,4)and i´m doing this:INSERT INTO table (code) values (2)INSERT INTO table (code) values (3)INSERT INTO table (code) values (4)How can i use a vector and a repetitive (for, while, etc) function.?Thanks |
|
|
jasper_smith
SQL Server MVP & SQLTeam MVY
846 Posts |
Posted - 2002-08-28 : 17:41:58
|
Not quite sure its what you mean but declare @i int ; set @i = 2begin tranwhile @i<5begininsert table(code) values(@i)set @i=@i+1endcommit HTHJasper Smith |
 |
|
|
dubo
Starting Member
2 Posts |
Posted - 2002-08-29 : 08:36:02
|
quote: Not quite sure its what you mean but declare @i int ; set @i = 2begin tranwhile @i<5begininsert table(code) values(@i)set @i=@i+1endcommit HTHJasper Smith
but the values can be 8 3 65 22there arnt conecutive values |
 |
|
|
jasper_smith
SQL Server MVP & SQLTeam MVY
846 Posts |
Posted - 2002-08-29 : 15:44:02
|
| Then you need to explain what you mean by vector. Can you give an example maybe in another programming language ?HTHJasper Smith |
 |
|
|
AjarnMark
SQL Slashing Gunting Master
3246 Posts |
Posted - 2002-08-29 : 19:33:54
|
| If you're talking about using an array, then you'll have to research CSV here on SQLTeam to learn ways to parse them. There is no such data type in SQL as an Array, so CSV is probably the closest you'll find. Robvolk has a good article about parsing a CSV and inserting the results into a table at [url]http://www.sqlteam.com/item.asp?ItemID=2652[/url] |
 |
|
|
|
|
|