Page 1 of 1

fn_listextendedproperty

Posted: Wed 12 May 2010 11:32
by Javan_Soft
Hi
I write this

QAskTemp.SQL.Text:='SELECT objname, CONVERT(Varchar(100), [value]) AS [OutPut] FROM ::fn_listextendedproperty(NULL, ''user'', '''', ''table'', '+QuotedStr(SecTable.Items[Index])+', ''Column'', NULL) A WHERE (name = ''MS_Description'')';

and the SDAC (in unit OLEDBAccess)says
TableName cannot be empty

I Change it to

QAskTemp.SQL.Text:='SELECT objname, CONVERT(Varchar(100), [value]) AS [OutPut] FROM [::fn_listextendedproperty](NULL, ''user'', '''', ''table'', '+QuotedStr(SecTable.Items[Index])+', ''Column'', NULL) A WHERE (name = ''MS_Description'')';

and the SDAC Says

raised exception class EMSError with message 'Invalid object name '::fn_listextendedproperty'.'. Process stopped. Use Step or Run to continue.

What can i do?

Posted: Wed 12 May 2010 12:11
by Javan_Soft
i got it

i have to use Metadata

object MSMetadata1: TMSMetadata
ObjectType = otColumns
DatabaseName = 'ATest'
TableName = 'Table_1'
StoredProcName = 'TablesProperty'
Active = True
Connection = MSConnection1
end

:)

Posted: Wed 12 May 2010 12:23
by Javan_Soft
Wont Work

I have to find a way to find MS_Description in both 2000 and 2005
the fn_listextendedproperty can do it but i cant solve it with SDAC :shock:

Posted: Wed 12 May 2010 13:03
by Javan_Soft
I solve it with a fast (not good) way

Procedure TMakeJRBMainForm.CreateMsDescView(ViewName : String);
Begin
If Tools.IsViewExist('MsDesc') Then
Tools.ExecSql('Drop View MsDesc');
Tools.ExecSql('CREATE VIEW dbo.MsDesc AS SELECT objname, CONVERT(char, [value]) AS [OutPut] FROM ::fn_listextendedproperty'+
'(NULL, ''user'', ''dbo'', ''table'', '+QuotedStr(ViewName)+', ''Column'', NULL) A WHERE (name = ''MS_Description'')');

End;

Posted: Wed 12 May 2010 13:16
by Dimon
I could not reproduce the problem. Please specify exact version your IDE and the exact version of SDAC.

Posted: Wed 12 May 2010 13:52
by Javan_Soft
Delphi 7

Image

Posted: Wed 12 May 2010 13:56
by Javan_Soft
Should i change my IDE or SDAC?

Posted: Wed 12 May 2010 14:40
by Dimon
We have fixed this problem in the latest SDAC build (4.80.0.57). Please, upgrade to this build to solve the problem.

Posted: Wed 12 May 2010 15:31
by Javan_Soft
Ok
Tanx