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 2008 Forums
 Transact-SQL (2008)
 Stored procedure for normalization

Author  Topic 

er.bhupinder53
Starting Member

13 Posts

Posted - 2011-07-06 : 16:34:05
I want to create a stored procedure which can normalize my data by updating various fields. In tableA, I have col1, col2, col3. now, col1 tells ID and col2 tell the tableName it belongs to (Table A is union of other tables, say tablex,table,y tablez) now, this stored procedure will go back to the corresponding tables, x,y,z according to the matching ID in col1 of table A and the compare the another column of that corresponding table and then apply some business rules and then update col3 of tableA(union table) accordingly.
PLease write a store procedure.

I tried to be as clear as I could.

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-07-07 : 19:12:58
Can you post what you have tried so far? That would make it easier for someone to look at the code and offer suggestions. Also, please take a look at Brett's blog ( http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx ) If you can post some sample data along with table DDL's the way he suggests, you would get much faster and better responses.
Go to Top of Page
   

- Advertisement -