Insert Data Dynamically in SQL Server

    In this tutorial see about SQL Server insert Data Dynamically.

create a table  tbl_name
     create table tbl_name(id int identity primary key,name nvarchar(20),age int)




declare @ID as int
set @ID=1
while(@ID<=5)
begin
insert into tbl_name values('name'+ CAST(@ID as nvarchar(20)),@ID)
print @ID
set @ID=@ID+1
end

Output:


Comments

Popular posts from this blog

Display Canvasjs Line Chart using Data from Database

What are the SOLID principles, and why are they important

Write Text in Notepad files Using Asp.net