CREATE TABLE [dbo].[STS_ADDRESS_BOOK]( [AB_NAME] [varchar](100), [AB_EMAIL] [varchar](100), [AB_FAX] [varchar](100), [AB_ID] int NOT NULL IDENTITY(1,1) CONSTRAINT primarykey PRIMARY KEY) ----------------------------------------------------------------------------- sp, GO IF OBJECT_ID ('dbo.selectAddressBookInformation1')IS NOT NULL DROP PROC selectAddressBookInformation1 GO CREATE PROC selectAddressBookInformation1 @columnvalue varchar(100), @searchword varchar(100) AS exec ('select* from STS_ADDRESS_BOOK where CONTAINS('+@columnvalue+','+@searchword+')') ----------------------------------------------------------------------------- this command executed successfully.But the problem is on executing the sp using, ----------------------------------------------------------------------------- exec selectAddressBookInformation1 @columnvalue=[AB_NAME], @searchword='hari'
sp_executeSQL
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)