none
Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'

    Question

  • I did a quick search around this forum and around the web but I can't find any helpful information regarding this problem.  Currently, I am running a site on asp.net 2.0 within a shared hosting location.  Their SQL backend is 2000.  I managed to create the db via aspnet_regsql, and then upload the aspnetdb and set provider stuff to the correct bits of information, however when I try any query, like logging in, it doesnt work, and get the error could not find stored procedure...  I checked, and the procedure does exist.  Everything is set up as it should be, schema and all.  Any ideas?  I used Scott Guthries blog on how to use asp.net authentication on SQL 2000, and that worked without any problems.

    - Steven Syfuhs

    Tuesday, September 26, 2006 6:12 PM

Answers

  • Hi, I did resolve my issue.  There may be a more straightforward solution, but this worked for

    me.  If anyone has any success using a more direct approach, please let me know.

    The error I was getting ('Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion') seems

    to be caused by the fact that the stored procedures in the aspnetdb.mdf explicitly reference

    'dbo' (as the database owner). My hosting company assigns a database owner such as

    'dboxxxxxxxxx', where xxxxxxxxx = your user account.  After uploading and importing the the

    aspnetdb files, I ran the script below to change the database owner for all of the aspnetdb

    objects.  After that, my application worked.


    Here are the steps I used:

    1) On my local machine, I created the necessary tables, stored procedures and views using the

    aspnet_regsql.exe utility (see C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 aspnet_regsql.exe).

    2) Upload/import or create these files on the host site.

    3) Using the SQLServer Query Analyzer provided by my hosting company (www.1and1.com), I ran the

    script (see below) to change the database owner to 'dbo'.

     

    sp_changeobjectowner  aspnet_Applications,dbo
    GO
    sp_changeobjectowner  aspnet_Membership,dbo
    GO
    sp_changeobjectowner  aspnet_Paths,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationAllUsers,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationPerUser,dbo
    GO
    sp_changeobjectowner  aspnet_Profile,dbo
    GO
    sp_changeobjectowner  aspnet_Roles,dbo
    GO
    sp_changeobjectowner  aspnet_SchemaVersions,dbo
    GO
    sp_changeobjectowner  aspnet_Users,dbo
    GO
    sp_changeobjectowner  aspnet_UsersInRoles,dbo
    GO
    sp_changeobjectowner  aspnet_WebEvent_Events,dbo
    GO
    sp_changeobjectowner  aspnet_AnyDataInTables,dbo
    GO
    sp_changeobjectowner  aspnet_Applications_CreateApplication,dbo
    GO
    sp_changeobjectowner  aspnet_CheckSchemaVersion,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_ChangePasswordQuestionAndAnswer,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_CreateUser,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_FindUsersByEmail,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_FindUsersByName,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_GetAllUsers,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_GetNumberOfUsersOnline,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_GetPassword,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_GetPasswordWithFormat,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_GetUserByEmail,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_GetUserByName,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_GetUserByUserId,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_ResetPassword,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_SetPassword,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_UnlockUser,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_UpdateUser,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_UpdateUserInfo,dbo
    GO
    sp_changeobjectowner  aspnet_Paths_CreatePath,dbo
    GO
    sp_changeobjectowner  aspnet_Personalization_GetApplicationId,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationAdministration_DeleteAllState,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationAdministration_FindState,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationAdministration_GetCountOfState,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationAdministration_ResetSharedState,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationAdministration_ResetUserState,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationAllUsers_GetPageSettings,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationAllUsers_ResetPageSettings,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationAllUsers_SetPageSettings,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationPerUser_GetPageSettings,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationPerUser_ResetPageSettings,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationPerUser_SetPageSettings,dbo
    GO
    sp_changeobjectowner  aspnet_Profile_DeleteInactiveProfiles,dbo
    GO
    sp_changeobjectowner  aspnet_Profile_DeleteProfiles,dbo
    GO
    sp_changeobjectowner  aspnet_Profile_GetNumberOfInactiveProfiles,dbo
    GO
    sp_changeobjectowner  aspnet_Profile_GetProfiles,dbo
    GO
    sp_changeobjectowner  aspnet_Profile_GetProperties,dbo
    GO
    sp_changeobjectowner  aspnet_Profile_SetProperties,dbo
    GO
    sp_changeobjectowner  aspnet_RegisterSchemaVersion,dbo
    GO
    sp_changeobjectowner  aspnet_Roles_CreateRole,dbo
    GO
    sp_changeobjectowner  aspnet_Roles_DeleteRole,dbo
    GO
    sp_changeobjectowner  aspnet_Roles_GetAllRoles,dbo
    GO
    sp_changeobjectowner  aspnet_Roles_RoleExists,dbo
    GO
    sp_changeobjectowner  aspnet_Setup_RemoveAllRoleMembers,dbo
    GO
    sp_changeobjectowner  aspnet_Setup_RestorePermissions,dbo
    GO
    sp_changeobjectowner  aspnet_UnRegisterSchemaVersion,dbo
    GO
    sp_changeobjectowner  aspnet_Users_CreateUser,dbo
    GO
    sp_changeobjectowner  aspnet_Users_DeleteUser,dbo
    GO
    sp_changeobjectowner  aspnet_UsersInRoles_AddUsersToRoles,dbo
    GO
    sp_changeobjectowner  aspnet_UsersInRoles_FindUsersInRole,dbo
    GO
    sp_changeobjectowner  aspnet_UsersInRoles_GetRolesForUser,dbo
    GO
    sp_changeobjectowner  aspnet_UsersInRoles_GetUsersInRoles,dbo
    GO
    sp_changeobjectowner  aspnet_UsersInRoles_IsUserInRole,dbo
    GO
    sp_changeobjectowner  aspnet_UsersInRoles_RemoveUsersFromRoles,dbo
    GO
    sp_changeobjectowner  aspnet_WebEvent_LogEvent,dbo
    GO
    sp_changeobjectowner  vw_aspnet_WebPartState_User,dbo
    GO
    sp_changeobjectowner  vw_aspnet_Applications,dbo
    GO
    sp_changeobjectowner  vw_aspnet_MembershipUsers,dbo
    GO
    sp_changeobjectowner  vw_aspnet_Profiles,dbo
    GO
    sp_changeobjectowner  vw_aspnet_Roles,dbo
    GO
    sp_changeobjectowner  vw_aspnet_Users,dbo
    GO
    sp_changeobjectowner  vw_aspnet_UsersInRoles,dbo
    GO
    sp_changeobjectowner  vw_aspnet_WebPartState_Paths,dbo
    GO
    sp_changeobjectowner  vw_aspnet_WebPartState_Shared,dbo
    GO

    Thursday, November 09, 2006 8:11 PM

All replies


  • Does the user authenticating with SQL Server have sufficient permissions to read and execute the stored procedure?
    Tuesday, September 26, 2006 6:37 PM
  • I would think so.  The user was setup automatically by the application that manages the database.  Given that, I think the user has full priveledges over the db.  It is not integrated authentication, it is a user/pass combo.
    Tuesday, September 26, 2006 6:42 PM
  • Hi, I am experiencing a similar problem.  I am using a shared hosting provider with a SQL Server 2005 instance and 1

    database.  I have a simple test application with a Login control and CreateUserWizard control and another aspx page

    with a grid control.  The grid control works without a problem.  When I use the login control, I get the error (see

    trace at bottom). 

    I can successfully use the login control in Web Developer Express 2005 on my local machine using a SQL Server 2000

    db using the following connection string in my weg.config:

    <connectionStrings>

    <add name="MySQLServer" connectionString="Initial Catalog=myDatabaseName;data source=localhost;Integrated

    Security=SSPI;"/>

    </connectionStrings>

    I used C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql to create all the appropriate tables, views and

    stored procedures and imported them to my host site.  I can see that aspnet_CheckSchemaVersion is there.

    On the hosted site I changed the connectionStrings to the following:

    <connectionStrings>

    <add name="MyApplicationData" connectionString="Data Source=mssql05.HostingCompany.com;Initial

    Catalog=MyDatabaseName;UID=MyUser_ID;PWD=myPassword"

    providerName="System.Data.SqlClient"/>

    <add name="MyMembershipConnectionString" connectionString="Data Source=mssql05.HostingCompany.com;Initial

    Catalog=MyDatabaseName;UID=MyUser_ID;PWD=MyPassword"

    providerName="System.Data.SqlClient"/>

    </connectionStrings>

    As you can see I am using the same database for application data and membership data.

    I use MyApplicationData as the data source to populate a GridControl.  This works successfully.

    I use MyMembershipConnectionString with the Login control.  I set the MembershipProvider property in the Login

    control to MyMembershipConnectionString.

    Here are other relevant parts of my web.config file.

    <authentication mode="Forms">

    <forms loginUrl="Login.aspx" protection="Validation" timeout="300" />

    </authentication>

     

    <authorization>

    <allow users="*"/>

    </authorization>

    <membership defaultProvider="MySqlMembershipProvider">

    <providers>

    <clear/>

    <add name="MySqlMembershipProvider" connectionStringName="MyMembershipConnectionString" applicationName="/"

    type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral,

    PublicKeyToken=b03f5f7f11d50a3a"/>

    </providers>

    </membership>

    Not sure what I am missing?  Hopefully you can help me out.  Thanks, Jeff

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

     

    Stack Trace:

    [SqlException (0x80131904): Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.]
       System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +857306
       System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734918
       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
       System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream,

    BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838
       System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String

    resetOptionsString) +149
       System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior,

    Boolean returnStream, Boolean async) +886
       System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean

    returnStream, String method, DbAsyncResult result) +132
       System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean

    sendToPipe) +415
       System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +135
       System.Web.Util.SecUtility.CheckSchemaVersion(ProviderBase provider, SqlConnection connection, String[] features,

    String version, Int32& schemaVersionCheck) +367
       System.Web.Security.SqlMembershipProvider.CheckSchemaVersion(SqlConnection connection) +85
       System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean

    updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32&

    failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate,

    DateTime& lastActivityDate) +1121
       System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean

    updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105
       System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean

    updateLastLoginActivityDate, Boolean failIfNotApproved) +42
       System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +83
       System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160
       System.Web.UI.WebControls.Login.AttemptLogin() +105
       System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99
       System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
       System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean

    includeStagesAfterAsyncPoint) +5102

     

     

    Monday, October 16, 2006 5:23 PM
  • The error message is pretty clear, the caller cannot find the stored procedure.

    So I would create a little debug code to list out the stored procedures and database name from the aspx page, perhaps you are connecting to an unexpected database that does not have the sprocs installed.

    Monday, October 16, 2006 5:46 PM
  • Hi, aspnet_regsql creates files with dbo as the owner.  The shared host site uses dboXXXXXXXXX as the owner.

    As an example, the following was created by aspnet_regsql:

    CREATE PROCEDURE [dbo].aspnet_CheckSchemaVersion
        @Feature                   nvarchar(128),
        @CompatibleSchemaVersion   nvarchar(128)
    AS
    BEGIN
        IF (EXISTS( SELECT  *
                    FROM    dbo.aspnet_SchemaVersions
                    WHERE   Feature = LOWER( @Feature ) AND
                            CompatibleSchemaVersion = @CompatibleSchemaVersion ))
            RETURN 0

        RETURN 1
    END
    GO

    I assume that if the references to dbo were changed to dboxxxxxxxxx, it would work?

    Is there a way that I can avoid hand editing all the files?  A setting I can use when running aspnet_regsql?  Other solution?

    Thanks....Jeff

     

    Monday, October 16, 2006 7:39 PM
  • dbo is a special account.  All it means is a member of the sysadmin group created the object.

    When sql looks for an object, it first looks for objects owned by userX, then objects owned by dbo.

    So everyone in the database should be able to access objects owned by dbo, there is no need to create the objects under another user account.

    I suspect you just need to run aspnet_regsql against the target database and you should be set.  If this does not work let me know what version of SQL you are running against and what version of .NET you are using.

    Monday, October 16, 2006 9:01 PM
  • Thanks Matt...I will see if my hosting site (www.1and1.com) supports the aspnet_regsql.exe and go from there. Not exactly sure how I would run it...the only SQL tool I have found at the host site is QueryAnalyzer.  No equivalent of a command line prompt.  Jeff
    Tuesday, October 17, 2006 1:41 AM
  • Jeff,

    Did you ever solve this problem with 1and1?

    I am having the exact same problem right now and it's driving me crazy!

    Does anyone have a solution?
    Monday, November 06, 2006 5:52 PM

  • You might want to post some code. If you're not using an alias for the sp then you may not be fully qualifying the stored procedure name(http://msdn2.microsoft.com/en-us/library/ms187879.aspx). Otherwise it's probably occuring because the authenticated account does not have sufficient permissions to access the sp.
    Monday, November 06, 2006 7:33 PM
  • Hi, I did resolve my issue.  There may be a more straightforward solution, but this worked for

    me.  If anyone has any success using a more direct approach, please let me know.

    The error I was getting ('Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion') seems

    to be caused by the fact that the stored procedures in the aspnetdb.mdf explicitly reference

    'dbo' (as the database owner). My hosting company assigns a database owner such as

    'dboxxxxxxxxx', where xxxxxxxxx = your user account.  After uploading and importing the the

    aspnetdb files, I ran the script below to change the database owner for all of the aspnetdb

    objects.  After that, my application worked.


    Here are the steps I used:

    1) On my local machine, I created the necessary tables, stored procedures and views using the

    aspnet_regsql.exe utility (see C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 aspnet_regsql.exe).

    2) Upload/import or create these files on the host site.

    3) Using the SQLServer Query Analyzer provided by my hosting company (www.1and1.com), I ran the

    script (see below) to change the database owner to 'dbo'.

     

    sp_changeobjectowner  aspnet_Applications,dbo
    GO
    sp_changeobjectowner  aspnet_Membership,dbo
    GO
    sp_changeobjectowner  aspnet_Paths,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationAllUsers,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationPerUser,dbo
    GO
    sp_changeobjectowner  aspnet_Profile,dbo
    GO
    sp_changeobjectowner  aspnet_Roles,dbo
    GO
    sp_changeobjectowner  aspnet_SchemaVersions,dbo
    GO
    sp_changeobjectowner  aspnet_Users,dbo
    GO
    sp_changeobjectowner  aspnet_UsersInRoles,dbo
    GO
    sp_changeobjectowner  aspnet_WebEvent_Events,dbo
    GO
    sp_changeobjectowner  aspnet_AnyDataInTables,dbo
    GO
    sp_changeobjectowner  aspnet_Applications_CreateApplication,dbo
    GO
    sp_changeobjectowner  aspnet_CheckSchemaVersion,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_ChangePasswordQuestionAndAnswer,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_CreateUser,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_FindUsersByEmail,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_FindUsersByName,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_GetAllUsers,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_GetNumberOfUsersOnline,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_GetPassword,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_GetPasswordWithFormat,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_GetUserByEmail,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_GetUserByName,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_GetUserByUserId,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_ResetPassword,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_SetPassword,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_UnlockUser,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_UpdateUser,dbo
    GO
    sp_changeobjectowner  aspnet_Membership_UpdateUserInfo,dbo
    GO
    sp_changeobjectowner  aspnet_Paths_CreatePath,dbo
    GO
    sp_changeobjectowner  aspnet_Personalization_GetApplicationId,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationAdministration_DeleteAllState,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationAdministration_FindState,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationAdministration_GetCountOfState,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationAdministration_ResetSharedState,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationAdministration_ResetUserState,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationAllUsers_GetPageSettings,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationAllUsers_ResetPageSettings,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationAllUsers_SetPageSettings,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationPerUser_GetPageSettings,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationPerUser_ResetPageSettings,dbo
    GO
    sp_changeobjectowner  aspnet_PersonalizationPerUser_SetPageSettings,dbo
    GO
    sp_changeobjectowner  aspnet_Profile_DeleteInactiveProfiles,dbo
    GO
    sp_changeobjectowner  aspnet_Profile_DeleteProfiles,dbo
    GO
    sp_changeobjectowner  aspnet_Profile_GetNumberOfInactiveProfiles,dbo
    GO
    sp_changeobjectowner  aspnet_Profile_GetProfiles,dbo
    GO
    sp_changeobjectowner  aspnet_Profile_GetProperties,dbo
    GO
    sp_changeobjectowner  aspnet_Profile_SetProperties,dbo
    GO
    sp_changeobjectowner  aspnet_RegisterSchemaVersion,dbo
    GO
    sp_changeobjectowner  aspnet_Roles_CreateRole,dbo
    GO
    sp_changeobjectowner  aspnet_Roles_DeleteRole,dbo
    GO
    sp_changeobjectowner  aspnet_Roles_GetAllRoles,dbo
    GO
    sp_changeobjectowner  aspnet_Roles_RoleExists,dbo
    GO
    sp_changeobjectowner  aspnet_Setup_RemoveAllRoleMembers,dbo
    GO
    sp_changeobjectowner  aspnet_Setup_RestorePermissions,dbo
    GO
    sp_changeobjectowner  aspnet_UnRegisterSchemaVersion,dbo
    GO
    sp_changeobjectowner  aspnet_Users_CreateUser,dbo
    GO
    sp_changeobjectowner  aspnet_Users_DeleteUser,dbo
    GO
    sp_changeobjectowner  aspnet_UsersInRoles_AddUsersToRoles,dbo
    GO
    sp_changeobjectowner  aspnet_UsersInRoles_FindUsersInRole,dbo
    GO
    sp_changeobjectowner  aspnet_UsersInRoles_GetRolesForUser,dbo
    GO
    sp_changeobjectowner  aspnet_UsersInRoles_GetUsersInRoles,dbo
    GO
    sp_changeobjectowner  aspnet_UsersInRoles_IsUserInRole,dbo
    GO
    sp_changeobjectowner  aspnet_UsersInRoles_RemoveUsersFromRoles,dbo
    GO
    sp_changeobjectowner  aspnet_WebEvent_LogEvent,dbo
    GO
    sp_changeobjectowner  vw_aspnet_WebPartState_User,dbo
    GO
    sp_changeobjectowner  vw_aspnet_Applications,dbo
    GO
    sp_changeobjectowner  vw_aspnet_MembershipUsers,dbo
    GO
    sp_changeobjectowner  vw_aspnet_Profiles,dbo
    GO
    sp_changeobjectowner  vw_aspnet_Roles,dbo
    GO
    sp_changeobjectowner  vw_aspnet_Users,dbo
    GO
    sp_changeobjectowner  vw_aspnet_UsersInRoles,dbo
    GO
    sp_changeobjectowner  vw_aspnet_WebPartState_Paths,dbo
    GO
    sp_changeobjectowner  vw_aspnet_WebPartState_Shared,dbo
    GO

    Thursday, November 09, 2006 8:11 PM
  • JeffNBoston , love you so much.

    You saved me like God!

    Thank you so much.

    Wednesday, January 10, 2007 9:53 PM
  • Radishj, glad that worked for you.....J=-
    Thursday, January 11, 2007 10:51 PM
  • Just wanted to say thank you very much also.  I am also trying to setup a web site on 1and1.com as the host.  I was experiencing the exact same problems.  I have successfully ran your scripts.  I have been struggling with this for about a week.  I should have checked here first!

    Again, thank you.

    Thursday, January 18, 2007 2:01 AM
  • i also was having the same problem, but solved it a different way.

    run aspnet_regsql from the command line and use the option to have it export the sql code needed to generate the necessary tables and store procedures. then you can just upload the resulting thesql.sql file to the web based tool on 1&1. you need to specify the database here, so after the -d flag put in dbxxxxxxxxxxx, (or whatever you were assigned from 1&1). the -A flag lets you specify which tables you want - you might as well create them all, but you could just choose membership..

    i did

    aspnet_regsql -A all -sqlexportonly thesql.sql -d dbxxxxxxxxxxx
    Thursday, January 18, 2007 6:35 AM
  • Could anyone help me? I am not able to get my classifieds to work.....it is hosted, and I run it for the first time, I tried to register but I receive error. Secondly, when I click on place ads just to see if that page show up....I receive the following error: Line 25: PasswordRecovery.MailDefinition.From = s.SiteEmailFromField . Most of the pages seem to be working but I just can't register in order to create an admin account. I am having a hard time creating the ASPNETDB.mdf. Is there a way to get the classified working without having to create the aspnetdb.mdf database? Thanks! Eric


     

    Saturday, January 20, 2007 9:29 AM
  • antichris, I need to try this...sounds like a simpler solution.  Thanks, Jeff
    Saturday, February 03, 2007 5:47 PM
  • Just Run the following on your SQL SERVER instance:


    Exec sp_addrolemember 'aspnet_Membership_FullAccess', 'YourUser'

    go


    Exec sp_addrolemember 'aspnet_Personalization_FullAccess', 'YourUser'

    go


    Exec sp_addrolemember 'aspnet_Profile_FullAccess', 'YourUser'

    go


    Exec sp_addrolemember 'aspnet_Roles_FullAccess', 'YourUser'

    go


    Exec sp_addrolemember 'aspnet_WebEvent_FullAccess', 'YourUser'

    go

    Monday, March 12, 2007 11:24 AM
  •  Sajid pk wrote:

    Just Run the following on your SQL SERVER instance:


    Exec sp_addrolemember 'aspnet_Membership_FullAccess', 'YourUser'

    go

    .

    .

    .

    This doesn't work in my case.

    The following error occured:

    " The EXEC SQL construct or statement is not supported. "

    Wednesday, April 11, 2007 3:41 PM
  •  JeffNBoston wrote:
    3) Using the SQLServer Query Analyzer provided by my hosting company (www.1and1.com), I ran the

    script (see below) to change the database owner to 'dbo'.

     

    sp_changeobjectowner  aspnet_Applications,dbo
    GO

    .

    .

    .

    I think about reproducing your workaround , because the same error occured in my application.

    But have no SQL Server Query Analyzer.

     

    What should I do ?

    Thursday, April 12, 2007 9:34 AM
  • Mato, did you try the solution proposed by antichis a few messages above?  That shouldn't require Query Analyzer.  Jeff
    Thursday, April 19, 2007 4:38 PM
  •  JeffNBoston wrote:
    . . .  shouldn't require Query Analyzer. Jeff

    I managed to execute your script without Query Analyzer.
    But even if it finished successfully , error occuring in my application remains the same
    .NET is full of magic and mystery
    Monday, May 07, 2007 8:38 AM
  • thank!!.. nice solution
    Monday, July 23, 2007 11:17 AM
  • 1 - web .config should be

    <connectionStrings>

    <add name="Personal" connectionString="Data Source=(local);Initial Catalog=PWS;User ID=PWS2;Password=PWS2"/>

    <remove name="LocalSqlServer"/>

    <add name="LocalSqlServer" connectionString="Data Source=(local);Initial Catalog=aspnetdb;User ID=PWS2;Password=PWS2"/>

     

    third line is incorrect as per advice

    http://weblogs.asp.net/bsimser/archive/2005/11/30/431896.aspx

     

    2 - add PWS2 user as dbo role in both aspnetdb and PWS database

    Friday, January 25, 2008 12:07 AM
  • hello

    i run this command on my host query analyzer and i got this message
    The following error occured while executing the query:
    Server: Msg 229, Level 14, State 5, Line 1
    EXECUTE permission denied on object 'sp_changeobjectowner', database 'master', owner 'dbo'.
    how can i resolve this problem
    still having

    Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'

    when i try using membership authentification

    Thanks for any help

    Saturday, February 09, 2008 10:19 AM
  • Error Message:Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

    Hi,

    i have the same problem,

    checked the tables and the stored procedure do exist in the database, the asp.net website configuration utility works fine through visual studio but as soon as i login from the web it gives this error.

     

    Is this a permissions error? how do i resolve this.

     

    Any help is greatly appreciated.

     

    thanks

    Monday, July 14, 2008 2:33 PM
  • Hi all,

    I have a shared hosting in aruba.it and they don't want to runfor me the scripts needed to solve this problem. So I'm still have the same error:

    Server Error in '/' Application.
    Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

    I' think my only solution would be to overwrite all the providers (so hard) or to find a better hosting.

    Have someone any other solution?

    Thanks in advance.
    Tuesday, January 13, 2009 7:52 PM
  • you all simply need to install asp schemas on your website ...

    i got the same error after i removed asp schemas from my website.
    Wednesday, May 06, 2009 12:36 PM
  • i found the solution http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx

    is worked with me i
    hope work with u all
    Wednesday, June 03, 2009 3:14 PM
  • Hi Jeff, Thanks a Lot. Your post saved me a lot of pain. Your post is quite old however it helped me recently when i had the same problem with my site that uses DotnetNuke (DNN 4.9)

    Our host had some problem after which a perfectly working site started giving problems of the above nature.

    Finally I applied your suggestions and these worked. With a small variation though.

    I had to give Execute permissions on the stored procedures to my database user that was assigned by my host after the

    sp_changeobjectowner  <SP_PROCEDURENAME> ,dbo
    GO.

    the command was .

    GRANT EXECUTE on <Stored_Procedure_name> to <my_DB_User_Name>

    GO

    e.g

                   sp_changeobjectowner  aspnet_SchemaVersions,dbo
                   GO

                  GRANT EXECUTE on aspnet_SchemaVersions  to ssss

                  GO

    for each aspnet stored procedure.

    Also if you have MS SQL Express installed then you can use the OSQL command line utility to give these commands directly to the database

    OSQL -S<ServerName_Or_IP>  -UDB_User_Name  -PYour_DB_Pass_word

     

    Monday, June 28, 2010 4:36 AM