Viewing 15 posts - 646 through 660 (of 14,953 total)
You can do something like this:
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
BEGIN TRANSACTION;
DECLARE @NewVal BIGINT = (SELECT MAX(member_id) FROM dbo.member WITH (TABLOCKX))+1;
INSERT INTO dbo.Member (member_id, column list)
VALUES (@NewVal, @Params);
COMMIT;
Do it in one...
October 25, 2012 at 9:25 am
It sounds good in theory, but I suggest trying it with a proof-of-concept test. Should be easy enough to test on a simple VM. Then you'll know for...
October 25, 2012 at 9:13 am
So far as I know, Group By will require a sort, since it has to put the rows together to do whatever aggregation you're asking for. You might be...
October 25, 2012 at 9:09 am
Nope. SQL doesn't work that way.
Look into sp_executeSQL for a better way to do this than EXEC(), but you'll need to use dynamic SQL for that kind of thing.
October 25, 2012 at 9:03 am
A disaster is an emergency you didn't anticipate.
Good editorial. Anticipating and preventing problems is key to good DBA work.
October 25, 2012 at 8:33 am
Another possible solution:
USE ProofOfConcept;
SET NOCOUNT ON;
IF OBJECT_ID(N'tempdb..#T') IS NOT NULL
DROP TABLE #T;
CREATE TABLE #T
(ID INT IDENTITY
...
October 24, 2012 at 12:37 pm
SELECT CAST(SUBSTRING(Col, 5, 6) + ',' + RIGHT(Col, 4) + ' ' + SUBSTRING(Col, 12, 8) AS DATETIME)
FROM
(VALUES
('Tue Jun 12 21:00:53 EDT 2012'),
('Tue Jun 12 22:20:51 BST 2012'),
('Wed...
October 24, 2012 at 11:33 am
Have you asked for clarification from your employer as to what exactly they mean by the differentiation?
Explain that "DBA", even with adjectives like "Production" or "Project/Development", is recognized as being...
October 24, 2012 at 10:20 am
Here's what MSDN says:
Execution context identifier (ECID). The execution context ID of a given thread associated with a specific SPID.
ECID = {0,1,2,3, ...n}, where 0 always represents the main or...
October 24, 2012 at 10:08 am
Nah. I wouldn't expect a lot of disagreement on this one. Indexing a 1-page table for something other than data integrity purposes, would be silly.
October 24, 2012 at 10:01 am
Insert it into a staging table first.
Is there anything in the file that identifies the rows uniquely? Like a row number or anything like that?
October 24, 2012 at 9:57 am
There's a fair amount to consider when consolidating database servers. The two most important things are resource availability, and support issues.
On resource availability, it's pretty obvious. If you...
October 24, 2012 at 9:55 am
I may have missed something, but do all the Full backups have to be on the same day?
You mention fortnightly Full backups. You can pile up a couple of...
October 24, 2012 at 9:44 am
The index suggestions do that kind of thing a lot.
Go with the combined index, not two separate indexes that are so similar to each other.
October 24, 2012 at 9:35 am
For small enough tables, SQL Server will ignore indexes anyway, when creating execution plans, even if you do have them.
If the table ends up growing enough to need one, it...
October 24, 2012 at 9:33 am
Viewing 15 posts - 646 through 660 (of 14,953 total)