Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 function

Author  Topic 

sunsanvin
Master Smack Fu Yak Hacker

1274 Posts

Posted - 2007-07-24 : 07:25:55
Dear Experts,
I've completed my task with all your help especially KH and Peso....very much thankful to you all.

now is it possible to make all this as one proceudre or one function? This is my idea to spiltting like this . actually i've to update the table19.columnb2. based on all these. please give me the way to make all the two functions and the query to run at a time.

CREATE function getuomid(@uomcode varchar(50))
returns varchar(50)
as begin
declare @uom_id varchar(50)
select @uom_id= uom_id from vuom where uom_code=@uomcode
return @uom_id
end

CREATE function getitemid(@uomid varchar(50))
returns table
as
return (select * from table21 where column03=(select dbo.getuomid('no of leaves')))

UPDATE t19
SET t19.Columnb2 = d.Column04
FROM Table19 AS t19
INNER JOIN dbo.GetItemID('1ca7a0fa-c507-4d4d-94a1-13eb9ec3d6d2') AS d ON d.Column01 = t19.Column01



thank you very much


Vinod
Even you learn 1%, Learn it with 100% confidence.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-07-24 : 07:42:07
Duplicate post http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=86530

SUNSANVIN, please stop post duplicate questions!!!!


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

sunsanvin
Master Smack Fu Yak Hacker

1274 Posts

Posted - 2007-07-24 : 07:55:21
Sorry Peso, unexpectedly posted secondtime(because first time after posting, i didn't find my post. sorry for that

Vinod
Even you learn 1%, Learn it with 100% confidence.
Go to Top of Page
   

- Advertisement -