Viewing 15 posts - 2,236 through 2,250 (of 4,087 total)
Unfortunately, I'm not sure that it will work in this case, because the article does calculations on constants, but reworking it for this, would require doing those same calculations on...
October 21, 2016 at 12:10 pm
The problem with ranges is that it requires two range predicates (>=, >, <=, or <), but SQL indexes only efficiently handle one range predicate. There is a way...
October 21, 2016 at 9:28 am
Here is an article on Handling Errors in SQL Server 2012[/url]. It's not clear whether the errors you mention are being produced earlier in the procedure or as part...
October 21, 2016 at 8:20 am
I tweaked the code (added some REVERSEs).
SELECT Address_pk, [Address],
STUFF(a.[Address], ss.search_idx, LEN(ss.search_val), ss.PostalServiceStandardSuffixAbbreviation) AS AddressAbbreviated
FROM [Address] a
OUTER APPLY (
SELECT TOP 1 *, LEN(a.[Address]) - LEN(txt.search_val) - NULLIF(CHARINDEX(REVERSE(txt.search_val), REVERSE(a.[Address])), 0)...
October 20, 2016 at 4:38 pm
This works with the sample data and doesn't produce the second record for Court Place.
SELECT Address_pk, [Address],
STUFF(a.[Address], ss.search_idx, LEN(ss.search_val), ss.PostalServiceStandardSuffixAbbreviation)
FROM [Address] a
OUTER APPLY (
SELECT TOP 1 *, CHARINDEX(txt.search_val, a.[Address])...
October 20, 2016 at 4:21 pm
In some circumstances, the following may perform better than the ROW_NUMBER version.
SELECT t2.*
FROM #table1 t
CROSS APPLY (
SELECT TOP ( t.qty ) *
FROM #table2 t2
WHERE t2.forename = t.name
ORDER BY t2.cost DESC
)...
October 19, 2016 at 3:14 pm
Aquilagb (10/19/2016)
The query is this:
SELECT TOP 1000 [LTStringId]
,[LanguageCode]
,[LTStringType]
,[ElementName]
...
October 19, 2016 at 2:39 pm
If you do decide to convert the dates to VARCHAR rather than BINARY, you need to convert it in a format that will sort correctly, such as YYYY-MM-DD hh:mm:ss.
From several...
October 19, 2016 at 2:12 pm
Budd (10/19/2016)
In regards to my collation usage, and the COALESCE in the WHERE clause you are so right !! This was written Months ago and I didn't...
October 19, 2016 at 1:49 pm
I think this will work without any CTEs. We use Crystal Reports, so I didn't have a ReportServer database available to check things like the collation and data types...
October 19, 2016 at 10:59 am
You should be using the INSERTED virtual table instead of pulling the data from the original table. Every time the trigger is run, you're copying all mails that were...
October 18, 2016 at 12:58 pm
The purpose of the windowed functions is to easily combine detail data with summary data, but you only want the summary data. Just use a simple GROUP BY instead...
October 18, 2016 at 10:53 am
Jeff Moden (10/18/2016)
October 18, 2016 at 10:08 am
Phil Parkin (10/17/2016)
October 17, 2016 at 3:58 pm
In SSMS go to Tools > Options > Environment > Fonts and Colors > Plain Text and set your desired Item Foreground.
Drew
October 17, 2016 at 3:13 pm
Viewing 15 posts - 2,236 through 2,250 (of 4,087 total)