Viewing 15 posts - 4,456 through 4,470 (of 59,087 total)
The big thing for partitioning for me has nothing to do with queries. As Grant indicates, partitioning almost never improves performance. Even so called "partition elimination" is usually slower than...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 25, 2021 at 5:56 pm
SQL2005 doesn't have XE!
Check your default trace file or run a trace to figure it out !
Ah... thanks, Johan. Shows how much I use EE.
The problem with using...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 25, 2021 at 12:23 pm
Thank you for the great feedback and the quote from BOL.
Now if we could get the OP to cough up the reason for wanting to do this task. 😀
--Jeff Moden
Change is inevitable... Change for the better is not.
October 24, 2021 at 6:30 pm
This is getting the data I need, but not the format.
select replace(convert(varchar, getdate(),101),'/','') + replace(convert(varchar, getdate(),108),':','')
10212021102437
I want YYYYMMDD before the time portion.
Thanks.
Just out of sheer curiosity, why do you...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 23, 2021 at 10:26 pm
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
Viewing 15 posts - 4,456 through 4,470 (of 59,087 total)