2

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.

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.

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. 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.

Any thoughts?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
AirWolf
  • 597
  • 7
  • 27
  • So your question is actually: How do I change the procedure name from "ProcedureName" to "SchemaA.ProcedureName" in all of my `TUniStoredProc` components? Are they all in a datamodule, or are they scattered among your forms themselves? – Ken White Mar 28 '14 at 19:16
  • whell having more schemas than one that not quite an option :P my question is more of a how to force the TUniStoredProc to detect the schema automatically or make the right permissions in the server that if the user has db_owner he can see all of the schemas without specifying the stored procedure schema, and yes all of my stored procedure components are in 2 separate datamodules any ideas? :) – AirWolf Mar 28 '14 at 19:22

1 Answers1

0

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.

FredS
  • 680
  • 1
  • 5
  • 6
  • That would be a good decision if i would use only one scheme, but at the time i used around 7 schemas so thats nit an option what i actually did find uot that Unidac doesn't like schemas very much so i just decided not to use them – AirWolf Jul 01 '15 at 20:43