Category Archives: Microsoft

Linux SQL Server Utils

FreeTDS

FreeTDS is a set of libraries for Unix and Linux that allows your programs to natively talk to Microsoft SQL Server and Sybase databases.

Technically speaking, FreeTDS is an open source implementation of the TDS (Tabular Data Stream) protocol used by these databases for their own clients. It supports many different flavors of the protocol and three APIs to access it. Additionally FreeTDS works with other software such as Perl and PHP, providing access from those languages as well.

If you are looking for a Java implementation, we refer you to the jTDS project on SourceForge.

FreeTDS has many possible uses. It has been used by Unix/Linux webservers to present data stored in SQL Server to the web, to port SQL Server database code from NT to Unix, to import data into SQL Server from a Unix source, and to provide database access on platforms (such as realtime systems) that have no native drivers.

The FreeTDS C libraries are available under the terms of the GNU LGPL license, consult the COPYING.LIB file in the distribution for details.

Homepage

Microsoft Utils

User Profile Hive Cleanup

O serviço User Profile Hive Cleanup ajuda a assegurar que as sessões de usuário serão encerradas completamente quando o usuário fizer logoff. Os aplicativos e os processos do sistema mantêm, ocasionalmente, conexões com chaves do Registro no perfil do usuário depois que o usuário faz logoff. Isso faz com que a sessão do usuário não seja encerrada completamente, causando problemas durante a utilização de perfis móveis de usuários, em um ambiente de servidor, ou de perfis bloqueados implementados através do Shared Computer Toolkit para Windows XP.
read more »

SQL Server

DBCC SHRINKFILE

Como usar o comando DBCC SHRINKFILE para reduzir o tamanho do log de transacções de uma base de dados SQL Server 2005

In SQL Server 2005, a shrink operation (DBCC SHRINKFILE) tries to shrink the specified transaction log file to the requested size immediately. To shrink the transaction log file manually under the full recovery model, first back up the transaction log file. Then, use the DBCC SHRINKFILE statement to shrink the transaction log file.

Typically, shrinking the transaction log file in SQL Server 2005 is faster than shrinking the transaction log file in SQL Server 2000. The reason is that the SQL Server 2005 log manager creates or reuses inactive virtual log files by following the physical disk storage order. Therefore, the inactive part of the transaction log file is usually at the end of the file.

For example, the transaction log file may have 100 virtual log files, and only 2 virtual log files are used. SQL Server 2000 may store the first used virtual log file at the start of the transaction log file and the second used virtual log file in the middle of the transaction log file. To shrink the transaction log file to only 2 virtual log files, SQL Server fills the remaining part of the second virtual log file by using dummy log entries. SQL Server moves the start of the logical log to the next available virtual log file that is specified by the log manager. The log manager may create a virtual log file in the middle of the transaction log file just ahead of the last active virtual log file. In that case, you have to use multiple log backup operations and multiple shrink operations to successfully shrink the transaction log file to 2 virtual log files. In the worst case of this example, you may have to use 50 log backup operations and 50 shrink operations to successfully shrink the transaction log file to 2 virtual log files.

However, in SQL Server 2005, you can perform one DBCC SHRINKFILE statement to shrink the transaction log file immediately to 2 virtual log files. You can do this because the SQL Server 2005 log manager creates 2 virtual log files by following the physical disk storage order. Both of these virtual log files are at the start of the transaction log file.

When you try to shrink a transaction log file that has little free space in SQL Server 2005, you may have to perform an additional log backup operation. The additional log backup operation truncates the transaction log file to a smaller size. This log backup operation is in addition to the three steps that you perform to shrink the transaction log file in SQL Server 2000. For more information, see the Microsoft Knowledge Base article that is mentioned in the “Introduction” section. To shrink a transaction log file that has little free space in SQL Server 2005, follow these steps:

1. Back up the transaction log file to make most of the active virtual log files inactive. Therefore, the inactive virtual log files can be removed in a later step. To do this, run a Transact-SQL statement that is similar to the following Transact-SQL statement. BACKUP LOG TO DISK = ‘
Note In this statement, is a placeholder for the name of the database that you are backing up. In this statement, is a placeholder for the full path of the backup file.

For example, run the following Transact-SQL statement. BACKUP LOG TestDB TO DISK=’C:\TestDB1.bak’
Â
2. Shrink the transaction log file. To do this, run a Transact-SQL statement that is similar to the following Transact-SQL statement. DBCC SHRINKFILE (, ) WITH NO_INFOMSGS
Note In this statement, is a placeholder for the name of the transaction log file. In this statement, is a placeholder for the target size that you want the transaction log file to be. The target size must be reasonable. For example, you cannot shrink the transaction log file to a size that is less than 2 virtual log files.

3. If the DBCC SHRINKFILE statement does not shrink the transaction log file to the target size, run the BACKUP LOG statement that is mentioned in step 1 to make more of the virtual log files inactive.

4. Run the DBCC SHRINKFILE statement that is mentioned in step 2. After this operation, the transaction log file should be similar to the target size.
In summary, the log manager’s algorithm for picking up the next virtual log file changed in SQL Server 2005. Therefore, shrinking the transaction log file in SQL Server 2005 may differ from shrinking the transaction log file in SQL Server 2000:

  • If a log file has lots of free space, shrinking the transaction log file in SQL Server 2005 is faster than shrinking the transaction log file in SQL Server 2000.
  • If a log file has no free space, shrinking the transaction log file in SQL Server 2005 is the same as shrinking the transaction log file in SQL Server 2000.
  • If a log file has little free space, you may have to perform an additional log backup operation in SQL Server 2005 than you have to perform in SQL Server 2000.

REFERENCES
For more information, see the following topics in SQL Server 2005 Books Online:• Shrinking the transaction log
• DBCC SHRINKFILE (Transact-SQL)
• Truncating the transaction log

 Source: http://support.microsoft.com/kb/907511/en-us

ASP.Net 2.0

System.Net.Mail

 Complete FAQ for the System.Net.Mail namespace found in .NET 2.0

 ‘create the mail message
Dim mail As New MailMessage()

‘set the addresses
mail.From = New MailAddress(“me@mycompany.com”)
mail.To.Add(“you@yourcompany.com”)

‘set the content
mail.Subject = “This is an email”
mail.Body = “this is a sample body with html in it. This is bold This is blue
mail.IsBodyHtml = True

‘send the message
Dim smtp As New SmtpClient(“127.0.0.1”)
smtp.Send(mail)

 Fonte: http://www.systemnetmail.com/faq/3.1.2.aspx

ASP.Net 2.0

Friendly Error Page App_Offline.htm

n ASP.NET 2.0, while you’re in the process of updating your site, you can expose a friendly error page by including a file called app_offline.htm in your site’s root. If this file exists, all requests to the site will be redirected to this page. The only way to get around this is to delete the file. The usage scenario for this is for site maintenance, and it can be easily included as part of a deployment script, where this is the first file added and the last file deleted during the deployment. You can read more about this feature here.

Excerpt:

To take a Web application offline before deployment

  1. Create a file called App_offline.htm and place it in the root of your target Web site.
  2. Put a friendly message in the App_offline.htm file to let clients know that you are updating the site.
    While the App_offline.htm file exists, any request to the Web site will redirect to the file.

    NoteImportant
    Remember to remove the App_offline.htm file after you are finished copying files.

Fonte: http://aspadvice.com/blogs/ssmith/

SQL Server Uncategorized

Mudar o ownership de um objecto

sp_changeobjectowner

Fonte: http://msdn2.microsoft.com/en-us/library/Aa259618(SQL.80).aspx

read more »

Exchange Networking

Backup do Exchange 2000/2003 server

One of the most important tasks for an Exchange administrator is the regular, day-by-day, backing up of all the Exchange databases. This can be easily accomplished by use of the built-in NTBACKUP.EXE software found on your Exchange 2000/2003 server.

Some administrators might choose to your 3rd-Party backup tools, such as:

However, as stated above, you do NOT need to buy expensive 3rd-Party tools just to backup your Exchange server.

Generally, you can backup Exchange 2000/2003 in 2 ways: Online backup and Offline backup.

Source: http://www.petri.co.il/backup_exchange_2000_2003_with_ntbackup.htm

read more »

Exchange Networking

Outlook Web Access

Utilize o Microsoft Outlook Web Access para obter e trabalhar com dados arquivados num computador com o Microsoft Exchange Server, utilizando um browser da Internet num computador com base no UNIX, no Macintosh ou no Microsoft Windows. Este fornece acesso público através da Web, a pastas públicas do Microsoft Exchange Server e ao livro de endereços. Pode iniciar a sessão na sua conta pessoal para ler correio electrónico privado, enviar mensagens, criar contactos e agendar compromissos.

Com o Outlook Web Access para o Microsoft Exchange Server, pode partilhar informações com outros utilizadores da Internet em qualquer lugar e a qualquer hora. Utilizando as funções do Outlook Web Access, pode processar e organizar informações, assim como optimizar tarefas de comunicação relacionadas com o seu trabalho diário.
read more »

.NET

XAML – eXtensible Application Markup Language

XAML (pronuncia-se “zamel”), (sigla de eXtensible Application Markup Language) é a principal linguagem de interface da Microsoft para o Windows Vista usada para criar interfaces de usuário de forma simples e rápida. Tende a ser um competidor direto do propalado OpenLaszlo do mundo Java.

XAML é uma linguagem declarativa baseada no XML.

Numa típica forma de uso, os ficheiros XML serão produzidos por uma ferramenta de desenho visual, tal como o Visual Studio .NET. O XML resultante será geralmente compilado, apesar de também ser possível a interpretação em tempo de execução.

read more »

.NET News

Microsoft Silverlight

Microsoft® Silverlightâ�¢Microsoft® Silverlight™ is a cross-browser, cross-platform plug-in for delivering the next generation of .NET based media experiences and rich interactive applications for the Web. Silverlight offers a flexible programming model that supports AJAX, VB, C#, Python, and Ruby, and integrates with existing Web applications. Silverlight supports fast, cost-effective delivery of high-quality video to all major browsers running on the Mac OS or Windows.

Links:

http://silverlight.net/

http://www.microsoft.com/silverlight/default01.aspx