Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
koci
Starting Member
6 Posts |
Posted - 2005-09-30 : 06:07:04
|
Hi all!I have one UDF which take 5 params. When I run this UDF from Query Analyzer, it take 5 seconds, but when I run from ADP project (doble click), it take > 200 seconds. I look at the connexion, but I don't see nothing to change (File -> Connexion; in .adp).Can anybody tell me why?Thank's in advance koci. |
|
koci
Starting Member
6 Posts |
Posted - 2005-10-03 : 10:06:38
|
Ok, partially I solved the problem, but still have a question:The difference between this two tools:1. In QA: quote: select * from CInventarioAFechaPaso7Agrupar ('01/01/06',1,10000,0,0,0)
2. In ADP: quote: Report.ControlSource = CInventarioAFechaPaso7Agrupar Report.InputParameters = @FechaInventario datetime = Forms!PIInventario!FechaInventario, @DesdeFabricante int = Forms!PIInventario!DesdeProveedor, @HastaFabricante int = Forms!PIInventario!HastaProveedor, @IDFamilia smallint = Forms!PIInventario!IDFamilia, @IDMarca smallint = Forms!PIInventario!IDMarca, @IDTienda smallint = Forms!PIInventario!IDTienda
When I change the reports control source at: quote: select * from CInventarioAFechaPaso7Agrupar ('01/01/06',1,10000,0,0,0)
and clean InputParameters, everything works OK, like in QA (of the time point of view, of course), so, no difference.So far, so good.But if I want to put params in the reports control source, like:quote: SELECT * FROM CInventarioAFechaPaso7Agrupar(@FechaInventario, @DesdeFabricante, @HastaFabricante, @IDFamilia, @IDMarca, @IDTienda)
the InputParameters it's change in:quote: ? = FechaInventario, ? = DesdeFabricante, ? = HastaFabricante, ? = IDFamilia, ? = IDMarca, ? = IDTienda
And If I edit this line, changing in:quote: @FechaInventario datetime = Forms!PIInventario!FechaInventario, @DesdeFabricante int = Forms!PIInventario!DesdeProveedor, @HastaFabricante int = Forms!PIInventario!HastaProveedor, @IDFamilia smallint = Forms!PIInventario!IDFamilia, @IDMarca smallint = Forms!PIInventario!IDMarca, @IDTienda smallint = Forms!PIInventario!IDTienda
the line is change back in:quote: ? = FechaInventario, ? = DesdeFabricante, ? = HastaFabricante, ? = IDFamilia, ? = IDMarca, ? = IDTienda
and I have no way to avoid the manual introduction of params, to run the report.Any explications for this? A workaround, something?Thank's,koci.PS. The way that I use (and work) is assigning in code, in the reports open event, something like following:quote: Dim MiSQL As String MiSQL = "select * from CInventarioAFechaPaso7Agrupar ('" & Forms!PIInventario!FechaInventario & "'," & _ Forms!PIInventario!DesdeProveedor & "," & Forms!PIInventario!HastaProveedor & "," & _ Forms!PIInventario!IDFamilia & "," & Forms!PIInventario!IDMarca & "," & Forms!PIInventario!IDTienda & ")" Debug.Print MiSQL Me.RecordSource = MiSQL
but this is not very elegant, because can't see the field list, for an quick development of report.. |
|
|
|
|
|
|
|