Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retrieving a value
Message
 
 
À
04/12/2002 08:24:41
Dave Sonier
Technologies Nter inc.
Gatineau, Québec, Canada
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Divers
Thread ID:
00728752
Message ID:
00729927
Vues:
22
This returns the name of the column. I need to get the value from the col. So in the case of our test here the 2nd col is Lastname. I need to return whatever the value is in the lastname col.

Thanks in advance,


>If I understand your question...Try this:
>
>1- Put the variable '@Result' like a new parameter with the 'Output' at the end
>2- and check the execution at the end
>
>================================================
>CREATE PROCEDURE AAA
> @COLNUM smallint,
> @RESULT varchar(100) output
>AS
>
>DECLARE @TESTFIELD varchar(100)
>
>set @TESTFIELD = COL_NAME(OBJECT_ID('Northwind.dbo.Employees'),@COLNUM )
>
>DECLARE Employee_Cursor CURSOR FOR
>SELECT @TESTFIELD FROM Northwind.dbo.Employees
>OPEN Employee_Cursor
>FETCH NEXT FROM Employee_Cursor into @RESULT
>
>CLOSE Employee_Cursor
>DEALLOCATE Employee_Cursor
>
>/* When you will excute your SP
>declare @x datetime
>set @x = null
>execute aaa 1, @x output
>select @x
>*/
>
>Dave
>Technologies Nter
~Joe Johnston USA

"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams

Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform