This is a migrated thread and some comments may be shown as answers.

TSQL generated from DUD mappings unreadable

3 Answers 58 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
N Mackay
Top achievements
Rank 1
N Mackay asked on 18 Mar 2011, 05:41 PM
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.

3 Answers, 1 is accepted

Sort by
0
N Mackay
Top achievements
Rank 1
answered on 18 Mar 2011, 05:43 PM
CUD mappings even :-p

It's a friday afternoon.......
0
Ady
Telerik team
answered on 24 Mar 2011, 03:41 PM
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
0
N Mackay
Top achievements
Rank 1
answered on 24 Mar 2011, 03:48 PM
Thanks Ady.

The generated SQL as it starts is unreadable so we can't use that feature, any improvement would be welcome.
Tags
General Discussions
Asked by
N Mackay
Top achievements
Rank 1
Answers by
N Mackay
Top achievements
Rank 1
Ady
Telerik team
Share this question
or