Viewing 15 posts - 48,511 through 48,525 (of 49,571 total)
Or use a subquery
Select a.order_number, a.customer, qty_in_stock
From (
SELECT order_number, customer, stock_calc(<param> ) AS qty_in_stock
FROM Orders) a
Where qty_in_stock > 10
Aliases haven't been processed when the where clause executes, so they cause errors
September 6, 2007 at 4:42 am
Dunno about real tables, but that won't work with temp tables. The name in sysobjects in tempdb is not the same as the name you use to reference the table....
September 6, 2007 at 4:31 am
It will work.
That said, this kind of catch-all search query is very prone to poor execution plans due to parameter sniffing and cached plans. You may find that for certain...
September 6, 2007 at 1:49 am
You'll probably find the stack dump files in SQL's error log directory. (SQLDumpxxx.txt and SQLDumpxxx.mdmp)
I would recomend that you contact MS's Product Support and log a case for this. There...
September 6, 2007 at 1:29 am
Spid -2 is normally caused by orphened DTC transactions. I get them often from some JDBC queries. I can't think of any reason you should gt them from a select...
September 6, 2007 at 1:16 am
I do have a full time job, as does just about everyone else who answers questions here. I'll look at your stuff when I have a few minutes free
September 6, 2007 at 12:20 am
Have you considered indexed views to replace your derived tables? It will result in a slow down of inserts/updates but that trade off may be acceptable considering your reporting needs.
Is session_id...
September 4, 2007 at 9:33 am
It is possible what you're trying to do, but the other way around. this works
CREATE PROCEDURE p1 AS
CREATE TABLE #Temp (...)
EXEC p2
GO
CREATE PROCEDURE p2 AS
SELECT * FROM #Temp
GO
It doesn't work...
September 4, 2007 at 3:31 am
Kimberley Tripp's blog and articles
September 4, 2007 at 3:24 am
Wow.
OK, I haven't read through all of that, maybe over lunch, but one thing caught my eye
IF
@GroupLevel
September 4, 2007 at 12:46 am
Index on Field1 in Table2, including Field3 if it is necessary to return that. You say that Field2 is the pk. Is it the clustered index as well?
An order by...
September 4, 2007 at 12:15 am
Could you post one of the offending queries please, as well as the existing indexes on the tables.
September 3, 2007 at 6:51 am
Just be aware that that kind of catch-all query is extremely prone to poor execution plans, due to parameter sniffing with varying parameters.
Also, the query optimiser tends to mis-read the multiple...
September 3, 2007 at 6:01 am
Please don't make multiple posts about the same issue
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=338&messageid=394156
September 3, 2007 at 4:51 am
You can use an index hint, however, I can guarentee to you that forcing the index on field2 will make the query worse.
Your sort and your join are both on...
September 3, 2007 at 2:24 am
Viewing 15 posts - 48,511 through 48,525 (of 49,571 total)