Viewing 15 posts - 4,186 through 4,200 (of 8,731 total)
Sean Lange (9/17/2015)
Awesome thanks Luis. I have been focusing on other aspects of this process today and hadn't gotten to writing up a test harness for performance yet. I will...
September 17, 2015 at 9:09 am
If anyone wonders about performance on the posted solutions.
CREATE TABLE Testing
(
VHRGDT numeric(8, 0) NOT NULL,
VHRGTM numeric(6, 0) NOT NULL
)
INSERT INTO Testing
SELECT TOP 1000000
CONVERT( char(8), a.create_date,...
September 17, 2015 at 8:35 am
Kristen-173977 (9/17/2015)
Would a binary collation on the REPLACE do the trick?
The problem wasn't on the collation, even with collation Latin1_General_100_CI_AI (Latin1-General, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive) the alpha and the a...
September 17, 2015 at 8:29 am
Can I join the party? 😀
Why are you complaining about a company who follows MS examples? If MS stores dates and times like this it should be right. :hehe:
Now being...
September 17, 2015 at 7:49 am
That's because the alpha is a unicode character and you're using ascii characters. In this case, the alpha gets changed into an a.
Here's a little change in your code:
DECLARE @letters...
September 17, 2015 at 6:57 am
That's creating a table with the data returned by the query. The datatypes are defined by the column data types or the expressions used in the query.
That's not a SQL...
September 16, 2015 at 2:12 pm
Please share DDL and sample data to be able to give a better answer.
September 16, 2015 at 1:21 pm
Use a trigger.
September 16, 2015 at 1:05 pm
I'm sorry, I missed the simple option (add a WHERE clause to the initial solution).
SELECT STUFF(
(SELECT ','+LTRIM(RTRIM(LEFT(Item, CHARINDEX('=', Item + '=') - 1)))
...
September 16, 2015 at 11:53 am
It gets tricky, but you could analyze your data to find the patterns.
SELECT Data,
(SELECT LTRIM( RTRIM(RIGHT( Item, CHARINDEX( ',', REVERSE(Item) + ','))))
...
September 16, 2015 at 11:48 am
You can find the DelimitedSpli8k function that Scott used (along with its explanation and benchmark) in here: http://www.sqlservercentral.com/articles/Tally+Table/72993/
And the explanation for the concatenation method using FOR XML PATH in here:...
September 16, 2015 at 10:34 am
Kristen-173977 (9/16/2015)
Luis Cazares (9/16/2015)
Here's a small test to prove it.
Interesting, thanks. I tried it without the CAST and got a query plan that looks like less work - its still...
September 16, 2015 at 10:02 am
You could meet halfway by doing something like this:
create procedure UberProc (@QueryId varchar(50))
as
if @QueryId = 'First Horrible Idea'
begin
EXEC OneProcedure @PossibleParameter
end
if @queryid = 'Second really bad idea'
begin
...
September 16, 2015 at 8:39 am
Kristen-173977 (9/15/2015)
where cast(logdate as date) ='20150911' -- 429 Rows
sadly this is very inefficient because it is not SARGable (well it might be, but a more complex expression/function used on a...
September 16, 2015 at 8:31 am
Could you give more information?
How about sample data so we can reproduce what you're trying to do?
September 16, 2015 at 6:37 am
Viewing 15 posts - 4,186 through 4,200 (of 8,731 total)