Hi all,
this is probably very simple, but I just can't seem to find it in the online books and my Stored Procedure book.
In a Stored Procedure I am writing I need to use the result of the sp_columns system stored procedure. More specifically the Type_Name property.
How do I do this? How can I select just this property? I get the result set already, but how to page through it? Can I declare a cursor for this? For instance like
Or could I somehow retrieve te information more easily with the dbo.tablename.columnname.datatype property? That would ofcourse be easiest, but can it be done? If so, HOW???
Thanx in advance,
Anton.
this is probably very simple, but I just can't seem to find it in the online books and my Stored Procedure book.
In a Stored Procedure I am writing I need to use the result of the sp_columns system stored procedure. More specifically the Type_Name property.
How do I do this? How can I select just this property? I get the result set already, but how to page through it? Can I declare a cursor for this? For instance like
Code:
Declare stpcursor cursor FOR EXEC sp_columns @table_name = 'tablename', @column_name = 'columnname'
Or could I somehow retrieve te information more easily with the dbo.tablename.columnname.datatype property? That would ofcourse be easiest, but can it be done? If so, HOW???
Thanx in advance,
Anton.