Viewing 15 posts - 931 through 945 (of 1,491 total)
DECLARE @jdate int
SET @jdate = 109252
SELECT DATEADD(d, @jdate - 69189, 0)
August 28, 2009 at 6:45 am
UPDATE needs to know which columns it is updating so the only way with static SQL is:
UPDATE RB_Products
SET Sequence1 =
CASE @TypeId
WHEN 1 THEN @sequence
ELSE Sequence1
END
,Sequence2 =
CASE @TypeId
WHEN 2 THEN...
August 28, 2009 at 5:38 am
Even to SQL2008, SCOPE_IDENTITY() etc still have a parallelism bug.
August 25, 2009 at 10:01 am
I am not sure what you are attempting but
SELECT IDENT_CURRENT('table')
will return the last identity value generated for a given table.
If the last insert was rolled back, this will not be...
August 25, 2009 at 9:16 am
DECLARE @t TABLE (t bit)
DECLARE @r int
SET ROWCOUNT 100
INSERT INTO @t SELECT 1 FROM YourTable WHERE [name] LIKE 'a%'
SET @r = @@ROWCOUNT
SET ROWCOUNT 0
PRINT @r
August 24, 2009 at 8:34 am
NULLS still count in a COUNT
Umm... not according to my understanding.
DECLARE @t TABLE
(
Col int
)
INSERT INTO @t
SELECT NULL UNION ALL
SELECT 1 UNION ALL
SELECT NULL UNION ALL
SELECT NULL UNION ALL
SELECT NULL
SELECT COUNT(Col)
FROM...
August 18, 2009 at 5:25 am
Dave - why do you think that this will not work?
I think Dave is a bit cross-eyed this morning! 🙂
The OP is JOINing on ClientID but COUNTing BackupID. This could...
August 18, 2009 at 5:09 am
Logically the main clauses of a SELECT statement are evaluated in the following order:
FROM
WHERE
GROUP BY
HAVING
SELECT
DISTINCT
ORDER BY
ie WHERE is evaluated before Total is defined so the only way to use it...
August 18, 2009 at 3:42 am
river (8/14/2009)
I have other question related to the same problem.
I now can run the query, but in SQL Server 2000 this query executes in 2...
August 14, 2009 at 9:52 am
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
Viewing 15 posts - 931 through 945 (of 1,491 total)