Viewing 15 posts - 301 through 315 (of 427 total)
Thanks for that addition, you are right, line 3 needs some more clarification. However, the both statements are not equivalent. I said null was assigned, which is indeed not true:...
August 29, 2011 at 10:33 pm
declare @tbl table (
txt varchar(max) not null
);
insert @tbl(txt)
select 'ABC EN 709+A1'
union all select 'ABC-EN 1/A1'
union all select 'ABC 104233/1M'
union all select 'ABC-EN ISO 50065-4-7 CORR'
union all select...
August 29, 2011 at 12:56 pm
🙂 no problemo.
I'll skip 1 & 2, these are clear, aren't they?
Line 3:
SELECT @Identity = ISNULL(MAX(ApprovalModelId),1)
FROM mgo.ApprovalModel
WHERE ApprovalModelId < @IdentityStart
Assigns into @Identity the highest value from all values...
August 29, 2011 at 8:24 am
Nicely done! I hadn't seen @@procid before and I see, next to this one some great usages for it. So thanks a lot for the pointer.
There is a potential caveat...
August 29, 2011 at 4:26 am
Have a look at Jeff Moden's articles on cross-tab[/url]. These are a (better) alternative to the use of the pivot command. Among other things, cross-tab allows for adding additional columns...
August 29, 2011 at 2:28 am
Did you also try Ken Lee's last suggestion?
Ken Lee-263418 (8/28/2011)
... Verify what you are getting in the SQL "string" if you use varchar(20).
And if so, what was the outcome?
August 28, 2011 at 11:58 pm
My guess would be the original author is trying to avoid creating gaps in the assigned id range. An identity value is incremented even if an insert that was attempted,...
August 28, 2011 at 11:37 pm
:-D, still there is a reason for them being in this example: I generate a lot of my code, and leading comma's happen to be a lot easier to generate...
August 25, 2011 at 10:00 pm
Have a look at the replications' retention cleanup. Can it be your server still holds all changes since "the beginning of times"?
August 25, 2011 at 2:24 pm
If you're using stored procedures to make the changes and you plan to do the auditing from in there too, you may want to read up on the output clause....
August 25, 2011 at 2:12 pm
Maybe you can have them use osql or sqlcmd instead of management studio to execute the scripts. You can then provide them with the 6 files, plus a batch file...
August 25, 2011 at 1:49 pm
There's a big drawback on this type of auditing: the audit table is going to be a real hot spot in your database. Every insert, update, delete on every table...
August 25, 2011 at 10:01 am
Again, you'll have to test it, but I think this will be faster on larger data sets.
with cteMaintenanceSales as (
-- Collect all sales where a maintenance product...
August 25, 2011 at 4:33 am
I could not test it, as you did not include any DDL or test data, but this should do the trick.
with cteMaintenanceSales as (
-- Collect all sales...
August 25, 2011 at 4:22 am
Yeah, that's what we've been saying too. He's already falling into all the pits that we've warned him for.
August 25, 2011 at 3:02 am
Viewing 15 posts - 301 through 315 (of 427 total)