Viewing 15 posts - 7,696 through 7,710 (of 10,144 total)
Hi Brett
Please can you post the CREATE TABLE statement for <<the second table has a primary key that is set to SEQ_NUM autoincrement>>
Cheers
July 8, 2010 at 4:15 am
"There's nowt so queer as folk".
How many of us can remember as far back as our first four or five years? Do you remember that kid who used to experiment...
July 8, 2010 at 2:49 am
Lynn Pettis (7/7/2010)
Alvin Ramard (7/7/2010)
CirquedeSQLeil (7/7/2010)
Alvin Ramard (7/7/2010)
CirquedeSQLeil (7/7/2010)
Alvin Ramard (7/7/2010)
Jeff Moden (7/7/2010)
July 8, 2010 at 2:24 am
Tom.Thomson (7/7/2010)
retirement is even busier, I understand.
Keep it that way! Blokes who retire in the common sense seldom last the year.
July 8, 2010 at 2:08 am
No worries.
Grab yourself a beginners' TSQL book, there are loads on Amazon - and get to know BOL, the SQL Server on-line help guide. Basic TSQL is quick to pick...
July 7, 2010 at 10:03 am
Ok...let's get started then. When scripting an UPDATE, always start with a SELECT. Something like this:
SELECT TOP 100 [disabled], [date created]
FROM MyTable
WHERE [date created] < '2005-06-01 00:00:00.000'
July 7, 2010 at 8:44 am
omd (7/7/2010)
Chris Morris-439714 (7/7/2010)
UPDATE MyTable SET [disabled] = MyNewValue
WHERE [date created] < 'June 2005'
Edit: This is a basic UPDATE statement, it doesn't get any easier - except you will...
July 7, 2010 at 8:28 am
espanolanthony (7/7/2010)
still no comments. 17 views
Plenty of comments!
What have you tried so far?
July 7, 2010 at 8:07 am
omd (7/7/2010)
Chris Morris-439714 (6/21/2010)
Looks like an UPDATE to me.
UPDATE docsadm.shellorganisationSET [disabled] = 'y'
WHERE docsadm.shellorganisation.org_name LIKE 'do not use%'
Sorry to drag an old thread back up to the top, however...
July 7, 2010 at 8:04 am
You could split it into two possible options like this:
IF @VarCourse_Name IS NULL
BEGIN
SELECT *
FROM Course
WHERE freetext(Course_Name, @VarCourse_Name)
AND Course_Id = COALESCE(Course_Id, NULLIF(@VarCourse_Id, 0))
AND ...
END
ELSE
BEGIN
SELECT *
FROM Course
WHERE 1 = 1
AND...
July 5, 2010 at 6:28 am
nazaninahmady_sh (7/5/2010)
ok, Course_Name if column name , so i wroteit correctly:Else (freetext(Course_Name,@VarCourse_Name))
but there is syntax error
As Eugene points out, this won't work because you're attempting to compare
Course_Name with...
July 5, 2010 at 6:02 am
nazaninahmady_sh (7/5/2010)
thank you for your notification but again i have that message:Incorrect syntax near the keyword 'freetext'.
Sorry, my mistake. This is a component of full-text searching. Is full-text search enabled?...
July 5, 2010 at 5:40 am
Assuming 'freetext' is a UDF then you need to qualify it with the schema name to which it belongs, typically like this:
(Course_Name = Case when ((@VarCourse_Name='') or (@VarCourse_Name is null))...
July 5, 2010 at 5:33 am
Viewing 15 posts - 7,696 through 7,710 (of 10,144 total)