Viewing 15 posts - 1,516 through 1,530 (of 2,645 total)
Or an even shorter version:
SUBSTRING(OldSSN,8,4)
July 1, 2019 at 4:45 pm
SELECT
t.OldSSN
,LeftTrim = LEFT(t.OldSSN,4)
,RightTrim = RIGHT(t.OldSSN,4)
,[FirstName]
,[LastName]
,LEFT(SUBSTRING(OldSSN,8,100),4)
,LEFT(SUBSTRING(OldSSN,CHARINDEX('-', OldSSN,6)+1,100),4)
FROM [dbo].[TestSSNTrim] AS t
July 1, 2019 at 4:29 pm
Here is the exec plan. I just figured that since a page is 8K, a single integer would easily fit on one page and since the plan is a...
July 1, 2019 at 2:27 pm
Maybe to navigate through the B-tree?
For example, if the b-tree looked like this you would need to read 6 pages with 2 scans to get the min and max values...
July 1, 2019 at 12:58 pm
It could be a problem with the SQL learning site. Maybe it's expecting a decimal point in the output.
You could try casting it to money:
CAST(price + amount...
July 1, 2019 at 12:11 pm
WITH myTable AS (SELECT * FROM (VALUES ('3#5'),('8063#0018375'),('8063#018375'),('063#018375'),('063invalid018375')) X(AccountNumber))
SELECT myTable.AccountNumber,
RIGHT('0000'+LEFT(myTable.AccountNumber,CHARINDEX('#',myTable.AccountNumber)-1),4) PaddedLeftAccountNumber,
RIGHT('0000000'+REVERSE(LEFT(T.RevAccountNumber,CHARINDEX('#',...
June 28, 2019 at 1:55 pm
I have alter the app code with:
INSERT EtiquetasKLC.dbo.etiquetas
(
nome_posto
,data
,lote
,serialnumber
,partnumber
...
June 27, 2019 at 11:18 pm
So, speaking of formatting tools, I just got a complaint because I formatted the code from the stored procedure that I worked on and that generated too many differences...
June 27, 2019 at 3:41 pm
I think the line:
select * from [EtiquetasKLC].[dbo].[etiquetas]with (updlock) where partnumber like...
was put there to lock all the rows with that partnumber so they can't be read by...
June 27, 2019 at 2:01 pm
This will find members of staff who were not on a call when the missed call started ringing:
Set up data
IF OBJECT_ID('tempdb..#RawData','U') IS NOT NULL DROP TABLE...
June 26, 2019 at 7:47 pm
Which column represents the person who answer the call?
How do you calculate the Answered and EndTime?
Where does the hold time come into it?
June 26, 2019 at 6:16 pm
The CTE is just there to represent your tables (I thought you would have a Staff table and a Calls table). You shouldn't have to type anything in manually. I...
June 26, 2019 at 3:43 pm
If the error is raised inside the BEGIN TRANSACTION/COMMIT block then I think there will still be a transaction open in the CATCH block. I don't use "XACT_ABORT ON" but...
June 26, 2019 at 1:35 pm
This will find who was available to answer missed calls but didn't answer them.
The structure it uses is, I think, a bit more like your raw data must be.
June 26, 2019 at 12:40 am
If you only need to lookup consolidation_ind if it is = 1, then create a filtered index on ( consolidation_ind, party_id ) WHERE consolidation_ind = 1. Cluster table #party_id...
June 24, 2019 at 3:19 pm
Viewing 15 posts - 1,516 through 1,530 (of 2,645 total)