SQL Server
Denis Gobo provides a double dose of dynamic SQL hotness via Changing exec to sp_executesql doesn’t provide any benefit if you are not using parameters correctly and Avoid Conversions In Execution Plans By Using sp_executesql Instead of Exec. Following his tips in here will net you some considerable benefits in how your dynamic SQL [...]
I frequently find myself having to perform calculations on the source data based on a range of user supplied values. Usually there will be some kind of target and destination parameter supplied. So, for example, the users will want to see total sales in terms of burgers sold or something like that. Here’s where it [...]
I’m going to guess everyone can guess that DB_NAME() will give you the name of the current database when called with no parameters. If not, now you know.
PATINDEX() is a little bit more fun, so before we get into things, here’s how PATINDEX() works:
DECLARE @my_var AS NVARCHAR(30);
SET @my_var = ‘fun with patterns’;
SELECT PATINDEX(‘%pattern%’, @my_var);
– returns [...]
First off, thanks to everyone who attended today’s Dynamic SQL presentation. I appreciate everyone taking the time out of their busy day to attend the first AppDev SIG Live Meeting in quite some time. Hopefully there will be many more.
I’ve attached a copy of the Dynamic SQL presentation that I gave today. Here’s a run [...]