New answers tagged

-3

SELECT name FROM sys.all_objects WHERE Object_definition(object_id) LIKE '%text%' ORDER BY name


1

As already suggested, you cannot achieve this using backup/restore. You can also not achieve it using log shipping. I would look at using transactional replication perhaps from views, which would define the 60 to 90 day window. Be aware (or make your stakeholders aware) that replication is not free and comes with its own (usually small) performance ...


-1

Both indexes are the basic terms in sql. A clustered index requires no separate storage than the table storage. It forces the rows to be stored sorted on the index key. A non-clustered index requires separate storage than the table storage to store the index information.


2

The number of records in TransmittedManifests table is much less than the number of records in LWTest. In such scenario, good solution is to use NOT EXISTS approach (as in Query 2) to reduce the number of actual rows. Refer Joins without JOIN - Rob Farley Now, Martin Smith’s comment helped me demystifying the count per execution (estimate) and total count ...


1

Yeah, for something like this, Minion Backup is actually going to be a much better solution. It's not only Mirror aware, but it's also AG, and log shipping aware. You can do many things with it HA/DR wise that you can't do with other solutions. For example, you can have it write to different locations when it's in different data centers and you can have it ...


4

I would suggest to use Ola's backup solution (and Index maintenance solution as well). This is a well applauded solution that is smart enough to work with mirroring (in your case). Maintenance plans are not bad, but when your environment grows, the limited flexibility and functionality that maintenance plans provide wont be sufficient. For e.g Maintenance ...


3

I'm not really sure what you are asking but you can tell if a database is online by looking in sys.databases at the state_desc column. Possible values are: ONLINE RESTORING RECOVERING (SQL Server 2008 through SQL Server 2016) RECOVERY_PENDING (SQL Server 2008 through SQL Server 2016) SUSPECT EMERGENCY (SQL Server 2008 through SQL Server 2016) OFFLINE ...


2

Your query is more complicated that it needs to be. DISTINCT is redundant there and the internal subquery is not needed. You could rewrite as: DELETE T FROM Table1 AS T WHERE T.ColA IN ( SELECT ColA FROM Table1 WHERE ColC % 2 = 0 AND OrderByCol = 1 ) ;


3

If this was SQL Server 2012 or later version, you could use the FIRST_VALUE window function: WITH cte AS ( SELECT FirstColC = FIRST_VALUE(ColC) OVER (PARTITION BY ColA ORDER BY ColB ASC) FROM dbo.Table1 ) DELETE FROM cte WHERE FirstColC % 2 = 0 ; In SQL Server 2005 FIRST_VALUE can be replaced with a correlated TOP (1) + ORDER ...


1

SQL Server version 2016 will solve this issue once and for all. For earlier versions a CLR solution is probably easiest. Or for a specific DST rule (like US only), a T-SQL function can be relatively simple. However, I think a generic T-SQL solution might be possible. As long as xp_regread works, try this: CREATE TABLE #tztable (Value varchar(50), Data ...



Top 50 recent answers are included