Viewing 15 posts - 931 through 945 (of 1,494 total)
Brian Cromwell (9/3/2009)
September 3, 2009 at 11:15 am
Just use the REPLACE command as suggested above. Something like:
SELECT REPLACE(REPLACE(REPLACE(REPLACE(@SearchText, ' and ', '_AND_'), ' or ', '_OR_'), ' ', ' OR '), '_', ' ')
September 2, 2009 at 6:13 am
Calling a SP from within a trigger is usually a bad idea. It also suggests that you are using a cursor within the trigger - an even worse idea.
I suspect...
September 1, 2009 at 11:17 am
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
Viewing 15 posts - 931 through 945 (of 1,494 total)