|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi
I need to get a list of numbers from an sql satement i.e SELECT name_ctr FROM actNamePropertyAddressView then I need to do a loop inserting the name_ctr value in the procedure below select dbo.funnucNamePostAddress(name_ctr), 'pr', 0, GETDATE()) then I need to output the results I would appreciate any feedback on this |
|
#2
|
|||
|
|||
|
You could use a cursor:
-- DECLARE @SomeVar INTEGER DECLARE myCursor CURSOR FOR SELECT name_ctr FROM actNamePropertyAddressView OPEN myCursor FETCH NEXT FROM myCursor INTO @SomeVar WHILE @@FETCH_STATUS = 0 BEGIN SELECT dbo.funnucNamePostAddress(@SomeVar, 'pr', 0, GETDATE()) FETCH NEXT FROM myCursor INTO @SomeVar END CLOSE myCursor DEALLOCATE myCursor |
|
#3
|
|||
|
|||
|
Great
Thanks for that
|
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Looping info into an SQL function |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|