how to give input dynamically to a insert statement in
sqlserver

Answer Posted / ashutosh rai

Declare @id int,@name varchar(100),@class varchar(100)
set @id=1
set @name='Ashutosh'
set @class='MCA'

insert into student_table(id,name,class)
values(@id,@name,@class)

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Create and insert into temp table in sql server?

778


How to use old values to define new values in update statements in ms sql server?

868


Explain transaction server isolation?

740


What is default constraint in ms sql server?

712


How to create an identity column?

848






What is meant by referential integrity?

749


What is user-defined function?

726


How would you add a section to a table?

777


Indexes are updated automatically is the full-text index also updated automatically?

793


What do you mean by SQL injection attack?

796


What is an execution plan? When would you use it?

728


What is trigger and different types of Triggers?

806


What is local temp table?

699


How to name query output columns in ms sql server?

713


How to backup SQL Server Reporting Services ?

122