Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Stored Procedure returns data from multiple tables. How to access it in your ASP.Net code?

1052


What is difference between materialized view and view?

905


Write a query to include a constraint, to check whether the employee salary is greater than 5000?

1598


How to optimize stored procedure optimization?

889


Where is trigger in sql server?

1035


How you can add messages to the nt event log from within a stored procedure?

1059


What is dbcc? Give few examples.

1020


How to view the error log for any specific instance? : sql server database administration

1026


Does order by actually change the order of the data in the tables or does it just change the output?

1131


What command would you use to create an index?

1048


What is indexed view? How to create it?

978


What are the joins in sql server? : sql server database administration

996


What is the function of sql server agent windows service?

1079


What stored by the model?

1046


How to use values from other tables in update statements in ms sql server?

1103