TSQL generated from DUD mappings unreadable

4 posts, 0 answers
  1. N Mackay
    N Mackay avatar
    228 posts
    Member since:
    Dec 2010

    Posted 18 Mar 2011 Link to this post

    Hi,

    I've been told this cannot be changed but I thought I'd mention it anyway.

    The TSQL generated is pretty unreadable when you open the stored procedure in SQL management studio, the example below I generated from the nothwind category table.

    USE [Northwind]
    GO
    /****** Object:  StoredProcedure [dbo].[sp_oa_ins__categories]    Script Date: 03/18/2011 16:32:52 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[sp_oa_ins__categories] ( @Picture image = NULL, @Description ntext = NULL, @CategoryName nvarchar(15) ) AS INSERT INTO [Categories] ( [Picture] , [Description] , [CategoryName] ) VALUES ( @Picture , @Description , @CategoryName ) select scope_identity()

    Our DBA has already said it's not compliant, parameters should be on seperate lines etc. Something more readable is shown below.

    USE [Northwind]
    GO
    /****** Object:  StoredProcedure [dbo].[sp_oa_ins__categories]    Script Date: 03/18/2011 16:32:52 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[sp_oa_ins__categories] 
      
        @Picture image = NULL
        @Description ntext = NULL
        @CategoryName nvarchar(15) 
    AS 
        INSERT INTO [Categories] 
            
             [Picture], 
             [Description], 
             [CategoryName] 
            
        VALUES 
            
            @Picture, 
            @Description, 
            @CategoryName 
            
        SELECT 
            scope_identity()

    We have 600+ tables, there could be over 1000 stored proced generated, as it stands we have to manually modify ever SP before we update the database from the model, can't the designer do this ? surely you could just have a template you could edit ?

    Regards,

    Norman.

  2. N Mackay
    N Mackay avatar
    228 posts
    Member since:
    Dec 2010

    Posted 18 Mar 2011 Link to this post

    CUD mappings even :-p

    It's a friday afternoon.......
  3. DevCraft banner
  4. Ady
    Admin
    Ady avatar
    588 posts

    Posted 24 Mar 2011 Link to this post

    Hi Norman,

     We will definitely improve the formatting and the verify and fix the procedure compliance. As mentioned previously the UI will be provided so that you have control over the name generation. Providing templates to generate the stored procedure might not be possible immediately, since the procedure syntax varies quiet a bit between various backends and certain restrictions do apply. Nevertheless we will investigate this option.

    Regards,
    Ady
    the Telerik team
  5. N Mackay
    N Mackay avatar
    228 posts
    Member since:
    Dec 2010

    Posted 24 Mar 2011 Link to this post

    Thanks Ady.

    The generated SQL as it starts is unreadable so we can't use that feature, any improvement would be welcome.
Back to Top