Viewing 15 posts - 4,981 through 4,995 (of 8,731 total)
You made changes to your update statements to merge them into one, but got lost with some logic.
Update Asgnmnt
Set DateAcknow =@ClosedDate,
TimeAcknow=@ClosedTime,
WhoAcknow =@ClosedBy,
DateResolv = @ClosedDate,
TimeResolv = @ClosedTime,
WhoResolv = @ClosedBy
Where CallId =...
April 30, 2015 at 10:29 am
Do you have an index on Time_Created?
DATEDIFF will only execute once for the whole query, so it's probable not your problem.
By the way, you might be wanting to use DATEADD(day,...
April 30, 2015 at 10:14 am
Just to be clear. There are 2 datetime formats that won't be affected by SET DATEFORMAT.
One for dates only: 'yyyymmdd'
And one for datetime values: 'yyyy-mm-ddThh:mi:ss.sss'
Both comply with ISO 8601 formats...
April 30, 2015 at 9:04 am
I'm not sure if it's a better solution but it's an alternative that you could test.
SELECTDISTINCT
[FirstName]
,[LastName]
,[Team]
,[TransactionID]
,FIRST_VALUE([Price]) over (partition by firstname, Transactionid order by price desc) Price
FROM [Test].[dbo].[Team]
April 30, 2015 at 8:40 am
It depends on what you're inserting. Does all the information needs to be available at the same time? You could do inserts on batches to prevent long times during blocking.
If...
April 29, 2015 at 12:44 pm
And just to give a second option.
WITH X(TotalAllCustomersOnFile,TotalConsumersWithValidEmail,TotalConsumersWithValidEmailAndOptedIn) AS
(SELECT * FROM (VALUES ('2,500', '1,750', '1,500')) AS X(TotalAllCustomersOnFile,TotalConsumersWithValidEmail,TotalConsumersWithValidEmailAndOptedIn)
)
SELECT
XY.Audience
,XY.Totals
FROM X
UNPIVOT
( Totals...
April 29, 2015 at 12:31 pm
Aren't you using a staging table to prevent problems?
April 29, 2015 at 12:25 pm
2 things:
If you only have the DELETE and the SET inside your transaction, you don't need an explicit transaction.
If you're going to use explicit transactions, you should use TRY...CATCH blocks...
April 29, 2015 at 11:55 am
DonlSimpson (4/29/2015)
Luis Cazares (4/29/2015)
chgn01 (4/29/2015)
-- Q3
SELECT
*
FROM
#abc a
...
April 29, 2015 at 10:38 am
chgn01 (4/29/2015)
-- Q3
SELECT
*
FROM
#abc a
...
April 29, 2015 at 8:59 am
This is the FOR XML version that Lynn previously commented.
You can find more information in here: http://www.sqlservercentral.com/articles/comma+separated+list/71700/
DECLARE @strSQL Varchar(MAX) = '';
WITH FinalDBleverluser(dbname, username) AS (
Select
dbname,
...
April 28, 2015 at 2:16 pm
r_slot (4/28/2015)
I am not feeling offended, just appreciating your remarks. What you are saying is that I should use varchar(40) instead of nvarchar(max). Normally I do that but in...
April 28, 2015 at 12:52 pm
Lynn, I'm curious.
What where you expecting to do with the Years and Tally CTEs? I'm sure that you included them for your tests, but I'd love to know what...
April 28, 2015 at 12:24 pm
Hi there,
I'm not sure if you're clear on the purpose of stored procedures and functions. If you're used to common programming languages, you'll find out that stored procedures are very...
April 27, 2015 at 11:07 am
As that's a local temp table, couldn't you avoid inserting those rows in the first place? You would save time inserting and deleting.
April 27, 2015 at 10:44 am
Viewing 15 posts - 4,981 through 4,995 (of 8,731 total)