DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   MS SQL (http://www.daniweb.com/forums/forum127.html)
-   -   update table using function (http://www.daniweb.com/forums/thread114548.html)

sam1 Mar 18th, 2008 11:42 am
update table using function
 
hi,

I have a table with two columns. i want to insert into first column the values of 2nd column where it is between 7 and 10. the table is #temp as well.

so i can not use views... i need to make a function. can you guys please help me how to do it and if you could explain it would be great.

thanks

RamyMahrous Mar 18th, 2008 1:36 pm
Re: update table using function
 
View won't help and I think UDF (User Defined Function) won't help too, the best practice is to use Stored Procedure

Create procedure sam1
AS
Insert into tableX(column2) values (select column1 from tableX)


All times are GMT -4. The time now is 4:00 am.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC