In my database there is one stored procedure.In that stored procedure,I am retrieving data from ten different tables.That is in result i am getting 10 tables.My question is,is there any way so I can return table name.Because this SP I am executing from my vb.net project and stored this result in one dataset.And I am merging result of this Stored Procedure,that is tables from this stored procedure to tables in my data set.So i am merging this tables as dataset1.tables("Table1").Merge(dataset2.tables(0))
So now I want to do like,I have to give table name to result from stored procedure.So I can merge table with table name not with table index i.e tables(0).
So should I retrieve such result through stored procedure.
I am having stored procedure like
create proc sp_QM_INVOICE_MATBATCHWISE_DETAILS
@PLANT_CODE NUMERIC(5,0),
@COMPANY_CODE NUMERIC(5,0),
@FYEAR NUMERIC(5,0),
@STRANSID VARCHAR(15),
@SMODE VARCHAR(5),
@DOC_NO VARCHAR(20),
@INVOICE_NO VARCHAR(20),
@CUSTOMER_NO VARCHAR(20)
AS
BEGIN
SELECT * FROM QM_INVOICEMATWISE_DETAILS
WHERE COMPANY_CODE=@COMPANY_CODE
AND PLANT_CODE=@PLANT_CODE
AND FYEAR=@FYEAR
AND DOC_NO=@DOC_NO
AND INVOICE_NO=@INVOICE_NO
AND CUSTOMER_NO=@CUSTOMER
SELECT * FROM QM_INVOICEMATBATCHWISE_DETAILS
WHERE COMPANY_CODE=@COMPANY_CODE
AND PLANT_CODE=@PLANT_CODE
AND FYEAR=@FYEAR
AND DOC_NO=@DOC_NO
AND INVOICE_NO=@INVOICE_NO
AND CUSTOMER_NO=@CUSTOMER
SELECT * FROM QM_TESTCERTIFICATEFORMATCUST_T
WHERE COMPANY_CODE=@COMPANY_CODE
AND PLANT_CODE=@PLANT_CODE
AND FYEAR=@FYEAR
AND DOC_NO=@DOC_NO
AND INVOICE_NO=@INVOICE_NO
AND CUSTOMER_NO=@CUSTOMER
END
So how i can retrieve this result with table name in result. When I execute this stored procedure through my code,I am retrieving this result in one data set.In data set,tables are like Table1,Table2,Table3.So how I can retrieve the result also but with table name through stored procedure