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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Unable to create table with proc called by ADO

Author  Topic 

Wylbur
Starting Member

29 Posts

Posted - 2009-02-10 : 02:24:40

Hi all;


I've got a problem with access permissions.

I've got a stored procedure that should call another
stored procedure to create a database table if it does
not exist.


IF NOT EXISTS (SELECT * FROM sysobjects
WHERE name='sales_details' AND xtype='U')
EXEC create_sales_details;


When I call this procedure directly (with Management Studio),
it creates the table as expected.

When that stored procedure is called from ASP.NET (ADO.NET),
it does not. (It's quite possible that the stored procedure
is not even being called.)


This is the error message from the exception thrown:
- - - - - - - - - - - - - - - - -
### Exception Number : 208
### (Invalid object name 'sales_details'.) has occurred
### Message: Invalid object name 'sales_details'. Number: 208
### Procedure: [get_details_for_invoice] Server: SIMPELSO-EML8V3\SQL2005DEV01
### Source: .Net SqlClient Data Provider State: 1 Severity: 16 LineNumber: 36
- - - - - - - - - - - - - - - - -


The thing that is really freaky is that this was working
on another system (the development system).


Both systems are running Windows XP Professional,
ASP.NET 3.5, and SQL Server 2005.


I open security for the database, and this is what I see ...


Security > users


===============================================

User name: ASPNET01
Login name: <computer name>\ASPNET


Default schema : dbo


Schemas owned by this user:
-----------------------------------------
Owned Schemas
-----------------------------------------

[square] db_accessadmin

-----------------------------------------


Database role membership:
-----------------------------------------
Role members
-----------------------------------------
[check] db_accessadmin

[check] db_datareader
[check] db_datawriter
[check] db_ddadmin
[check] db_owner
-----------------------------------------

===============================================




Can anyone tell me what it is that I am missing?

THANKS!!!





Wylbur
========================

Wylbur
Starting Member

29 Posts

Posted - 2009-02-10 : 03:22:27

I have a new piece of information.

I see that my ADO stuff can add rows to tables already created
- as it could on the development box.

I just cannot create tables.


THANKS!!!




Wylbur
========================
Go to Top of Page
   

- Advertisement -