Viewing 15 posts - 3,616 through 3,630 (of 5,393 total)
You could also add some PRINT commands to the IF/ELSE branches to see the path it took.
Maybe this is easier than setting up a trace...
-- Gianluca Sartori
December 16, 2010 at 8:28 am
Well, it doesn't work as you expected, but it probably works the way you coded it.
Since you only gave us the code and not an explanation of the expected behaviour,...
-- Gianluca Sartori
December 16, 2010 at 8:26 am
Brandie Tarvin (12/16/2010)
Gianluca Sartori (12/16/2010)
CELKO (12/15/2010)
3) Why are you wasting time with dynamic SQL?
Actually, dynamic SQL is the most efficient way to handle optional parameters in stored procedures.
Using COALESCE,...
-- Gianluca Sartori
December 16, 2010 at 6:32 am
CELKO (12/15/2010)
3) Why are you wasting time with dynamic SQL?
Actually, dynamic SQL is the most efficient way to handle optional parameters in stored procedures.
Using COALESCE, ISNULL, CASE and OR...
-- Gianluca Sartori
December 16, 2010 at 1:49 am
WayneS (12/15/2010)
Craig Farrell (12/15/2010)
-- Gianluca Sartori
December 16, 2010 at 1:26 am
Shubhajyoti Ghosh (12/14/2010)
So do you mean SP and cached Inline Query (Parametarized SQL of ORM using sp_executesql) performance wise same?
Yes, as far as cache-hits is concerned. The same exact code...
-- Gianluca Sartori
December 14, 2010 at 4:14 am
What a question! Really hard to give a sensible answer.
I think this one needs to broken into several points:
1) Query parsing / compilation
ORMs generate SQL code that has to be...
-- Gianluca Sartori
December 14, 2010 at 2:02 am
Mac_85 (12/13/2010)
I must have missed a whole lot (having not used these before).
ADO Command Objects can help you avoiding sql injection and, whenever the procedure is called multiple times, can...
-- Gianluca Sartori
December 14, 2010 at 1:01 am
I don't know exactly what is causing the error. It seems to be related to the parameter type.
You could try to create the parameters reading from the stored procedure metadata,...
-- Gianluca Sartori
December 14, 2010 at 12:58 am
You could take a look at this book on Team-based development:
http://www.sqlservercentral.com/articles/books/71472/
The ebook is free.
-- Gianluca Sartori
December 13, 2010 at 3:14 am
Instead of constructing a sql string containing a string representation of the parameters, you'd better use a command object and pass the parameters as such.
Example:
Dim cmd, sql, prm, conn
Set cmd...
-- Gianluca Sartori
December 13, 2010 at 2:14 am
This should do:
(Emp_Name=Case when @VarEmp_Name is not null Then @VarEmp_Name Else Emp_Name end)And
Hope this helps,
Gianluca
-- Gianluca Sartori
December 13, 2010 at 2:00 am
GSquared (12/6/2010)
Steve Jones - SSC Editor (12/6/2010)
.... It's actually impossible to get a real person at google.
Real people are overrated. I've had plenty of tech support people fail the...
-- Gianluca Sartori
December 6, 2010 at 9:38 am
RETURN exits from current procedure and doesn't affect callers.
command-1 will be executed.
-- Gianluca Sartori
December 6, 2010 at 6:12 am
Check your local server connectivity settings.
You will find it in your start menu: MS SQL Server --> Configuration Tools --> SQL Server Configuration Manager.
Select from the tree view on the...
-- Gianluca Sartori
December 3, 2010 at 1:24 am
Viewing 15 posts - 3,616 through 3,630 (of 5,393 total)