Viewing 15 posts - 49,396 through 49,410 (of 49,571 total)
Easiest is to do it in two steps
UPDATE Table2 SET Description='LightBrown', code='lb' WHERE Description IN ('tan','beige')
Then to remove duplicates
DELETE FROM Table2 WHERE ID NOT IN
(SELECT MIN(ID) FROM Table2
...
September 30, 2005 at 1:55 am
A few points...
LEN(...) will always do a rtrim before it calculates the length. It's how the function works. If you retrieve the data you will see that the space is...
September 29, 2005 at 5:34 am
AFTER and FOR are synonyms of each other. They create the same trigger. The only types of triggers available in SQL 2000 are AFTER and INSTEAD OF
You can use the FOR...
September 29, 2005 at 12:07 am
True. If you only want movies with comments after a certain date (and by my reading that wasn't what was required. I read that he wants all movies with the...
September 28, 2005 at 2:25 am
Select [fields] FROM Movies INNER JOIN Comments ON [join clause]
WHERE CommentID IN
(SELECT TOP 2 CommentID From Comments c Where Comments.MovieID=Movies.MovieID ORDER BY TimeStamp DESC)
Should work. You'll have to change...
September 28, 2005 at 2:07 am
No difference between FOR and AFTER
From Books online
September 28, 2005 at 1:46 am
And bear in mind that if someone has managed to update a system table in the master database, then they're already compromised that server to a large degree.
September 27, 2005 at 12:17 am
SELECT TOP 1 ... FROM .... WHERE pk NOT IN (SELECT TOP n pk FROM table ORDER BY <3_varchar_columns_here> )
ORDER BY <3_varchar_columns_here>
That should give you a good start.
HTH
September 26, 2005 at 6:14 am
SQL's not overly fond of double quotes. In fact, if quoted identifiers is set on (which is a default) your query returns the following error
Server: Msg 207, Level 16, State...
September 26, 2005 at 4:27 am
The quotes are in the wrong place. Try this
set @str = ' where strs in (''40301'',''40301.16'') '
The rest of atra's query should be fine.
September 26, 2005 at 4:22 am
Look up charindex and substring in Books online.
Basically, use Charindex to find the location of the quotes in the string, then substring to extract the portion you want.
DECLARE @str VARCHAR(15)
SET...
September 26, 2005 at 3:06 am
Ach, do a search through this forum. There have been several posts recently about how to get the nth row of a table. You should be able to find one...
September 26, 2005 at 2:50 am
If you're asking how you get the just inserted rows, have a look in Books Online for details of the inserted and deleted tables.
the inserted table will contain the ust...
September 26, 2005 at 1:47 am
Not necessarily. If the update affects a large portion of the table there's a good chance that SQL will take page, extent or even table locks.
Sanjeev, can you post the...
September 23, 2005 at 7:43 am
Agreed.
I don't have a DB design book handy, but iirc it only applies in certain very specific circumstances and usually something in 3rd normal is also in BCNF
September 23, 2005 at 2:00 am
Viewing 15 posts - 49,396 through 49,410 (of 49,571 total)