Viewing 15 posts - 46 through 60 (of 65 total)
SELECT DISTINCT
ID =lot.value
, SiteID = DENSE_RANK()OVER(ORDER BY Country DESC)
,Country
FROM SiteMatches
CROSS APPLY (
VALUES('RetainedRID', RetainedRID)
, ('DroppedRID', DroppedRidd )) Lot(name,value)
May 7, 2013 at 7:42 pm
ok so you are trying to execute stored proc inside join. Also the IF statement should be outside.
If you can get the date from this stored proc and then...
May 4, 2013 at 1:41 am
WOW this is great!!
HAPPY SATURDAY! Thank you for your time I appreciate it.
Thanks again,
Brad
April 20, 2013 at 11:41 am
Forgot to include cache
Also checking statistics (SET STATISTICS IO ON) and clearing cache [/b]before executing each stored proc.
--Do not run in PROD!!!
DBCC FREEPROCCACHE
DBBC DROPCLEANBUFFERS
March 13, 2013 at 9:07 pm
In this case I would have both the Dynamic SQL stored proc and non dynamic stored proc.
Compare both the execution plans. Also checking statistics (SET STATISTICS IO ON) and clearing...
March 13, 2013 at 9:02 pm
Hey Alan,
I am basically guessing here what data looks like. If you could provide more detail you would be able to get additional expert advice.
If your PK...
March 6, 2013 at 9:30 pm
I would create temp table or CTE and then use that to do insert update. The "ID" field is your PK of the table.
IF OBJECT_ID('tempdb..#Source','u') IS NOT NULL
DROP TABLE...
March 6, 2013 at 7:32 pm
I attended a training by Itzik Ben Gan and we found that this technique worked the best for our data set.
-- Stored Procedure GetOrders,
-- Using Dynamic SQL
ALTER PROC dbo.GetOrders
...
February 19, 2013 at 7:21 pm
Some ideas to help.
For Each Loop Container and through folder of sql scripts picking up the sql file name and using this as a variable. Use a Command Line task...
February 7, 2013 at 7:45 pm
Can you try and use the inserted table?
SELECT email, customerId
FROM Inserted
WHERE inserted.VatRegistrationID = '' and inserted..email <> ''
January 14, 2013 at 8:03 pm
I am not sure what is going on with your trigger.
For debugging dynamic sql, I usually will add a PRINT @Sql statement above the EXEC @SQL statement and comment out...
January 14, 2013 at 7:33 pm
A possible solution. I am assuming every month is 31 days but an idea to help you get started.
WITH TenDates
AS
(
SELECT
s_date
, DayAdd =
CASE WHEN DAY(s_date) <=...
April 16, 2012 at 8:09 pm
This above option will not work as DocType is not in Encounters. Using not exists is another option I was shooting for.
SELECT e.EncounterNo, e.EncntrStartDate, d.DocType, m.MedRecNo, ee.EnrolleeName
FROM Encounters...
March 15, 2012 at 7:51 pm
How about this option?
SELECT e.EncounterNo, e.EncntrStartDate, d.DocType, m.MedRecNo, ee.EnrolleeName
FROM Encounters e (NOLOCK)
JOIN DocsOwners do (NOLOCK) ON e.EncntrOwnerId = do.OwnerId
JOIN Documents d (NOLOCK) ON do.DocId = d.DocId
JOIN MedicalRecords AS m (NOLOCK)...
March 15, 2012 at 7:29 pm
Thank you very much Right There. Your solution does work for the data set I provided, however I added two additional records that cause this to not work. I ended...
June 22, 2011 at 8:40 am
Viewing 15 posts - 46 through 60 (of 65 total)