Viewing 15 posts - 31 through 45 (of 5,503 total)
Change the statement for @vPatientFirstName to
SELECT @vPatientFirstName = (RIGHT((@PatientSearch), LEN(@PatientSearch) - charindex(',', (@PatientSearch)) -1))
December 22, 2014 at 12:05 pm
maieras.andrei (12/22/2014)
I mean if @top parameter is passed return the @top rows...
December 22, 2014 at 11:44 am
What did you try so far?
Please show us your current query and where you get stuck.
December 21, 2014 at 4:25 pm
duplicate post. No replies please.
Original post: [url= http://www.sqlservercentral.com/Forums/FindPost1645736.aspx%5Dhere%5B/url%5D%5B/b%5D
December 21, 2014 at 6:57 am
Option 1:
IF @Top IS NULL
BEGIN
SELECT @Top = SUM(pa.rows) RowCnt
FROM sys.partitions pa
WHERE pa.OBJECT_ID =...
December 20, 2014 at 4:26 am
I would add a computed persisted indexed column that holds the "summary" of all values, preferred in a shorter form, e.g. just the first character (either based on the value...
December 20, 2014 at 2:04 am
I'd rather use the APPLY operator:
SELECT Equipment.EquipID, x.EquipmentAmount
FROM Equipment
OUTER APPLY
(
SELECT TOP 1 InvoiceEquipment.Amount AS 'EquipmentAmount'
FROM InvoiceEquipment
WHERE InvoiceEquipment.Type = 'A' AND InvoiceEquipment.EquipID = Equipment.EquipID
ORDER BY InvoiceEquipment.InvoiceDate DESC
)x
From my point of view...
October 23, 2014 at 1:55 pm
spaghettidba (10/21/2014)
Ed Wagner (10/21/2014)
October 21, 2014 at 1:47 pm
Try the following:
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'nationstar University',
@recipients = 'donald@nation.com',
@query = 'select FNAME,LNAME from PED.dbo.TD_EmployeeProfile_FinalV2 where manager_number=100000491' ,
@subject = 'Test email',
@attach_query_result_as_file = 1,
@query_attachment_filename='filename.xls',
@query_result_separator='' -- tab
I'm using this configuration quite frequently with...
October 19, 2014 at 12:07 pm
What do you mean by "distorted"?
Can you provide some sample data that will return "distorted"?
October 19, 2014 at 10:48 am
Step 1: If you need to have the exact number for count(id) for both queries, remove the NOLOCK hint. Search for "NOLOCK dirty reads" for details. Otherwise it's just an...
October 13, 2014 at 11:37 pm
I recommend to assign the result of the query against Huizen in a separate variable and use that result in the query to eliminate the IF .. ELSE control flow.
SELECT...
October 12, 2014 at 7:05 am
@SQLFRNDZ (10/10/2014)
October 11, 2014 at 5:35 pm
Steve Jones - SSC Editor (10/2/2014)
Top priority for the IT team, which manages dev, is reducing SPAM. They are looking at integrating with ASKIMET for rating comments, but I've...
October 4, 2014 at 12:24 pm
The query looks valid.
Please provide table def and sample data together with your expected result based on the sample data provided.
Otherwise we'd just be guessing here...
October 3, 2014 at 3:16 pm
Viewing 15 posts - 31 through 45 (of 5,503 total)