Viewing 15 posts - 14,656 through 14,670 (of 15,381 total)
jarid.lawson (5/20/2011)
I would love to see different / faster ways to do this.
Looping is definitely not the way to go about this. It is painfully slow. If you are trying...
May 20, 2011 at 12:33 pm
Something like this?
declare @MyString varchar(max) = '----A375475960dkgjfkfkgjfkvkl!!!!!-------DAfkdfk55500---!'
select len(@MyString) - len(replace(@MyString, 'a', ''))
May 20, 2011 at 10:50 am
sql_jr (5/20/2011)
May 20, 2011 at 10:34 am
You should NOT use a loop for an update statement. Try something like this.
update MyTable set Gender = case Gender when 'M' then 'F' when 'F' then 'M' end
May 20, 2011 at 8:39 am
You know editing your original post and creating a new thread for the same thing isn't going to generate any new help. Your data is too sensitive and the question...
May 20, 2011 at 7:56 am
Like I said, if you want us to help you, you have to provide us some information. There are very few cases where set based logic can't replace a cursor....
May 20, 2011 at 7:34 am
GSquared (5/20/2011)
For example, an insert that...
May 20, 2011 at 7:20 am
We have the occasional bug (where something actually doesn't do what is it supposed to do) but most of the time it is changing requirements. I can't begin to count...
May 20, 2011 at 7:18 am
I'm sorry but your logic is Severely flawed.:w00t:
I figured that when I saw
@col_name= column name coming rom cursor
at the very top.
If you really want some help you need...
May 19, 2011 at 2:22 pm
That won't really get what this guy is after. For example that would turn '17' into '182'. You probably just need to
update table set col = '82' where col...
May 19, 2011 at 12:16 pm
brent 82845 (5/19/2011)The Primary key for the main table is (Supplier, Terminal, Branded, Product, Eff_Date, Eff_Time)
You can see in the data that Supplier2 sent a second price change for the...
May 19, 2011 at 12:03 pm
This would get you the whole row.
select MyTable.*
from MyTable
join
(
select GroupID, max(DateStamp) as DateStamp
from MyTable
group by GroupID
) groupList on groupList.GroupID = MyTable.GroupID and groupList.DateStamp = MyTable.DateStamp
order by MyTable.GroupID
Depending...
May 19, 2011 at 8:12 am
When establishing a connection if the username/password is correct but the password is set to expired sql will raise an error that the login in failed.
Login failed for user '[user...
May 19, 2011 at 7:24 am
SMB2010 (5/18/2011)
i have updated my question. I hope it is clear enough for you to understand
You kind of missed the whole point about posting ddl and sample data that is...
May 18, 2011 at 1:02 pm
Viewing 15 posts - 14,656 through 14,670 (of 15,381 total)