Viewing 15 posts - 5,776 through 5,790 (of 7,614 total)
GilaMonster (9/22/2014)
In this case no assumption was needed, since the OP saidField from table1 is primary key
It's currently the PK (perhaps). Just in case, I'd write the code so...
September 22, 2014 at 1:25 pm
Of course the only ultimate solution to "replace bad vendor query" is "replace bad vendor." 😀
You can set up a trace with a high threshold(s) to capture really bad queries....
September 22, 2014 at 10:37 am
GilaMonster (9/22/2014)
September 22, 2014 at 10:24 am
IF OBJECT_ID('tempdb.dbo.#sp_spaceused') IS NOT NULL
DROP TABLE #sp_spaceused
CREATE TABLE #sp_spaceused (
db_name varchar(100) NOT NULL CONSTRAINT sp_spaceused__DF_db_name DEFAULT '',
name varchar(100)...
September 22, 2014 at 10:22 am
You did add 70 rows, so while the growth is a little higher than average, it's not ridiculously high. Yes, you do want to convert to varbinary(max) instead of...
September 19, 2014 at 12:18 pm
That "DISTINCT" is a big concern. Either the joins are producing dups, and thus the joins need modified, or the code is needlessly forcing SQL to sort the results.
September 19, 2014 at 9:41 am
Does the view use "SELECT *" and/or some other generic column name, such as $ROWGUID? [If you posted the view definition, sorry, I didn't see it.]
You could also create the...
September 19, 2014 at 9:24 am
Luis Cazares (9/18/2014)
I support your code if it's accompanied by the proper comments describing what it does. I'm not trying to be pedantic, this...
September 18, 2014 at 4:40 pm
SELECT
COUNT(C.[Place Referance]) AS [April Total Voids],
SUM(CASE WHEN [Void End Date] IS NULL THEN 1 ELSE 0 END) AS [April_Still_Voids]
...
September 18, 2014 at 4:32 pm
You should use a computed column if possible. If not, you can still take the conversion code from below and use it in an UPDATE:
ALTER TABLE [HR_DEV_DM].[CFQ_TEST].sp_CFQ_Commercial_Referrals
ADD CreatedBy_SalesRepSharePointID AS...
September 18, 2014 at 4:24 pm
I recommend avoiding unnecessary string conversions/usage, and dependencies on language and/or other SQL settings.
Not sure what the h "N" means, but I still suggest this style of code instead:
WHERE DATEDIFF(DAY,...
September 18, 2014 at 4:20 pm
Jeff Moden (9/18/2014)
ScottPletcher (9/18/2014)
September 18, 2014 at 4:15 pm
CPU is typically not the bottleneck nowadays, I/O is. More RAM = bigger buffers = less I/O. Thus, RAM will typically be much more vital to performance that...
September 18, 2014 at 1:52 pm
Or:
SELECT OBJECTPROPERTYEX ( OBJECT_ID('object_name') , 'IsView' ) AS IsViewOrNot
September 18, 2014 at 1:39 pm
I believe my code above met your (implied) challenge ;-).
September 18, 2014 at 10:13 am
Viewing 15 posts - 5,776 through 5,790 (of 7,614 total)