Viewing 15 posts - 3,646 through 3,660 (of 8,731 total)
Other than using a different function, the final code is basically the same. The only problem is that you're not using the fastest function available (even in the article Aaron...
December 11, 2015 at 8:11 am
You're commiting your transaction twice. Once in the try and once in the catch. Remove one of them to correct the issue.
For the second post, you have an open transaction...
December 10, 2015 at 12:10 pm
I'm not sure why do you want a pivot.
Note that this code will only work with up to 4000 chars. If you don't have unicode values, you could use the...
December 10, 2015 at 8:52 am
The DelimitedSplit8K is a great tool, but you might find useful to use another tool to reduce the code.
This tool is the Pattern Splitter created by Chris Morris and posted...
December 10, 2015 at 8:27 am
I did something slightly different from Lowell's.
CREATE TABLE #Shifts(
StartShift time,
EndShift time
)
INSERT INTO #Shifts
VALUES( '21:00', '06:00'),
( '06:00',...
December 10, 2015 at 7:34 am
Probably a cross tab could do the trick:
SELECT ID,
MIN( CASE WHEN String LIKE 'Rejected%' THEN Date1 END) AS [Rejected on],
MAX( CASE WHEN...
December 9, 2015 at 1:41 pm
No problem. Just try to be clear on what you need as much as possible.
We get confused if you suddenly change the requirements without explaining the reason or saying it...
December 9, 2015 at 10:41 am
Sean Lange (12/9/2015)
I like this approach but not sure why it is safer. It is easier to maintain for sure since it removed the duplicate charindex function.
It doesn't rely on...
December 9, 2015 at 10:35 am
cswittmaack (12/9/2015)
LuisI did not create the table, I know they are hexadecimal numbers.
All I want to do is pull the records that are Decimal numbers not the hexadecimal numbers.
Just use...
December 9, 2015 at 9:57 am
This should be safer.
declare @URL varchar(100) = 'http://www.mydomain.info/Customer.aspx?dcc=EUR&h_hmid=2907831&mobiredirect=no&cpn=3790'
SELECT *, LEFT( initial.pos, CHARINDEX( '&', initial.pos + '&') - 1)
FROM (VALUES (@URL)) AS x(url)
CROSS APPLY (SELECT SUBSTRING( x.url, CHARINDEX('h_hmid=', x.url) + 7,...
December 9, 2015 at 9:54 am
cswittmaack (12/9/2015)
December 9, 2015 at 9:29 am
The Developer Edition should be available when the product is completely released. Right now, you want to use the CTP version which is a free preview for evaluation.
December 9, 2015 at 8:43 am
You might need this:
SELECT *
FROM sys.tables t
JOIN sys.schemas s ON t.schema_id = s.schema_id
where t.name = 'STHMCDPTD'
AND s.name = 'CMS'
Or this:
SELECT *
FROM sys.tables t
where t.name = 'STHMCDPTD'
AND SCHEMA_NAME(t.schema_id) = 'CMS'
Or for...
December 9, 2015 at 8:36 am
Depending on the collation, that might not work correctly. Try this:
CREATE TABLE#alpha_numerics(alpha_numeric VARCHAR(30));
WITH
E(n) AS(
SELECT n FROM (VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0))E(n)
),
E2(n) AS(
SELECT a.n FROM E...
December 9, 2015 at 8:30 am
arkiboys (12/9/2015)
Luis Cazares (12/9/2015)
December 9, 2015 at 7:54 am
Viewing 15 posts - 3,646 through 3,660 (of 8,731 total)