Vale a pena fazer em casa. Segue o link pessoal.
http://tudogostoso.me/r77084.html
17 March 2015
Receita de Bolo Formigueiro
10 October 2011
Know how many records there is inside a table using Sql without using COUNT
5 October 2011
Adding read permission for groups and users with files
If you wanna put some permissions for groups or users who doesn’t need to access certain files, you can use the class FileSystemAccessRule.
Let see the example:
using System;
using System.IO;
using System.Security.AccessControl;
namespace FileSystemExample
{
class FileExample
{
public static void Main()
{
try
{
string fileName = "test.xml";
Console.WriteLine("Adding access control entry for "
+ fileName);
// Add the access control entry to the file.
AddFileSecurity(fileName, @"DomainName\AccountName",
FileSystemRights.ReadData, AccessControlType.Allow);
Console.WriteLine("Removing access control entry from "
+ fileName);
// Remove the access control entry from the file.
RemoveFileSecurity(fileName, @"DomainName\AccountName",
FileSystemRights.ReadData, AccessControlType.Allow);
Console.WriteLine("Done.");
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
// Adds an ACL entry on the specified file for the specified account.
public static void AddFileSecurity(string fileName, string account,
FileSystemRights rights, AccessControlType controlType)
{
// Get a FileSecurity object that represents the
// current security settings.
FileSecurity fSecurity = File.GetAccessControl(fileName);
// Add the FileSystemAccessRule to the security settings.
fSecurity.AddAccessRule(new FileSystemAccessRule(account,
rights, controlType));
// Set the new access settings.
File.SetAccessControl(fileName, fSecurity);
}
// Removes an ACL entry on the specified file for the specified account.
public static void RemoveFileSecurity(string fileName, string account,
FileSystemRights rights, AccessControlType controlType)
{
// Get a FileSecurity object that represents the
// current security settings.
FileSecurity fSecurity = File.GetAccessControl(fileName);
// Remove the FileSystemAccessRule from the security settings.
fSecurity.RemoveAccessRule(new FileSystemAccessRule(account,
rights, controlType));
// Set the new access settings.
File.SetAccessControl(fileName, fSecurity);
}
}
}
Link: http://msdn.microsoft.com/en-us/library/system.security.accesscontrol.filesystemaccessrule.aspx
18 July 2009
Sql for list all objects from Sql Server 2005 by re
SELECT name, CASE xtype WHEN 'C' THEN 'CHECK constraint' WHEN 'D' THEN 'Default or DEFAULT constraint' WHEN 'F' THEN 'FOREIGN KEY constraint ' WHEN 'L' THEN 'Log '
WHEN 'P' THEN 'Stored procedure '
WHEN 'PK' THEN 'PRIMARY KEY constraint (type is K) '
WHEN 'RF' THEN 'Replication filter stored procedure '
WHEN 'S' THEN 'System tables '
WHEN 'TR' THEN 'Triggers '
WHEN 'U' THEN 'User table '
WHEN 'UQ' THEN 'UNIQUE constraint (type is K) '
WHEN 'V' THEN 'Views '
WHEN 'X' THEN 'Extended stored procedure '
WHEN 'TF' THEN 'Functions'
END AS type
FROM dbo.sysobjects
ORDER BY type ASC
> List all database in your
SELECT * FROM sys.databases
> List all tables from specific database put it on before the tag 'sys.tables'
SELECT * FROM sys.tables
SELECT * FROM northwind.sys.tables
SELECT * FROM master.sys.tables