Viewing 15 posts - 136 through 150 (of 428 total)
And also the global temp table is not needed at all. For example:
DECLARE @dd1 datetime = dateadd(year, -1, getdate());
DECLARE @SQLString NVARCHAR(4000);
SET @SQLString = N'
select t.name, t.object_id
from sys.tables t
where...
March 8, 2012 at 3:20 pm
You should not do any string concating. If you're going to use sp_executesql, then use it properly and specify the date as a parameter.
DECLARE @SQLString NVARCHAR(4000)
SET @SQLString = N'
SELECT...
March 8, 2012 at 3:12 pm
In fact, you will always have holes in the sequence. For example if you do a rollback after an insert, the value will not be reset, even though the row...
March 8, 2012 at 3:00 pm
If an exam question explicitly states "cross join is not allowed", they're probably asking for you to show that there is another 'construct' in SQL that accomplishes the same result...
March 8, 2012 at 8:05 am
Raghavendra Mudugal (3/8/2012)
(from next time rather converting to image, it will be better to paste the exact SQL)
Actually no. The code was intentionally presented as a picture for 2 reasons:
1...
March 8, 2012 at 6:36 am
ladyblue1075 (3/8/2012)
I'm writing a script that will update selected multiple rows of records I got from my EXCEPT select.
I wrote this:
UPDATE t1
SET t1.col1 = t2.col1, t1.col2 = t2.col2, t1.col3...
March 8, 2012 at 6:27 am
To finalize this: My explanation is wrong and my question + answer was correct only by luck.
The proper explanation has been given in this thread. To be sure I am...
March 8, 2012 at 2:52 am
tim.kay (3/8/2012)
Got it right and thought that I understood - now looking at the other posts I am slightly confused.
So am I, as I was very sure I had tested...
March 8, 2012 at 2:23 am
I see your point. I have to get back on this or maybe someone else sees what's wrong?
March 8, 2012 at 1:38 am
You have left off half of the explanation in your quote. In the next sentence the use of parenthesis to override this behavior is explained:
To preserve duplicates in only a...
March 8, 2012 at 1:23 am
Provide us a table definition (so we can create a table similar to yours) plus a script to fill it with some test data. That way we can see for...
March 7, 2012 at 1:14 pm
This shows OldID 1 changed to NewID 12
And so on, however, an Id can change more than once.
Like OldID 5 went from 5 to 23, then 23 to 50.
I did...
March 7, 2012 at 8:33 am
Or use a free proxy server somewhere on 'the net'. This article is an absolute 'must read' related to your work. You should not have to read it from home.
March 7, 2012 at 7:07 am
The Cad-method assumes that the newID always higher is than the oldID. This may very well be true, given that the ID is likely implemented as an identity column, but...
March 7, 2012 at 6:33 am
Disregarding the fact that indeed create date is normally before the modification date, it is easy to determine the latest of two (or more) date values from a single row...
March 7, 2012 at 5:50 am
Viewing 15 posts - 136 through 150 (of 428 total)