| Author |
Topic |
|
Chinni
Yak Posting Veteran
95 Posts |
Posted - 2008-08-26 : 11:25:07
|
| i need to execute a stored procedure with one input parameter in SSIS data flow.I executed well before,but after i created temp table inside a stored procedure it showing vs_neednewmetadata,validation errormy SP is some thing like thiscreate proc fields @feildidascreate table #temp(,,,,,)insert into select * from originaltable where id = @fieldiddrop table # tempwhen i used my proc likecreate proc fields @feildidas select * from originaltable where id = @fieldidi could execute properly with no errors in data flowbut when i created a temp tabel i could not,as my procedure need a temp tabel i need to create that.Thanks for you help |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-26 : 13:27:23
|
| what are trying to do with temporary table? |
 |
|
|
Chinni
Yak Posting Veteran
95 Posts |
Posted - 2008-08-26 : 14:25:46
|
| I need to retrive column names 8 times in the SP and the query to retrive contains many joins so its taking long time if i use the query each time.What I did not i got all the column names to a temp table and using the colums from temp table instead of using the query each time when needed. |
 |
|
|
Chinni
Yak Posting Veteran
95 Posts |
Posted - 2008-08-26 : 14:55:30
|
| alter PROCEDURE [dbo].[Gus_ResultSet] @ID intAScreate Table #TempResult(,,,,,,)Insert into #TempResultEXEC [dbo].[Retrivefields] @IDselect * from #TempResultDrop Table #TempResultI used in the data flow EXEC [dbo].[Gus_RetriveResultSet] 508but it is not showing columns in columns tabb |
 |
|
|
karuna
Aged Yak Warrior
582 Posts |
|
|
Chinni
Yak Posting Veteran
95 Posts |
Posted - 2008-08-26 : 15:26:49
|
| THE links are helpful....but insted of creating a procedure they asked create a function but i have a input parameter to procedure....... |
 |
|
|
karuna
Aged Yak Warrior
582 Posts |
Posted - 2008-08-26 : 16:15:09
|
| You can create a table value function which takes input parameters, that should help you out.ThanksKarunakaran |
 |
|
|
Chinni
Yak Posting Veteran
95 Posts |
Posted - 2008-08-26 : 16:40:27
|
| create function [dbo].[esultSet]( @ID int)asBegincreate Table #TempResult(,,,,,)Insert into #TempResultEXEC [dbo].[fields] @IDselect * from #TempResultDrop Table #TempResultendwhen i create a function it shoeing error like cannot access temp tables winth in function |
 |
|
|
Chinni
Yak Posting Veteran
95 Posts |
Posted - 2008-08-26 : 16:50:08
|
| create function [dbo].[ResultSet]( @ID int)returns @TempResult table (a,d,c)asBeginInsert @TempResultEXEC [dbo].[fields] @IDreturnendERROR:Invalid use of side-effecting or time-dependent operator in 'INSERT EXEC' within a function. |
 |
|
|
karuna
Aged Yak Warrior
582 Posts |
Posted - 2008-08-26 : 19:13:38
|
| As far as I know, you cannot call a stored proc inside the function.Instead of calling the sp, whatever you do in the stored proc, do it in the udf. |
 |
|
|
Chinni
Yak Posting Veteran
95 Posts |
Posted - 2008-08-26 : 21:12:38
|
| table values functionselect * from [dbo].[ResultSet] ?I could not click OK button I am getting errorError at Data Flow Task [OLE DB Source 1 [2932]]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "Syntax error, permission violation, or other nonspecific error |
 |
|
|
karuna
Aged Yak Warrior
582 Posts |
Posted - 2008-08-27 : 11:12:43
|
| Assuming ResultSet is a udf with out any input parameters, it should be select * from [dbo].[ResultSet]()ThanksKarunakaran |
 |
|
|
Chinni
Yak Posting Veteran
95 Posts |
Posted - 2008-08-27 : 11:16:28
|
| for table values function i found like "select * from [dbo].[ResultSet]@ID =" + (DT_WSTR,20)@MySSISVariablebut to slove my problem i went back to my SP and changes all temp tables to temp variables and i did not find the error this time vs_metadata.thanks for your help |
 |
|
|
|