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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 stored procedure checking the value

Author  Topic 

CRP
Starting Member

10 Posts

Posted - 2008-03-26 : 10:45:39
I have two tables called A and B and C. Where A and C has the same schema

A contains the following columns and values
-------------------------------------------
PoId Podate Approved

2 2008-07-07 No
4 2007-05-05 No
5 2005-08-06 Yes
6 2006-07-07 Yes


Table B contains the following columns and values
-------------------------------------------------
TaskId TableName Fromdate Approved_Status

1 A 7/7/2007 No
3 B 2/4/2006 Yes

Now i need to create a stored procedure that should accept the values (Yes/No) from the Approved_Status column in Table B and should look for the same values in the Approved column in the Table which is specified in the table name column in Table B. If both values match then the corresponding rows in Table A should be archived in table C which has the same schema as that of Table A. That is the matching columns should get deleted from Table A and shoud be inserted into Table C.

Pls provide me with full stored procedure code.

It is very urgent.

C.R.P RAJAN

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-03-26 : 10:48:44
When is your homework due?


E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

CRP
Starting Member

10 Posts

Posted - 2008-03-27 : 02:36:22
quote:
Originally posted by Peso

When is your homework due?


E 12°55'05.25"
N 56°04'39.16"




C.R.P RAJAN
Go to Top of Page

CRP
Starting Member

10 Posts

Posted - 2008-03-27 : 02:36:57
quote:
Originally posted by Peso

When is your homework due?


E 12°55'05.25"
N 56°04'39.16"




I need to finish it by today noon

C.R.P RAJAN
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-03-27 : 04:29:34
Cross post
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=99741



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -