Viewing 15 posts - 196 through 210 (of 284 total)
update t1 set
t1.Asa = t2.asa
From phone
Inner join table2 on t2.phone=t1.phone
Where t1.asa is null
Should do it.
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
February 8, 2014 at 1:05 am
Jeff Moden (2/1/2014)
Gosh. Sound like you don't actually need anything other than a simple REPLACE for this.
Of course!
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
February 1, 2014 at 4:28 pm
I would look at PatIndex http://msdn.microsoft.com/en-us/library/ms188395%28v=sql.100%29.aspx
and SubString http://msdn.microsoft.com/en-us/library/ms187748%28v=sql.105%29.aspx
and CharIndex http://msdn.microsoft.com/en-us/library/ms186323%28v=sql.105%29.aspx
That should get you started with some basic string parsing functions.
For any future questions, you may also want to...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
February 1, 2014 at 12:08 pm
I took and modified the solution from Chris and came up with this:
update a set
Flagb1 = case when b1 in (A1, A2, A3, A4) then 'Y' else...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
February 1, 2014 at 11:49 am
Glad it is working for you!
Thanks for letting us know the result.
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
January 15, 2014 at 10:21 am
This is just stab in the dark, but I am guessing that 40511 is some Julian type date. With a little date math, I came up with:
select cast(DATEADD(dd, 40511, '1899-12-30')...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
January 15, 2014 at 12:58 am
I just thought I would share what I have found so far.
The main issue is that the app seems to be locked up. It is not. Something in SQL...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
January 7, 2014 at 1:08 pm
Thanks for the suggestions. I will be looking at this and a number of other suggestions I have found while researching this!
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
January 1, 2014 at 12:18 pm
Shadab Shah (12/25/2013)
The closes i can come to this problem is
SELECT LEFT(CONVERT(DATE,VALUE,111),7) FROM #TEMP WHERE ID=2
I'm not entirely sure what you are trying to accomplish, but I think this is...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
December 25, 2013 at 11:23 am
Try this:
;with cte as
(
select *, ROW_NUMBER() over(order by old_ind_id) as RowNum
from #audit_Person
)
select 'old', old_ind_id, old_login, first_name, last_name, email_addr, created_dt, updated_dt,RowNum
from cte
union ...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
December 23, 2013 at 10:59 pm
Try this:
SELECT tag_date
, SUM(close_total)
, ISNULL(SUM(CASE id WHEN 1 THEN close_total ELSE 0 END), 0) AS col1
, ISNULL(SUM(CASE id WHEN 2 THEN close_total ELSE 0 END), 0) AS col2
,...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
December 23, 2013 at 10:35 pm
I would make 1 change to the proposed solution.
You need to take the time portion into consideration when doing ranges.
So this:
where d.dutydate >= v.vacation_start
and d.dutydate <= v.vacation_end
Becomes:
where d.dutydate >= v.vacation_start
and...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
December 23, 2013 at 12:25 pm
drew.georgopulos (12/23/2013)
I code at home now for four clients, and was wondering if it makes any sense to divide the...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
December 23, 2013 at 10:14 am
Jeff Moden (12/22/2013)
First, nice job on providing some readily consumable data for us to test with. I'm surprised that no one jumped on this earlier because it's all there.
Thanks!
I...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
December 23, 2013 at 10:02 am
I ran both solutions on your sample data and Luis' solution was WAY faster, almost double. But the solution provided by Alan uses so many different methods to arrive at...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
December 3, 2013 at 1:48 pm
Viewing 15 posts - 196 through 210 (of 284 total)