PDA

View Full Version : how to use sp_executesql


verybrightstar
07-04-2003, 12:54 AM
i can this store procedures

CREATE PROCEDURE sp_GetCustomerData

DECLARE @SQUERY AS NVARCHAR(500)

SET @APPENDTYPE = 'ID,NAME'

SET @SQUERY = N'SELECT ' + @APPENDTYPE + N'FROM CUSTOMER'

EXECUTE SP_EXECUTESQL @SQUERY

how to do retrieve the data for the id and name because i need to retrieve the data for manipulation purpose.

gish
07-04-2003, 11:44 AM
first of all....what language....VBScript?....looks a little diff froim what I am used to...or Excel?....please specify
-----

then I can provide some sample code that will do the trick for you!

:)

verybrightstar
07-06-2003, 11:36 AM
i am using transact sql statement to code . I am running on SQL Server 2000.