Viewing 15 posts - 6,481 through 6,495 (of 7,608 total)
Do you really need only the TestId column in the result set? You don't all the columns?
August 7, 2013 at 4:06 pm
If you start a single transaction before the loop begins (or, more awkwardly, only on the first loop), then any rollback will rollback all activity for that transaction. If...
August 7, 2013 at 3:59 pm
CTEs do not do that, from what I've seen looking at query plans. Instead, SQL re-runs the entire query every time you refer to the CTE.
For the most performance...
August 7, 2013 at 1:36 pm
Yes, it's possible; I've done it several times. In fact, you don't even have to pass in the db name -- the proc will automatically run in the current...
August 7, 2013 at 1:31 pm
code goes on to split the logic path based on @RecordCount = 0 vs. @RecordCount > 0.
You shouldn't do a full count of the table for that either, btw; use...
August 6, 2013 at 2:54 pm
mister.magoo (8/5/2013)
Amy.G (8/5/2013)
SELECT column1, column2
INTO NewTable
FROM OldTable
method. Is there a way of creating a table in this manner and saying if the columns...
August 6, 2013 at 2:45 pm
Agreed, a trigger is not at all the best place for this type of thing.
RECONFIGURE is not allowed to be part of a transaction. A modification trigger is inherently...
August 6, 2013 at 2:38 pm
The function below will return the job_id when you pass in the string with the "Job 0x...." (I've since discovered a perhaps better way, but can't find that code right...
August 2, 2013 at 2:29 pm
First, you have to be careful with terminology in SQL Server -- a login and a user are not the same thing.
The login is at the server level, the user...
August 2, 2013 at 2:22 pm
Yeah, that's crazy.
Is there any way you can "spoof" the database id so it can be something else in the real server but report back to the software what it...
August 2, 2013 at 2:13 pm
Luis Cazares (8/1/2013)
http://www.sqlservercentral.com/articles/T-SQL/88244/
SELECT AttribID
FROM MyTable
WHERE FormatID IN (12,15)
GROUP BY AttribID
HAVING COUNT(DISTINCT FormatID ) = 2
EXCEPT
SELECT...
August 1, 2013 at 3:21 pm
Technically it should be:
LEFT(myString, CHARINDEX(' ', myString + ' ') - 1)
unless you want a trailing space in the result :-).
Adding the "+ ' '" will cause the code to...
August 1, 2013 at 3:09 pm
You can use the general calc shown below to get the nearest day of any day:
SELECT
date,
DATEADD(DAY, DATEDIFF(DAY, '19000101', date) / 7 *...
July 31, 2013 at 3:41 pm
FILLFACTOR can have a major impact on performance, depending on the table and the data usage patterns.
However, a FILLFACTOR of "80" is not necessarily good or bad in and of...
July 29, 2013 at 2:43 pm
webrunner (7/25/2013)
By "prevents the actual statement from running" do you mean the original DELETE statement? And then any code in the trigger after the ROLLBACK does get run? That...
July 25, 2013 at 10:58 am
Viewing 15 posts - 6,481 through 6,495 (of 7,608 total)