Viewing 15 posts - 6,481 through 6,495 (of 7,600 total)
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
Eugene Elutin (7/25/2013)
webrunner (7/25/2013)
July 25, 2013 at 9:40 am
Easy enough to demonstrate that:
USE tempdb --you can use a "real" db if you prefer
GO
IF EXISTS(SELECT 1 FROM sys.tables WHERE name = 'table1' AND schema_id = 1)
...
July 25, 2013 at 8:29 am
Eugene Elutin (7/25/2013)
Alexander Suprun (7/24/2013)
Eugene Elutin (7/24/2013)
RAISERROR cause transaction to rollback, so your log insert is rollbacked as well as delete...
It's so untrue...
RAISERROR has nothing to do with the transaction.
It's...
July 25, 2013 at 8:27 am
webrunner (7/24/2013)
Alexander Suprun (7/24/2013)
July 24, 2013 at 5:22 pm
You don't need to explicitly cast it in this case, because integer has a higher precedence than varchar, so SQL will implicitly force the varchar to integer.
You should check the...
July 22, 2013 at 4:30 pm
From a performance standpoint, a single table can work just as well as partitioning in many cases as long as you have the correct clustered index. But if you've...
July 22, 2013 at 3:00 pm
This is why cursors exist. Just use a cursor, unless you have an extraordinarily high volume of emails to send.
CREATE TABLE [dbo].[TestData](
[text] NULL, --??...
July 22, 2013 at 2:25 pm
You'll get better performance from clustering on the date -- as the only or first key column -- if date/date range is specified in the queries.
I believe a...
July 22, 2013 at 2:11 pm
Viewing 15 posts - 6,481 through 6,495 (of 7,600 total)