Viewing 15 posts - 4,471 through 4,485 (of 59,098 total)
A lot of the methods posed so far do the job but are actually relatively slow because of all the string manipulation using both concatenation and REPLACE. Using a nice...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 23, 2021 at 7:33 pm
My goal is to replace the numbers 1-9 in a column with a different number. For this example the numbers would change to
1=7
2=3
3=9
4=1
5=4
6=2
7=5
8=6
9=8
I tried using the replace function shown...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 23, 2021 at 5:44 pm
p.s. Using VARCHAR with no length is one of those code smells that you might want to avoid.
It would default to varchar(30) , but still to wide for...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 23, 2021 at 5:37 pm
Any help please?
If you want faster help in the future, please see the first link in my signature line below for one of many different ways to post "Readily...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 22, 2021 at 7:10 pm
This looks like it might be used for the old and totally unsafe hack for "encrypting" SSNs and other critical numeric information. If it is, STOP! Do it correctly with...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 22, 2021 at 7:04 pm
Replace all that with
SELECT FORMAT(GETDATE(),'yyyyMMddhhmmss')
You need to be really careful there. FORMAT is about 43 times slower than just about anything you might want to do with CONVERT. It's...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 22, 2021 at 6:05 pm
Read up on OUTER joins. This will do it for you.
https://docs.microsoft.com/en-us/sql/relational-databases/performance/joins?view=sql-server-ver15
SELECT p.ProjectId
,p.ProjectName
...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 22, 2021 at 1:34 am
One of the things that I've been fascinated about for a while is how the camera software on our phones not only puts a box around human faces but also...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 22, 2021 at 1:20 am
I have sql server 2005 and recently my tempdb is hitting the limits of the logical disk drive and cannot expand. It's usually about 1- 4 GB in size,...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 21, 2021 at 9:45 pm
Thanks for the response, i was able to get the solution:
((CAST(Length AS Float)/12)*(16.33)) as Price
Thank you for the help.
You title said you were trying to cast to an INT. ...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 21, 2021 at 9:41 pm
p.s. Using VARCHAR with no length is one of those code smells that you might want to avoid.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 21, 2021 at 9:35 pm
You can cut out one of the REPLACEs. Look at format # 112.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 21, 2021 at 9:31 pm
That's exactly the conclusion that I came to but had to ask. Thanks, Grant.
As a bit of a sidebar, long live xp_CmdShell! 😀
--Jeff Moden
Change is inevitable... Change for the better is not.
October 21, 2021 at 9:17 pm
Have any of you ever solved the problem of something in EE being used to easily identify and delete old files by session without having to jump through a flaming...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 21, 2021 at 3:02 pm
So, the answer is "No". You don't know how to determine the code that is causing TempDB to grow.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 21, 2021 at 1:25 am
Viewing 15 posts - 4,471 through 4,485 (of 59,098 total)