none
Table variables and ADO.net RRS feed

  • Question

  • Hi,

    We are getting strange error while using table variables in stored procedure. We are having stored procedure where we do the following

     

    DECLARE @table TABLE ....

     

    SQL statements...

     

    SELECT * FROM @table (at the end of procedure)

     

    On executing the stored procedure from the server, we are getting the data from the SELECT statement for the stored procedure. While running the same stored procedure with the same parameters from ADO.net code, we are getting no DATA.

     

    What makes it completely strange is that this problem does not happen in two different SQL Servers. In one SQL Server, the same thing works fine. While in one specific SQL Server, we are having this problem

     

    Any help will be appreciated,

     

    Thanks,

    Vijay

    Thursday, September 27, 2007 1:33 PM

Answers

  • it is nto a problem with table variables. It is a problem with user previleges. The user for ADO.net connection string is different and odes not have access permission on anotehr database

     

    Friday, September 28, 2007 7:23 AM

All replies

  • hi vijay

    Hey r u geting any error message while executing the stored procedure!

    That will help understad the problem better !

    take care

    Avinob

    Thursday, September 27, 2007 3:30 PM
  • it is nto a problem with table variables. It is a problem with user previleges. The user for ADO.net connection string is different and odes not have access permission on anotehr database

     

    Friday, September 28, 2007 7:23 AM