locked
create procedure [User_Name].sp_myprocedure. Error since I use dbo schema RRS feed

  • Question

  • I am developing with VS2010. When I generate a store procedure (DATASET>RIGHT CLICK ADD>SELECT>NEW STORE PROCEDURE) for a data table of a dataset from VS2010, the enviroment generates this:

    IF EXISTS (SELECT * FROM sysobjects WHERE name = 'SelectQuery' AND user_name(uid) = 'DOMAIN\USER-LOGIN')
     DROP PROCEDURE [DOMAIN\USER-LOGIN'].SelectQuery
    GO

    CREATE PROCEDURE [DOMAIN\USER-LOGIN'].SelectQuery
    AS
     SET NOCOUNT ON;
    SELECT contract_id, product_id, contract_description FROM dbo.TContracts
    GO

    The creation of the procedure ends with erros since my schema is dbo.

    So far, I work around copying and pasting the store procedure changing the schema and starting again from the beginning: DATASET>RIGHT CLICK ADD>SELECT>FROM EXISTING STORE PROCEDURE.

    Is there any way to configure VS2100 to generate the scripts avoinding to prefix the supposed schema of my user.

    Many thanks.

    Tuesday, September 7, 2010 5:20 PM

Answers