Tuesday, 22 June 2010

SQL Server Workaround for ignoring Password expiration Policy

Workaround for ignoring Password expiration Policy
Error: The CHECK_POLICY and CHECK_EXPIRATION options cannot be turned OFF when MUST_CHANGE is ON.


To change must_change on without oldpassword

Step1: Identify the logins that have expiration checked.

SELECT * FROM sys.sql_logins where is_policy_checked=1 or is_expiration_checked =1

Step2: Launch Local Security Policy
Start-->Run--> secpol.msc

Change the Maximum Password Age and Minimum Password Length and Password must meet complexity requirements to suit your requirement








Other SQL 2005 Views related to Logins

Database-Level Views
sys.database_permissions
sys.database_role_members
sys.database_principals
sys.master_key_passwords

Server-Level Views
sys.server_permissions
sys.sql_logins
sys.server_principals
sys.system_components_surface_area_configuration
sys.server_role_members

For more information:
http://msdn.microsoft.com/en-us/library/ms178542(v=SQL.90).aspx

Monday, 10 May 2010

SSIS Package Suffixing Date


SQL Server 2005 SSIS package Export to CSV with date Suffix. The default evaluation of SSIS expression puts DD-M-yyyy eg: 01/5/2010 instead of 01/05/2010. This causes issue when you are trying to import CSV into SQL Server especially when you are not controlling the file date format.

Simple way to change is using Expressions with format Specified below

"F:\\test" + (DT_WSTR, 20) DAY( getdate() ) + RIGHT("0" + (DT_WSTR, 20) datepart("mm", getdate() ),2) + (DT_WSTR, 4) YEAR( getdate() ) +".csv"

Wednesday, 5 May 2010

Extarct DLL from Assembly Cache

Step1: Start-->Run-->cmd
Step2: cd C:\WINDOWS\assembly\GAC_MSIL\
Step3: List the contents using dir command and change directory
for eg:cd CrystalDecisions.CrystalReports.Design

Step4: list the content using DIR and copy the file to the required destination

SSIS Error Code DTS_E_OLEDBERROR "Microsoft OLE DB Service Components" Hresult: 0x80040154 Description: "Class not registered".

Recently migrated from SQL Server 2000 to SQL Server 2005 64bit on Windows 2003 64 bit.
After this started hitting error while importing Access DB into SQl server.

SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040154. An OLE DB record is available. Source: "Microsoft OLE DB Service Components" Hresult: 0x80040154 Description: "Class not registered".

Steps to Solve this issue:
1. Change the Run64bitRuntime property to False in Visual Studio Project Properties















2. Change the SQL Server Agent job to use 32 bit DTEXEC



"C:\Program Files (x86)\Microsoft SQL Server\90\DTS\Binn\dtexec.exe" /SQL "\Telephone Records Import" /SERVER "." /MAXCONCURRENT " -1 " /CHECKPOINTING OFF /REPORTING E

Wednesday, 3 February 2010

Dropping an oracle database

If you are running on UNIX launch $dbca and use delete a database option.
If you are using terminal console
1. Launch startxwin (cygwin xterm)
2. Add the server name to the access list
for instance: xhost (server hostname)
3. export DISPLAY
$export DISPLAY=(ip address of client):0.0
4. $dbca&