.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

SQL HELP

Posted By:      Posted Date: October 08, 2010    Points: 0   Category :Sql Server
 

Hi all,

I have the following:
exec Test_Plan @PlanVersionID=N'62,80'

Here's a sample of my proc

ALTER PROCEDURE Test_Plan
 @PlanVersionID nvarchar(244)
AS
BEGIN
 PRINT @PlanVersionID
 
END


What I need to do in the Begin section is check if PlanVersionID has a "," if it does then do the following
but it needs to be dynamic


INSERT INTO temp_value_month
SELECT MIN(Month) FROM t_res_fact
where PlanVersionID =62

INSERT INTO temp_value_month
SELECT MIN(Month) FROM t_res_fact
where PlanVersionID =80

I need a loop i guess which checks if PlanVersionID  contains a "," then gets the first value ie 62 an does an insert for that ID
and then goes on to the next ie 80 and does the insert and so on...

please help me




View Complete Post


More Related Resource Links

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend