Viewing 15 posts - 2,926 through 2,940 (of 3,957 total)
Had to make a slight correction to my prior post and add a question.
August 29, 2012 at 5:52 am
Mark-101232 (8/29/2012)
CREATE TABLE ABC (Id INT NOT NULL , Name VARCHAR(10), Tab CHAR(1)...
August 29, 2012 at 5:34 am
Yeah, so now what I haven't tested it with is:
Since you can use both OUTPUT and OUTPUT INTO within the same INSERT, UPDATE, DELETE or MERGE, can you also then...
August 29, 2012 at 4:29 am
ChrisM@Work (8/29/2012)
purushottam2 (8/29/2012)
I want to update in single query, other wise i have to use transaction and i can not use transaction.....
Why not? Seems very unreasonable.
You're using SQL Server 2008...
August 29, 2012 at 4:07 am
You could UPDATE the first table and have an UPDATE TRIGGER on it that UPDATEs the second table.
But I believe that a transaction is the way to go.
August 29, 2012 at 3:15 am
You might want to try this one also:
UPDATE t
SET Flag = CASE (SELECT 1 FROM Table2 WHERE number = NEW_NUMBER) WHEN 1 THEN Flag ELSE 0 END
FROM Table1 t
INNER JOIN...
August 29, 2012 at 3:05 am
ChrisM@Work (8/29/2012)
dwain.c (8/28/2012)
CREATE...
August 29, 2012 at 2:20 am
How do you know that abc belongs in col3 and pqr belongs in col5?
August 29, 2012 at 12:56 am
So let's really try to get clever (or really obnoxious depending on your perspective :-D) and allow for up to 9,999,999 INSERTs per day. Try this:
CREATE TABLE #t (ID...
August 29, 2012 at 12:28 am
Jeff Moden (8/28/2012)
dwain.c (8/28/2012)
August 28, 2012 at 11:16 pm
I am intrigued by ChrisM@Work's comment about possible concurrency issues, so I will submit this suggestion so that he may shoot holes in it based on his statement:
CREATE TABLE #t...
August 28, 2012 at 7:41 pm
Look at the RANK() and DENSE_RANK() window functions.
August 28, 2012 at 7:21 pm
I believe that the answer is no.
Business logic should be applied prior to the data being INSERTed. Triggers are more for stuff like:
- Suppressing updates to certain columns
- Creating...
August 28, 2012 at 7:16 pm
ScottPletcher (8/28/2012)
Any of that seems like overkill to me
Well, these are the Vampire_Retailers now aren't they?
Loved that one Joe!
August 28, 2012 at 7:06 pm
LEFT JOINs, CROSS JOINs, FULL OUTER JOINs? What's up with that?
Why not something a bit simpler like this?
;WITH CTE AS (
SELECT n=1, DocNum, Ref, Seq
...
August 28, 2012 at 7:00 pm
Viewing 15 posts - 2,926 through 2,940 (of 3,957 total)