Click here to Skip to main content
16,016,770 members
Home / Discussions / Database
   

Database

 
AnswerRe: The following stored proc is not working Pin
Eddy Vluggen19-Feb-15 5:31
professionalEddy Vluggen19-Feb-15 5:31 
GeneralRe: The following stored proc is not working Pin
indian14319-Feb-15 6:26
indian14319-Feb-15 6:26 
QuestionMultiple Queries in one Stored procedure Pin
sudevsu18-Feb-15 3:42
sudevsu18-Feb-15 3:42 
AnswerRe: Multiple Queries in one Stored procedure Pin
PIEBALDconsult18-Feb-15 4:00
mvePIEBALDconsult18-Feb-15 4:00 
GeneralRe: Multiple Queries in one Stored procedure Pin
sudevsu18-Feb-15 4:08
sudevsu18-Feb-15 4:08 
GeneralRe: Multiple Queries in one Stored procedure Pin
sudevsu18-Feb-15 4:10
sudevsu18-Feb-15 4:10 
GeneralRe: Multiple Queries in one Stored procedure Pin
Corporal Agarn18-Feb-15 4:33
professionalCorporal Agarn18-Feb-15 4:33 
AnswerRe: Multiple Queries in one Stored procedure Pin
Wendelius18-Feb-15 4:37
mentorWendelius18-Feb-15 4:37 
Normally you would use union or union all. So in this case
SQL
Select T1CL1,T1CL2 from T1 where T1CL3 = 'Something'
union all
Select T2CL1,T2CL3 from T2 where T1CL2 = 'prm1'
union all
Select T3CL3,T3CL4 from T3 where T3CL2 = 'prm2'
union all
Select T4CL1,T4CL3 from T4 where T4CL2 = 'prm3'
union all
Select T5CL1,T5CL3 from T5 where T1CL2 = 'prm4'

However you said that you actually have different amount of columns and the data types are do not match or cannot be converted. If that really is the case, then you need to fetch multiple result sets from a single procedure.

Also if you can execute the statement as a batch from client side, then have a read at Executing multiple SQL statements as one against SQL Server[^]
GeneralRe: Multiple Queries in one Stored procedure Pin
sudevsu18-Feb-15 5:11
sudevsu18-Feb-15 5:11 
GeneralRe: Multiple Queries in one Stored procedure Pin
Wendelius18-Feb-15 6:41
mentorWendelius18-Feb-15 6:41 
SuggestionRe: Multiple Queries in one Stored procedure Pin
Richard Deeming18-Feb-15 5:43
mveRichard Deeming18-Feb-15 5:43 
GeneralRe: Multiple Queries in one Stored procedure Pin
sudevsu18-Feb-15 6:21
sudevsu18-Feb-15 6:21 
GeneralRe: Multiple Queries in one Stored procedure Pin
Wendelius18-Feb-15 6:42
mentorWendelius18-Feb-15 6:42 
AnswerRe: Multiple Queries in one Stored procedure Pin
Smart00324-Feb-15 23:18
professionalSmart00324-Feb-15 23:18 
AnswerRe: Multiple Queries in one Stored procedure Pin
Abdulnazark9-Mar-15 7:08
Abdulnazark9-Mar-15 7:08 
AnswerRe: Multiple Queries in one Stored procedure Pin
deepankarbhatnagar11-Mar-15 0:02
professionaldeepankarbhatnagar11-Mar-15 0:02 
QuestionMYSQL SUM SEVERAL COLUMN VALUES Pin
KipkoechE17-Feb-15 10:29
KipkoechE17-Feb-15 10:29 
AnswerRe: MYSQL SUM SEVERAL COLUMN VALUES Pin
Richard Andrew x6417-Feb-15 11:13
professionalRichard Andrew x6417-Feb-15 11:13 
GeneralRe: MYSQL SUM SEVERAL COLUMN VALUES Pin
KipkoechE17-Feb-15 17:47
KipkoechE17-Feb-15 17:47 
AnswerRe: MYSQL SUM SEVERAL COLUMN VALUES Pin
Richard Andrew x6418-Feb-15 4:58
professionalRichard Andrew x6418-Feb-15 4:58 
GeneralRe: MYSQL SUM SEVERAL COLUMN VALUES Pin
KipkoechE18-Feb-15 11:30
KipkoechE18-Feb-15 11:30 
GeneralRe: MYSQL SUM SEVERAL COLUMN VALUES Pin
Richard Andrew x6419-Feb-15 4:55
professionalRichard Andrew x6419-Feb-15 4:55 
GeneralRe: MYSQL SUM SEVERAL COLUMN VALUES Pin
KipkoechE19-Feb-15 19:45
KipkoechE19-Feb-15 19:45 
QuestionSQL server 12: Displaying column cell values in single cell Pin
Swap917-Feb-15 2:35
Swap917-Feb-15 2:35 
SuggestionRe: SQL server 12: Displaying column cell values in single cell Pin
ZurdoDev17-Feb-15 2:54
professionalZurdoDev17-Feb-15 2:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.