Tuesday, September 21, 2010

SSIS: [Send Mail Task] Error: Either the file "FileName" does not exist or you do not have permissions to access the file.

This is because when you create the file it put a lock on the file in SSIS.
Solution: Close the file using FileStream.Close() method.

FileStream File1 = new FileStream("C:\Text1.txt", FileMode.Create);
File1.Close();

Monday, September 20, 2010

CRM Reports Fix

1. Enable the SQL Server from Deployment Manager
2. Re-Publish the reports

SharePoint: Deactivated users are still showing up in Staff Directory.

Deactivated users are still showing up in Staff Directory.
1. On the Site Settings page of the portal site, on the User Profile, Audiences, and Personal Sites page, click Manage profile database.
2. On the Manage Profile Database page, click Configure profile import.
3. On the Configure Profile Import page, in the Source area, click Custom source.
4. Click OK.
5. On the Manage Connections page, do one of the following as appropriate to your situation:
o Click the name of the domain that you want to edit, and then click Edit.

-or-
o Click New connection to add a new domain controller that contains the user profiles that you want to import.
.
6. On the Edit Connection or Add Connection page (as appropriate to your situation), in the Search Settings area, do the following:
a. In the Search base box, type the distinguished name (DN) of the Active Directory object from where you want to import the user profiles.

The DN of the search base object defines the location in Active Directory where you want to start your search. The following are examples of DNs:
 DC=DomainName, DC=com
 CN=Users, DC=DomainName, DC=com
 OU=OrganizationalUnit, DC=DomainName, DC=com
b. In the User filter box, type the following LDAP search filter:
(&(objectCategory=person)(objectClass=user)( !(userAccountControl:1.2.840.113556.1.4.803:=2)))
c. Under Scope, specify the scope level, page size, and page time-out options that you want.
1. Click OK.

CRM : An error occurred while promoting a Microsoft CRM e-mail message

Attachment of size bigger than 8 mb are not allowed to be tracked in CRM 4.0

Work Arounds:

You need to change the
following 2 lines in your web.config file to increase the size beyond 8MB

1.

This maxRequestLength determines the size of files being attached in CRM as
well as adjusting the size in the Settings area.

2.

This second maxRequestLength line determines the size of email attachments
that can get tracked when users press track in Outlook.


Note:

Editing web.config did not resolve the issue, but when I changed the 'Maximum
file size' value in Settings>System Settings>E-Mail tab it worked.

Location of web.config: c:\INetpub\www

SQL : Database cannot be opened due to inaccessible files or insufficient memory or disk space

STEP1: identify the db status:
use master
select databaseproperty(‘db_name’,'isShutdown’)
Most of them it would return 1 in this situation
STEP2: Clear up the internal db status:
use master
alter database db_name set offline
it would return with no error in most cases
STEP3: Get detail error message:
use master
alter database db_name set online
After step3, sql server will first verify the log file, if the log file is okay, it will verify the rest of the data file(s). Most of time it is because of the file location or file properties setting. For example if it is file location issue:
alter database db_name
modify (file=’logical name’, filename=’physical name’)
go

SQL : SQL Timeout from Management Studio

I get the message - "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding" - when working with large tables in Management Studio.
If you change the Execution time-out you need to open a new query over a new connection:
File -> New -> Database Engine Query
Instead of changing the execution time-out through Tools -> Options you should be able to specify it when opening the first query/connection to a SQL Server in the "Connect to Database Engine" dialog box:
Options -> Execution time-out.

SQL Server : Transaction Log Full

USE DatabaseName
GO

DBCC SHRINKFILE(, 1)

BACKUP LOG WITH TRUNCATE_ONLY

DBCC SHRINKFILE(, 1)

GO