how to give input dynamically to a insert statement in
sqlserver

Answer Posted / senthil kumar.m

Declare @sql_tmp varchar(100)

set @sql_tmp="insert into table1(col1,col2..)
select 'val1','val2','') "

sp_executesql @sql_tmp

Is This Answer Correct ?    0 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is multi-statement table-value user-defined function?

534


Explain query editor regions

612


What is default constraint in ms sql server?

532


What is the use of for clause?

577


What is meant by datasource?

510






How to drop an existing stored procedure in ms sql server?

537


How to convert a unicode strings to non-unicode strings?

556


What is the difference RDBMS and Graph Database?

625


How do we upgrade from SQL Server 6.5 to 7.0 and 7.0 to 2000?

1626


what is the difference between count(*) and count(1) ?

625


explain different types of constraints? : Sql server database administration

513


How can we check the sql server version?

557


Are null values the same as that of zero or a blank space?

571


What is a not null constraint?

591


How do I get to sql server configuration manager?

510