Genius, Am developing an ASP.net based Web appln. with SQL Server 2008 as my backend. In aspx page I have 2 listbox controls as below. ListBox1 ListBox2 View1 Expression1 Expression2 Expression3 Expression4 My requirement is I need a stored procedure to insert those listbox items into a table. Table should like as below... View Name Expressions Name View1 Expression1 View1 Expression2 View1 Expression3 View1 Expression4 Pls. provide me a solution Thanks in Advance.
As you are developing the application it will be ideal if you can build TSQL on your own, refer to http://www.sql-server-performance.com/articles/dba/stored_procedures_basics_p1.aspx and Books online http://msdn.microsoft.com/en-us/library/aa933206(v=sql.80).aspx references for your information.
Something like for i=0 to ListBox2.listcount sql="insert into table (cols) select "&list1.listitem(1)&","&list2.listitem(i) next