Sunday, May 19, 2013
HomeHomeDiscussionsDiscussionsS-Expert 3.0S-Expert 3.0SQL generation missing apostrofeSQL generation missing apostrofe
Previous
 
Next
New Post
5/11/2011 2:25 PM
 

Hi i note this issue:



wrong

EXEC   sp_updateextendedproperty  'MS_Description', 'abcdefghilmnop', 'user', dbo, 'table',TableName, 'column', FieldName



Right

DECLARE

@v

sql_variant

SET @v = N'abcdefghilmnop'

EXECUTE sp_addextendedproperty N'MS_Description', @v, N'SCHEMA', N'dbo', N'TABLE', N'MyTableName', N'COLUMN', N'MyFieldName'



Regards

 
New Post
5/21/2011 5:51 PM
 
About this issue i send you my fix idea

SqlServerSenarist.cs

//when use AddDescription

commands.Add(string.Format(                                         SqlServerResources.AddDescription,                                         (changedObject.DomainObject as IColumn).Description.Replace("'", "''"),                                         (changedObject.DomainObject as IColumn).DBElement.SchemaName,                                         (changedObject.DomainObject as IColumn).DBElement.Name,                                         (changedObject.DomainObject as IColumn).Name));

//when use AlterDescription

commands.Add(string.Format(                                     SqlServerResources.AlterDescription,                                     (change.DomainObject as IColumn).Description.Replace("'", "''"),                                     (change.DomainObject as IColumn).DBElement.SchemaName,                                     (change.DomainObject as IColumn).DBElement.Name,                                     (change.DomainObject as IColumn).Name));



in SqlServerResources.resx i change AlterDescription key for managing also drop

AlterDescription =>

if len('{0}')=0

begin

EXECUTE sp_dropextendedproperty N'MS_Description',  N'SCHEMA', N'{1}', N'TABLE', N'{2}', N'COLUMN', N'{3}'

end

else

begin

if ( (select value from ::fn_listextendedproperty ('MS_Description', 'user', 'dbo', 'table', '{2}', 'column', '{3}'))  is not null)

begin 

EXECUTE sp_updateextendedproperty N'MS_Description', N'{0}', N'SCHEMA', N'{1}', N'TABLE', N'{2}', N'COLUMN', N'{3}'

end

else

begin

   EXECUTE sp_addextendedproperty N'MS_Description', N'{0}', N'SCHEMA', N'{1}', N'TABLE', N'{2}', N'COLUMN', N'{3}'

end

end



Regards
 
New Post
5/24/2011 11:17 AM
 
I sent a mail about my implementation. (video + assembly)

Regards

 
New Post
6/19/2011 1:22 PM
 
Fixed at build 3.0.5.2911.

Best Regards,

Tamer Aboraya - Product Manager - Sculpture project
 
Previous
 
Next
HomeHomeDiscussionsDiscussionsS-Expert 3.0S-Expert 3.0SQL generation missing apostrofeSQL generation missing apostrofe


DOWNLOAD   |   PRODUCTS   |   STORE   |   SUPPORT   |   BLOG   |   ABOUT
Copyright 2011 by Modelingsoft Corporation