asp.net - Create a table dynamically in mysql -


how create table dynamically using stored procedure in mysql?

declare @salarytable table(empid bigint, empname varchar(100),                             desigation bigint, office bigint, basicpay decimal(8,0),                            workingday tinyint, present numeric(4,2), salaryday numeric(4,2),                             overtime numeric(5,2), othincome decimal(8,0),                             othdeduction decimal(8,0), othincome_ta decimal(8,0),                             othdeduction_ta decimal(8,0), othincome_na decimal(8,0),                             othdeduction_na decimal(8,0), othincome_tn decimal(8,0),                             othdeduction_tn decimal(8,0), othincome_nn decimal(8,0),                             othdeduction_nn decimal(8,0), grosssalary decimal(8,0),                             tds decimal(7,0), emi decimal(8,0), netsalary decimal(8,0)) 

stored procedure create new table:

 create procedure sproc_buildtable            @tablename nvarchar(128)           ,@column1name nvarchar(32)           ,@column1datatype nvarchar(32)           ,@column1nullable nvarchar(32)          declare @sqlstring nvarchar(max)    set @sqstring = 'create table '+@tablename + '( '+@column1name+' '+@column1datatype +' '+@column1nullable +') on primary '     exec (@sqlstring)     go 

hope works


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -