Viewing 11 posts - 61 through 71 (of 71 total)
Thanks for that - never thought of doing count(@A) to test for null. Learnt something new!
July 22, 2011 at 4:58 am
Yes, I got caught out with nulls (not for the first time!) and started thinking about it. Maybe it's better to avoid isnull or coalesce and use:
@A1 = @A2 or...
July 21, 2011 at 11:49 am
Of course not, I just had no idea what it would do. There's nothing special about isnull(@A, ''), you're replacing a null with a value for comparison because you didn't...
July 21, 2011 at 11:10 am
July 21, 2011 at 10:44 am
isnull(@A, '') will work when @a is char (and empty string is not in the db) but not when @a is numeric.
You're still left with isnull(@A,...
July 21, 2011 at 10:31 am
Thanks for that. Agree about avoiding null columns if at all possible - something I know but then didn't do and got caught out!
A default value is relatively easy to...
July 21, 2011 at 6:57 am
Thanks.
There doesn't seem to be the restriction of the where clause being for a single sub-table insert per pass (if I understand this right) as a single:
insert PartionedView...
select ... from...
July 17, 2011 at 1:04 pm
Four base tables for 2008 or earlier, 2009, 2010, 2011 or later - first one shown:
CREATE TABLE [dbo].[Migrate2008HHTable](
[MeterPointRef] [nvarchar](50) NOT NULL,
[MeterRef] [nvarchar](50) NOT NULL,
[Rdg_Timestamp] [smalldatetime] NOT NULL,
[Value] [decimal](18, 4) NOT...
July 15, 2011 at 2:25 pm
Ok. What about updating the partitioned view with another table, can't see how this can be done without referencing the view in the update to find the matching rows?
July 15, 2011 at 1:01 am
Yes, that's very useful for the initial populating of the view base tables. But thinking there is a more fundamental problem that would affect existing stored procedures that are used...
July 14, 2011 at 1:03 pm
Yes, that's what I'm after. Tried batching:
declare @BatchSize int
select @BatchSize = 200000
while 1 > 0
begin
begin tran
insert into Destination
...
July 14, 2011 at 12:21 pm
Viewing 11 posts - 61 through 71 (of 71 total)