Viewing 15 posts - 5,296 through 5,310 (of 10,144 total)
Thanks for the sample data. Try this:
-- Sample data
DROP TABLE [dbo].[MisIcg_InteractionChecks]
CREATE TABLE [dbo].[MisIcg_InteractionChecks](
[SourceID] [varchar](3) NOT NULL,
[MisIcgID] [varchar](30) NOT NULL,
[InteractionID] [varchar](25) NOT NULL,
[RowUpdateDateTime] [datetime] NULL,
[InteractionCheckMedication] [varchar](2)...
January 25, 2013 at 8:17 am
purushottam2 (1/25/2013)
Then for other filters...
January 25, 2013 at 7:36 am
purushottam2 (1/25/2013)
Hi Grant,Thanks for your reply,
Surely i will remove coalesce. Should i remove nolock, does it also affect my performance. Performance is our first priority.
Most of the filtration and...
January 25, 2013 at 7:17 am
Have a look at the article linked in my sig (please read this) for ddl and dml recipes. This will be much easier if folks have readily-consumable data to work...
January 25, 2013 at 6:18 am
Except for Sergiy's first query, the plans are very similar and are costed exactly equal. I'd guess that my APPLY version with two extra operators (Compute scalar and TOP, each...
January 25, 2013 at 1:11 am
Here's another method:
-- Parameters
DECLARE @String VARCHAR(8000)
SET @String = 'Reverse'
-- Local Variables
DECLARE @OutputString VARCHAR(8000); SET @OutputString = '';
DECLARE @StrLen INT; SET @StrLen = DATALENGTH(@String);
DECLARE @MappingTable TABLE (n INT PRIMARY KEY CLUSTERED);...
January 24, 2013 at 8:47 am
SQL006 (1/23/2013)
thanks chris for the replycan you tell me the use of SELECT TOP 1 n=1 ....i never use this
SELECT
p.ProductID,
Relation = CASE x.n WHEN 1 THEN 'Linked' ELSE...
January 24, 2013 at 1:04 am
SELECT
p.ProductID,
Relation = CASE x.n WHEN 1 THEN 'Linked' ELSE 'Not Linked' END
FROM @product p
OUTER APPLY (
SELECT TOP 1 n=1
FROM @ProductRelation r
WHERE p.ProductID IN (r.FirstProductID, r.SecondProductID)
) x
ORDER...
January 23, 2013 at 6:50 am
Have you tried figuring out the filters and applying to the inner query? Something like this:
DECLARE @YEAR INT, @MONTH INT
SELECT @YEAR = 2005, @MONTH = 6
DECLARE @StartDate DATETIME, @EndDate DATETIME
SET...
January 23, 2013 at 6:38 am
dwain.c (1/22/2013)
Allow me to enter a new dog in this race! Perhaps you'll find the new approach amusing. I call it the Nested Replace by Quirky Update (NRxQU...
January 23, 2013 at 5:06 am
Have a look at the code I used for the sample data, if there's anything you are unsure of then ask. Note that the sample data tables I created for...
January 22, 2013 at 7:26 am
ncurran217 (1/22/2013)
Also, to get the numbers I posted as a result from my query I would have to post data with 100k rows.
Here's how to create some sample data -...
January 22, 2013 at 7:08 am
Welsh Corgi (1/22/2013)
SELECT
CASE WHEN LEFT(Customer.StartDate, 2) = '98' THEN substring(convert(varchar(20),Customer.StartDate), 3, 2)
...
January 22, 2013 at 6:47 am
ncurran217 (1/22/2013)
Ok I did not know I needed to post any data. ..
No worries, you're new here. Have a read of this article[/url], it will help you formulate some test...
January 22, 2013 at 6:42 am
dwain.c (1/22/2013)
Uh, just asking here but wouldn't it make sense to vary the strings and the replacements?Or did I miss something?
Not often you miss something Dwain! You're right of course....
January 22, 2013 at 6:23 am
Viewing 15 posts - 5,296 through 5,310 (of 10,144 total)