Viewing 15 posts - 4,021 through 4,035 (of 5,394 total)
Glad I could help.
Let's see if this comments help you understanding what goes on behind the scenes:
-- Variable: sql string to execute
DECLARE @sql nvarchar(4000)
-- Variable: sql string to test for...
July 2, 2010 at 1:39 am
No, the two queries get absolutely different plans when unioned together.
That's what I don't understand. How can UNION ALL change the plan so dramatically?
As a side note, yesterday (when I...
July 1, 2010 at 10:08 am
Replace your code with this:
SET @sql = '
SELECT CAST(co.InvoiceNo as varchar(10)),
CAST(co.CustomerNo AS VARCHAR(10)) + '' - '' + co.CustomerName,
...
July 1, 2010 at 8:03 am
What error are you getting?
July 1, 2010 at 6:50 am
Paul White NZ (7/1/2010)
July 1, 2010 at 6:20 am
You could test for existing rows prior to invoking sp_send_dbmail.
Something similar to this:
DECLARE @sql nvarchar(4000)
DECLARE @sqltest nvarchar(4000)
DECLARE @testResults TABLE (rowsAffected int)
SET @sql = 'SELECT someColumn FROM someTable'
SET @sqltest = 'SELECT...
July 1, 2010 at 2:30 am
I agree with Dave: get rid of that function if possibile.
If not, try adding WITH SCHEMABINDING to the function definition: it should mark the function as deterministic and avoid a...
July 1, 2010 at 1:43 am
Dave Ballantyne (6/30/2010)
Coincidence ? , homework ? or left hand not talking to right hand ?Both similar problems , 2000 to 2008 upgrade , udf performance
http://www.sqlservercentral.com/Forums/Topic945233-392-1.aspx
http://www.sqlservercentral.com/Forums/Topic945210-392-1.aspx
It can't be coincidence!...
July 1, 2010 at 1:40 am
You will have to drop the primary key and re-create it nonclustered.
The primary key and the associated index have to live together and cannot be dropped/created separately.
July 1, 2010 at 1:36 am
Have you tried stopping SQL Agent first? It should prevent that prompt from showing.
July 1, 2010 at 1:34 am
Probably there's a better solution, but this is what I could put together quick'n'dirty:
-- Test table
DECLARE @Names TABLE (
FirstName varchar(50),
Surname varchar(50),
Source int
)
-- 1st set of duplicates
INSERT INTO @Names...
July 1, 2010 at 1:24 am
Standards... that's why I love formatting tools: everyone with the same formatting standards, like it or not.
BEGIN AD
We use SQLRefactor and we're very happy with it. I've seen around other...
June 30, 2010 at 4:21 pm
Jeff Moden (6/30/2010)
david_wendelken (6/30/2010)
It's also easier to comment out a line starting with a comma when debugging.
Actually, it's not. It's only easier to comment out the last line with...
June 30, 2010 at 4:02 pm
Steve Jones - Editor (6/30/2010)
Gianluca Sartori (6/30/2010)
I initially posted a cross-post warning on both threads and I realized they were not the same problem and different OPs...
Removed your "removed" posts.
Thank...
June 30, 2010 at 8:57 am
Function can mean Scalar Function (slowest), Multistatement Table-valued Function (slow) or Inline Table-Valued Function (quite fast).
Functions don't have predetermined cached query plans, stored procedures do.
I think the real tie-breaker...
June 30, 2010 at 6:19 am
Viewing 15 posts - 4,021 through 4,035 (of 5,394 total)