sexta-feira, 22 de maio de 2015

CLR Assemblies in Azure SQL Database

http://ift.tt/1K8GV47

I know a lot of DBAs that are adamant about the exclusion of CLR on their databases. There is no subtlety or nuance or discussion with the development team about the possibilities of a given solution actually running better in compiled CLR code. They just trot out the DBA's favorite word... NO. Prior to v12, that was also Microsoft's stance on Azure SQL Database. Not now.

read more



from SQL Server Pro http://ift.tt/1kCjeYg

segunda-feira, 18 de maio de 2015

SQL Server 2014 Service (Revised) Pack 1 Now Available

http://ift.tt/1HcTNTR

The first service pack for SQL Server 2014 is available and incremented so you can differentiate between the initial (flawed) release and the correct version you should be evaluating for deployment.

read more



from SQL Server Pro http://ift.tt/1kCjeYg

Copying files to AZURE Storage with AZCOPY

AzCopy is a simple cmd app the you can run to copy files to a blob on AZURE.

You can download that here, and a simple script to copy files to azure is:

CD C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy
AzCopy /Source:C:\backup /Dest:https://yourazureblobgoeshere /DestKey:yourkeyhere  /Pattern:*.BAK

Check out my new book about R Language http://www.amazon.com/dp/B00SX6WA06

T-SQL Script to backup all databases

You can never have enough backup options... =)

I used this link to base my script.

DECLARE @name VARCHAR(50) -- your database name   
DECLARE @path VARCHAR(256) -- path to your backup files   
DECLARE @fileName VARCHAR(256) -- filename for backup   
DECLARE @fileDate VARCHAR(20) -- used for file name 
-- specify database backup directory 
SET @path = 'C:\Backup\' 

--in this case, it will combine the file name,date and time 
SELECT @fileDate = CONVERT(VARCHAR(20), Getdate(), 112) 
                   + Replace(CONVERT(VARCHAR(20), Getdate(), 108), ':', '') 

DECLARE db_cursor CURSOR FOR 
  SELECT NAME 
  FROM   master.dbo.sysdatabases 
  WHERE  NAME NOT IN ( 'master', 'model', 'msdb', 'tempdb' ) 

OPEN db_cursor 

FETCH next FROM db_cursor INTO @name 

WHILE @@FETCH_STATUS = 0 
  BEGIN 
      SET @fileName = @path + @name + '_' + @fileDate + '.BAK' 

      BACKUP DATABASE @name TO DISK = @fileName 

      FETCH next FROM db_cursor INTO @name 
  END 

CLOSE db_cursor 

DEALLOCATE db_cursor 

Check out my new book about R Language http://www.amazon.com/dp/B00SX6WA06

AlwaysOn Availability Groups and SQL Server Jobs, Part 24: Synchronizing SSIS Packages

http://ift.tt/1FtyeDI

In my previous post I covered options for adding “If-checks” into SSIS Packages – or SQL Server Maintenance Plans (which are, effectively, specialized SSIS packages). Once you’ve tackled that process, you’ll need to tackle something else when it comes to managing SSIS packages in conjunction with AlwaysOn Availability Groups. Or, more specifically, you’ll actually need to tackle two tasks.

read more



from SQL Server Pro http://ift.tt/1kCjeYg

quinta-feira, 14 de maio de 2015

The Essential Guide to SQL Server 2014 Series: Buffer Pool Extensions

http://ift.tt/1L4O7iG

Learn where to use SQL Server 2014's Buffer Pool Extensions
Learn where to use SQL Server 2014's Buffer Pool Extensions

read more



from SQL Server Pro http://ift.tt/1kCjeYg

Atualização na SUPER QUERY - Update on the SUPER QUERY

Talvez já tenha visto aqui no blog o script da super query, que localiza uma string em todos os campos texto do banco de dados. Fiz algumas adaptações no código quando tive alguns erros.

Maybe you've seen the blog post about the "super query" that locates a string on all text based columns on the database. I made some changes to it, after finding some errors when I re-used.

SELECT * 
FROM   global.unity 

DECLARE @search_string VARCHAR(100), 
        @table_name    SYSNAME, 
        @table_id      INT, 
        @column_name   SYSNAME, 
        @sql_string    VARCHAR(2000) 

SET @search_string = 'clinica' 

DECLARE tables_cur CURSOR FOR 
  SELECT Schema_name(schema_id) + '.' + NAME, 
         object_id 
  FROM   sys.objects 
  WHERE  type = 'U' 

OPEN tables_cur 

FETCH next FROM tables_cur INTO @table_name, @table_id 

WHILE ( @@FETCH_STATUS = 0 ) 
  BEGIN 
      DECLARE columns_cur CURSOR FOR 
        SELECT NAME 
        FROM   sys.columns 
        WHERE  object_id = @table_id 
               AND system_type_id IN ( 167, 175, 231, 239 ) 

      OPEN columns_cur 

      FETCH next FROM columns_cur INTO @column_name 

      WHILE ( @@FETCH_STATUS = 0 ) 
        BEGIN 
            SET @sql_string = 'IF EXISTS (SELECT * FROM ' + @table_name 
                              + ' WHERE ' + @column_name + ' LIKE ''%' 
                              + @search_string + '%'') PRINT ''' + @table_name 
                              + ', ' + @column_name + '''' 

            --PRINT @table_name 
            EXECUTE(@sql_string) 

            FETCH next FROM columns_cur INTO @column_name 
        END 

      CLOSE columns_cur 

      DEALLOCATE columns_cur 

      FETCH next FROM tables_cur INTO @table_name, @table_id 
  END 

CLOSE tables_cur 

DEALLOCATE tables_cur 

 Check out my new book about R Language http://www.amazon.com/dp/B00SX6WA06

quarta-feira, 13 de maio de 2015

Apresentação da Palestra TDC 2015 - Data Analysis com R

Check out my new book about R Language http://www.amazon.com/dp/B00SX6WA06

AlwaysOn Availability Groups and SQL Server Jobs, Part 23: Maintenance Plan Backups and SSIS Packages

http://ift.tt/1AXnBle

In my last post, we took a look at some of the details involved in actually implementing backups against databases being hosted in AlwaysOn Availability Groups. In addition to providing a high-level overview of how sys.fn_hadr_backup_is_preferred_replica() works, I also mentioned that integrating it into backups managed by SQL Server Maintenance Plans isn’t as easy as what you’ll run into with other types of backups.

read more



from SQL Server Pro http://ift.tt/1kCjeYg