Viewing 15 posts - 6,601 through 6,615 (of 6,751 total)
I would do a query with:
SELECT
COUNT(*) AS [Total],
COUNT(DISTINCT column_1) AS [Column_1],
COUNT(DISTINCT column_2) AS [Column_2],
...
March 28, 2012 at 1:06 pm
To be safe, I would move everything.
If/as you feel a particular object is not needed, rename it (or move to a different schema/db, if you prefer). See if any...
March 19, 2012 at 3:50 pm
If you can, for now I'd just move the remaining tables temporarily to another filegroup, completely emptying the original fg, then shrink it. Finally move the remaining tables back...
March 16, 2012 at 1:51 pm
Did you deletes of lots of table data in some cases rather than table drops?
At any rate, just to be sure, I would run sys.dm_db_index_physical_stats () on remaining tables to...
March 16, 2012 at 12:48 pm
The setup and maintenance on full-text indexes is not trivial.
It's not a problem for a full-time DBA, but if you're not a DBA, it can be a tricky thing, especially...
March 15, 2012 at 1:37 pm
I wouldn't automatically add a leading %. That forces a full scan which is often unnecessary if the requestor knows what the first name starts with.
Instead, allow the user...
March 15, 2012 at 12:52 pm
You should be able to update all rows at once, like so:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[tr_TaxID]
ON [dbo].[Item]
after INSERT, UPDATE AS
UPDATE [dbo].[Item]
SET
taxid...
March 12, 2012 at 8:55 am
I would just use a CASE statement.
But you raised a good point I overlooked.
If you do need only current year's data, I should have added a WHERE clause with a...
March 8, 2012 at 3:23 pm
SELECT
name,
SUM(CASE WHEN date_column >= CAST(YEAR(GETDATE()) AS char(4)) + '0101'
THEN total ELSE 0...
March 8, 2012 at 2:34 pm
Not 100% sure, don't think it's a lot longer. Neither one is very fast really rebuilding 🙂 .
February 29, 2012 at 8:15 am
For (almost) pure reads, as O/S and SQL pgms are, RAID5 should be faster than RAID10, with the same number of spindles for each RAID.
So, I'd say use...
February 28, 2012 at 4:18 pm
An UPDATE statement will always cause some type of lock(s) on the table. SQL must do locks to insure the integrity of the UPDATEs.
Depending on the number of rows...
February 22, 2012 at 1:47 pm
If I understand correctly:
((COALESCE([prefix]+'-'), '')+right('0000'+COALESCE(convert([varchar],[numeric],(0)), ''),(4)))
is persisted =yes
February 22, 2012 at 1:39 pm
For XML data, you are very likely better off specifying XML as the data type rather than varchar(max), since SQL optimizes XML storage.
February 20, 2012 at 2:13 pm
When did SQL Server start doing these "auto sorts" for clus indexes?
February 16, 2012 at 8:12 am
Viewing 15 posts - 6,601 through 6,615 (of 6,751 total)