create procedure Details ( @Date int, @CompId int ) as begin declare @a varchar(max); select @a = @a + ' select VouNo,VouDesc,convert(varchar(100),CAST(' + convert(varchar(100), Amount) + ' AS NUMERIC(18,'+ (select Afterpoint from tbl_setting where CompId = @CompId) + '))) as FormattedAmount from tbl_Trans where vouDate=' + @Date; exec(@a); end
Alter procedure VisitorDetails1 @name nvarchar(50), @City nvarchar(100), @Dept nvarchar(max), @TableName nvarchar(50) as IF (EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME=@TableName)) --IF db_id('@TabName') IS NOT NULL --IF OBJECT_ID('@TabName','U') is not null begin Declare @set nvarchar(50) set @set='insert into '+@TableName+'(Name,City,Dept) values(''' + @name + ''',''' + @City + ''',''' + @Dept + ''')' exec(@set) Print 'Success' end else begin print 'Table is Not there' end
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)