This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head /> | |
<body class="product-list"> | |
<div class="product">Product Details: | |
<span class="locale">en-us</span> | |
<span class="name">Help Library</span> | |
<span class="description" /> | |
<img class="icon" src="../../content/image/ic101471" alt="Help 3 Icon" /> | |
<a class="product-link" href="product1.html">Product Group</a> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- This is captured from SSMS (shrink file dialog) | |
use [yourDatabase]; | |
select s.Name, CAST(CASE s.type WHEN 2 THEN s.size * CONVERT(float,8) | |
ELSE dfs.allocated_extent_page_count*convert(float,8) END AS float) AS [UsedSpaceKB] | |
,CASE s.type WHEN 2 THEN 0 | |
ELSE 5120 - dfs.allocated_extent_page_count*convert(float,8) END AS [AvailableSpaceKB] | |
from sys.filegroups AS g | |
inner join sys.database_files AS s on ((s.type = 2 or s.type = 0) and (s.drop_lsn IS NULL)) AND (s.data_space_id=g.data_space_id) | |
left outer join sys.dm_db_file_space_usage as dfs ON dfs.database_id = db_id() AND dfs.file_id = s.file_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER function [dbo].[FN_ObtenerArbolEmpresa](@empresaID int) | |
RETURNS TABLE | |
AS | |
RETURN | |
WITH temp | |
AS ( | |
-- anchor | |
SELECT id_empresa_hijo, id_empresa_padre | |
FROM empresa_x_empresa with(nolock) | |
WHERE id_empresa_padre = @empresaID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE master; | |
GO | |
IF DB_ID('TestTlogBackup') IS NOT NULL | |
BEGIN | |
ALTER DATABASE TestTlogBackup SET SINGLE_USER WITH ROLLBACK IMMEDIATE; | |
DROP DATABASE TestTlogBackup; | |
END | |
GO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"> | |
<asmv3:application> | |
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"> | |
<dpiAware>True</dpiAware> | |
</asmv3:windowsSettings> | |
</asmv3:application> | |
<dependency> | |
<dependentAssembly> | |
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<opml version="1.0"> | |
<head> | |
<title>Feeds subscribed in ForumSurfer</title> | |
</head> | |
<body> | |
<outline text="http://dba.stackexchange.com/" title="dba.stackexchange.com"> | |
<outline type="rss" text="Active questions tagged sql-server or sql-server-2008 or sql-server-2012 or sql-server-2008-r2 or sql-server-2014 - Database Administrators Stack Exchange" title="Active questions tagged sql-server or sql-server-2008 or sql-server-2012 or sql-server-2008-r2 or sql-server-2014 - Database Administrators Stack Exchange" xmlUrl="http://dba.stackexchange.com/feeds/tag/sql-server OR sql-server-2008 OR sql-server-2012 OR sql-server-2008-r2 OR sql-server-2014" /> | |
</outline> | |
<outline text="http://www.sqlservercentral.com/" title="www.sqlservercentral.com"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- http://spaghettidba.com/2011/09/09/a-better-sp_msforeachdb/ | |
-- | |
-- Author: Gianluca Sartori @spaghettidba | |
-- Date: 2011/09/09 | |
-- | |
-- Description: Executes a statement against multiple databases | |
-- Parameters: | |
-- @statement: The statement to execute | |
-- @replacechar: The character to replace with the database name | |
-- @name_pattern: The pattern to select the databases |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- http://spaghettidba.com/2011/11/28/email-alert-dbcc-checkdb/ | |
-- You have a TOOLS database, don't you? | |
-- If not, create it: you'll thank me later. | |
USE TOOLS; | |
GO | |
IF NOT EXISTS( SELECT 1 FROM sys.schemas WHERE name = 'maint') | |
EXEC('CREATE SCHEMA maint'); | |
GO | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- http://spaghettidba.com/2011/07/08/my-stored-procedure-code-template/ | |
-- ============================================= | |
-- Author: <Author,,Name> | |
-- Create date: <Create Date,,> | |
-- Description: <Description,,> | |
-- ============================================= | |
CREATE PROCEDURE <ProcedureName, sysname, > | |
AS | |
BEGIN | |
SET NOCOUNT ON; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- http://spaghettidba.com/2012/03/15/how-to-eat-a-sql-elephant/ | |
-- ============================================= | |
-- Author: Gianluca Sartori - spaghettidba | |
-- Create date: 2012-03-14 | |
-- Description: Runs two T-SQL statements and | |
-- compares the results | |
-- ============================================= | |
-- Drop temporary tables | |
IF OBJECT_ID('tempdb..#original') IS NOT NULL |
OlderNewer