TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Enni
NA
30
4.5k
How to pass tablename as parameter in SP to add another col?
Jul 16 2018 8:15 AM
Hi, Please help me to solve this.
I have three 3 tables with some data and column names are same.
June_2018(table name 1)
id Name
1 Critical
2 Major
3 Critical
4 Minimum
5 Major
July_2018
id Name
6 Critical
7 Major
8 Critical
9 Minimum
10 Major
August_2018
id Name
11 Critical
12 Major
13 Critical
14 Minimum
15 Major
I need a stored procedure where tablename should be passed as the parameter then
Critical, Major
should be as
Major as another column
and Minimum should be updated as Minimum. Expected output should be as follows.
Exec procedurename(Tablename as parameter)
id Name Staus
1 Critical Major
2 Major Major
3 Critical Major
4 Minimum Minimum
5 Major Major
Thanks in advance.
Reply
Answers (
3
)
Caluculate sum of digits in sql
Even and odd numbers should be stored in two columns