Viewing 15 posts - 946 through 960 (of 1,497 total)
I suspect SQL2005 does better syntax checking.
Your derived table, NOTA, only returns the columns SOMA and NUMDU. so
ORDER BY NOTA.CODLIQ DESC
does not make sense.
SQL2000 must try to find any column...
August 14, 2009 at 8:11 am
Your first query has the edrs_no filter in the wrong place.
Try:
SELECT uniqueid, course_code, instance_code, awarding_body, delegate_name,
course_title, glh, Employer_postcode, edrs_no, recordmanager, delegateid, entityid
FROM
(
SELECT uniqueid, course_code, instance_code, awarding_body, delegate_name,
course_title, glh, Employer_postcode, edrs_no,...
August 13, 2009 at 4:30 am
So British english is dd/mm/yyyy and yyyy/dd/mm?
No, British English is either 'dd/mm/yyyy' or 'dd/mm/yy'.
Also, regardless of how the date is set, 'yyyymmdd' will always convert to a datetime.
So, for your...
August 11, 2009 at 10:12 am
For the two date formats given the following will work:
-- set to european format.
SET DATEFORMAT dmy
DECLARE @t TABLE
(
CharDate char(10) NOT NULL
)
INSERT INTO @t
SELECT '31/12/2009' UNION ALL
SELECT '2009-06-30'
SELECT ISDATE(REPLACE(Chardate, '-', ''))...
August 11, 2009 at 8:08 am
With SQL2008 and the latest version of ADO you can even pass a table.
August 11, 2009 at 4:27 am
Without test data, and expected results, it is difficult to tell but maybe something like:
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE PROCEDURE dbo.P_SRE_T_CAL
@CURDATE datetime,
@ERROR varchar(50) OUTPUT,
@TRANIDUP varchar(8000)...
August 10, 2009 at 3:48 am
Either use exception handling in the calling procedure or try the following:
--Run subproc
DECLARE @err int
EXEC @err = spNewSubProc @params
IF @err 0
GOTO OnError
August 7, 2009 at 10:25 am
Try the universal data format:
SELECT count(*)
,[date]
FROM tbl1
WHERE [date] BETWEEN '20090501' AND '20090531 23:59:59.997'
GROUP BY [date]
August 7, 2009 at 8:41 am
Difficult to tell without sample data and expected results, but you seem not to be restricting the subqueries
by the STVTERM_DESC. In this case I would forget about subqueries and just...
August 6, 2009 at 9:49 am
Logically the INNER JOIN is done first. ie The INNER JOIN is the nested join.
August 5, 2009 at 1:53 am
Maybe something like:
-- *** Test Data ***
DECLARE @t TABLE
(
Item int NOT NULL
,Sales_Date smalldatetime NOT NULL
,Quantity int NOT NULL
,Amount money NOT NULL
)
INSERT INTO @t
SELECT 1, '20090222', 1, 5.00 UNION ALL
SELECT 1,...
August 4, 2009 at 8:11 am
This is a nested join. To make it readable I would recommend that you always use brakets:
SELECT *
FROM dbo.demog dm
RIGHT JOIN
(
dbo.packlist pl
JOIN dbo.kittype kt
ON pl.kittype = kt.kittype
)
ON dm.siteid =...
August 4, 2009 at 6:19 am
You should check this yourself by looking at the query plans.
I suspect the plans will be the same as the optimizer should sort out the best access path.
July 28, 2009 at 3:19 am
You could try putting sp_releaseapplock in the CATCH block as well as the TRY block.
As you seem to be using SESSION applocks I think you would have difficulty is determining...
July 28, 2009 at 3:12 am
WHERE Title LIKE SearchText + '%'
AND [Description] LIKE SearchText+ '%'
AND link LIKE SearchText + '%'
July 28, 2009 at 2:49 am
Viewing 15 posts - 946 through 960 (of 1,497 total)