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.
| Author |
Topic |
|
devsql
Starting Member
1 Post |
Posted - 2005-11-25 : 01:03:24
|
| Hi,I'm unable to send or receive table variables as parameters to a stored proceudure. It gives syntax error during the compilation error. The error is "Incorrect syntax near the keyword 'table'". I have given below the sample code.create procedure OutputTable(@tblTest table (f1 int, f2 int, f3 int) output)as--declare @tblTest table (f1 int, f2 int, f3 int)insert into @tblTest(f1, f2, f3)values(1, 2, 3)GOcreate procedure InputTable(@tblTest table (f1 int, f2 int, f3 int))asselect * from @tblTestGOKindly help me out, thank you.Regards,Deva |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-11-25 : 01:17:32
|
| I think you cannot use Table variable as ParameterDeclare table variable inside the procedure and select data from thatcreate procedure OutputTableasdeclare @tblTest table (f1 int, f2 int, f3 int)insert into @tblTest(f1, f2, f3)values(1, 2, 3)Select * from @tblTestGOEXEC OutputTableOtherwise you need to use Function which returns TableMadhivananFailing to plan is Planning to fail |
 |
|
|
Marioi
Posting Yak Master
132 Posts |
Posted - 2005-12-06 : 18:00:37
|
quote: Originally posted by madhivanan I think you cannot use Table variable as ParameterDeclare table variable inside the procedure and select data from that
I just posted a similar question. I am trying to capture a table as an input parameter. Is that possible in an sProc or UDF? I am trying to pass a data table from asp.net to an sProc/UDF. How could it be done if not via a parameter? Should asp.net create a global temp table (can it?) and my sProc work with it or load the data from it into a table variable? |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-12-07 : 01:33:33
|
| >>I am trying to capture a table as an input parameter. Instead, cant you use that table inside the procedure using join?MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|