Viewing 15 posts - 31 through 45 (of 78 total)
The above will not produce exact expected results for some of the cases:
Yes, but in general your solution won't too. Imagine a few more spaces at the end or begining.
declare...
August 17, 2012 at 5:32 am
Try using replace function like this:
declare @a varchar(100) = 'akraft,crunckel';
set @a = ''''+replace(@a,',',''',''')+''''
select @a
August 17, 2012 at 4:29 am
vinu512 (8/17/2012)
Declare @position Char(33)
Set @position = 'sales'
Select ename, job From
(
Select *, ROW_NUMBER() Over (Partition By job Order By Sal) As rn From Ex...
August 17, 2012 at 1:25 am
Hi! Maybe, if you are familiar with 2005, it would be reasonable to start from here.
August 17, 2012 at 1:01 am
We also may update like this:
with cte as
(
select
rn = row_number() over (partition by ClientKey order by GuarantorKey desc),
*
from
#tmpGuarantor
)
update t
set t.GuarantorKey = cte.GuarantorKey
from
#tmpTest t
join cte on t.ClientKey =...
August 17, 2012 at 12:50 am
dwain.c (8/16/2012)
Here's another way that is a bit faster than using PARSENAME.
If we speak for performance aspect, I think it is not parse name, rather it is replace impact, because...
August 17, 2012 at 12:20 am
It would be also nice to see actual plan in xml. And maybe some info about a table, e.g. size, structure and indexes.
August 16, 2012 at 8:51 am
NULL+123 = NULL
NULL + Anything = NULL.
That's how it works. use isnull function over the fields, like that
isnull(MyField1,0)+isnull(MyField2,0)+...
than if the field will contain null - it will be replaced by...
August 16, 2012 at 8:38 am
This theme was covered in details here
I encourage you to read it.Paul White: Page Free Space - The Impact of Non-Updating Updates
August 16, 2012 at 3:03 am
In particular simple case, when: 1) there not more than 4 columns, 2) column data fits nvarchar(128) (sysname), 3) no dots in data - you may use parsename function like...
August 16, 2012 at 2:56 am
If I understand you correctly, smth like this:
update a
set
totalmarks = case when b.class2 > a.class1 then maths + english else totalmarks end
from
A a
join B b on -- some join condition
Upd:
removed...
August 16, 2012 at 2:02 am
sqlnyc (8/10/2012)
Gail - please forgive my terminology. I did indeed modify existing indexes with INCLUDE.Best wishes,
SQLNYC
Thank's for the plans! It is now much more clear!
Well, I think, I figured...
August 10, 2012 at 2:42 pm
Wait for a moment!
Look at the plan.
Here is what good plan says:
@PayrollID value = (345)
Here is what bad plan says:
Compiled param value = (334329)
Run param value = (345)
Seems there is...
August 10, 2012 at 1:44 pm
sqlnyc (8/10/2012)
My understanding about parameter sniffing is that the optimizer uses the plan that was compiled after first use, which may not be optimal for subsequent...
August 10, 2012 at 11:51 am
Maybe you mean, that you want to execute a cross server query?
You may add linked server. After that you may query remote table specifying 4 part name:
select * from MyServer.MyDatabase.MyScheme.MyTable.
You...
August 10, 2012 at 5:05 am
Viewing 15 posts - 31 through 45 (of 78 total)