Hi all,
Please suggest me on this.. If not should i create sp dor all the tables for a web application/website
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pravin MorePosted Nov 28, 2011, 2:39 AM
Thanks,
Pravin.
B M SuchitraPosted Nov 28, 2011, 12:31 AM
I have created a SP like this:
create procedure [dbo].[USP_InsertUpdateDelete]
@Columns varchar(MAX),
@ValueClause varchar(MAX),
@SetClause varchar(MAX),
@WhereClause varchar(MAX),
@TableName varchar(MAX),
@Case int
AS
BEGIN
DECLARE @QRY varchar(MAX)
if(@Case=1)
BEGIN
SET @QRY='insert into '+@TableName+'('+@Columns+')VALUES('+@ValueClause+')';
EXEC(@QRY)
END
IF(@Case=2)
BEGIN
SET @QRY='update '+@TableName+'SET'+@SetClause+'where '+@WhereClause+'';
EXEC(@QRY)
END
IF(@Case=3)
BEGIN
SET @QRY='delete '+@TableName+' where '+@WhereClause+'';
EXEC(@QRY)
END
END
==========================================================
Can i use this single SP for the whole database? How will it impact my website?
Suthish NairPosted Nov 26, 2011, 3:11 AM