Viewing 15 posts - 1 through 15 (of 154 total)
The first query should be faster , if you had the appropriate indexes on
Customers.Country and composite on Orders.CustomerId + Orderdate (or clustered on Customerid)
December 2, 2003 at 5:24 am
Glad to,
Generally constructs like these
@direction * sort make the where clause unsargable -
you can check the query plan...create indexes on id & sort fields seperately ...
( composite won't...
December 2, 2003 at 1:13 am
sometimes the best solution is the simplest
CREATE PROCEDURE Usp_MoverItemTest1 (@id char(1),@Direction char(1))
As
SET NOCOUNT ON
DECLARE @sort int, @id2 char(1)
SELECT @sort = sort
FROM testsort
WHERE id = @id
IF @direction...
December 1, 2003 at 7:28 am
try this
SELECT T3.Year,T3.CourseID,ISNULL(T4.NumOldStudent,0) As NumOldStudent
FROM TCourseTaken T3
LEFT OUTER JOIN
(
SELECT T1.Year,T1.CourseId,Count(*) As NumOldStudent
FROM TCourseTaken As T1
INNER JOIN TCourseTaken As T2 ON
(T1.Year - 1) = (T2.Year) AND
T1.CourseId = T2.CourseID...
December 1, 2003 at 2:51 am
SELECT *, TEMPCOL=Identity(int,1,1)
INTO #TempTable
FROM TableX
select * from #temptable
where TEMPCOL =2
drop table TableX
drop table #temptable
November 25, 2003 at 5:07 am
Where the Local Temp table and Global Temp Table will be stored?
Tempdb
Is it possible to get the temp. tables scripts?
This should check for existance of the tables if...
November 24, 2003 at 2:41 am
look up osql or bcp in Books online
November 20, 2003 at 7:09 am
I will agree with Melanie , other than making RI difficult to maintain , i think it would have some sort of performance impact
a) this table will be heavily used...
November 20, 2003 at 7:01 am
Yes they are the same,there would be no difference in execution of both..
i personally prefer to put my constants in the where clause , but that would have no difference...
November 20, 2003 at 12:09 am
all the fields will have to be the same type for this to work..
a workaround would be the following query
Set @vOrder = 1
Select ClientID, PrimaryFirstName, PrimarySurname
From Client
Order By
CASE When...
November 20, 2003 at 12:02 am
try replacing <master> with whatever database that has sp_name...
'SET FMTONLY OFF EXEC MyDatabase..sp_sproc_columns spname'
November 19, 2003 at 11:49 pm
depends on what you want to do.. if you could paste the DDL and some data - we can have a look
November 19, 2003 at 1:01 am
Hi , this should return the recordset not just columns
November 19, 2003 at 12:58 am
try updating the index statistics on the tables used in the procedure - check the query plan using SET SHOWPLAN options .. if all else fails try running the procedure...
November 19, 2003 at 12:32 am
Viewing 15 posts - 1 through 15 (of 154 total)