简体   繁体   English

UniDac找不到存储过程架构

[英]UniDac doesnt find stored procedure schema

I have used UniDac VCL components for Delphi for a year now but recently started quite a big project with SQL Server 2012 and I want to separate the tables and stored procedures in different schemes my whole logic is in stored procedures so no query's in the program only the stored procedure names and parameters. 我已经在Delphi中使用UniDac VCL组件一年了,但是最近在SQL Server 2012中启动了一个很大的项目,我想以不同的方案将表和存储过程分开,我的整个逻辑都在存储过程中,因此程序中没有查询存储过程的名称和参数。

The problem is that when I change my stored procedure schema from dbo to let's say SchemaA and then try to run it from Delphi the TUniStoredProc component finds it as ProcedureName and not as SchemaA.ProcedureName which throws the exception of not finding the stored procedure on execute. 问题是,当我将存储过程模式从dbo更改为SchemaA ,然后尝试从Delphi运行它时, TUniStoredProc组件将其查找为ProcedureName而不是SchemaA.ProcedureName ,这引发了在执行时未找到存储过程的异常。

I can't assign different schemas to different users as their default schemes because there are users that use from 4-6 schemes depending on the permissions. 我不能将不同的架构分配给不同的用户作为默认方案,因为根据权限的不同,有些用户使用4-6个方案。 What I tried already is manually entering SchemaA.ProcedureName and that works perfectly but doing so for ~150 components would take a lot of time so I'm searching for a better solution. 我已经尝试过的是手动输入SchemaA.ProcedureName ,它可以正常工作,但是对于大约150个组件这样做会花费很多时间,因此我正在寻找更好的解决方案。

Any thoughts? 有什么想法吗?

I don't know how many forms or modules those components are on but if they are centralized then open the Form(s) in text mode and do a replace. 我不知道这些组件位于多少个表单或模块上,但是如果它们处于集中式状态,则以文本模式打开表单并进行替换。

UniDac's Macros may come in handy here, one could use {MySchema}.ProcedureName and set the MySchema name in the connection Macros. UniDac的宏可能会派上用场,可以使用{MySchema} .ProcedureName并在连接宏中设置MySchema名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM