Posts

Showing posts from 2009

get error "The path is not of a legal form" during install Microsoft Dynamics CRM Data Migration Manager

Check registry key below ;

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\\InstallProperties]
Value: InstallLocation

if InstallLocation is empty,Wizard will be thrown an error about illegal path.Set it with correct path.Installation will continue.

GUI value = make a searchment under the products with "Data Migration" keyword to modify.

"Navigation to the webpage was canceled‏" seems in chm file pages.

First of all,
make sure that hhctrl.ocx is registered in the windows system.if not run
regsvr32 hhctrl.ocx command from prompt.
Secondly,
unlock the file from property menu by right click .

good luck...

Cannot locate resource 'xxxxx.xaml' (Default: 'window1.xaml'). Windows Presentation Foundation

If you get an error message as in subject line;
add
[assembly: NeutralResourcesLanguageAttribute(/*"xx-XX" (for example :*/"en-US"/*)*/, UltimateResourceFallbackLocation.Satellite)]
statement into AssemblyInfo.cs file on your project.
Good Luck...

Stored Procedure Pattern in SQL Server 2005

Here is a basic stored procedure concept i personally offer to advanced SQL Server users;

SET NOCOUNT ONDECLARE cur_sor CURSOR DECLARE @CURSOR_FETCH_STATUS INT DECLARE @varible1 as [anytype] ,@variable2 as [anytype],....SET cur_sor = CURSOR LOCAL FORWARD_ONLY STATIC READ_ONLY FOR SELECT .... FROM ...../* for Arguments Detail check http://msdn.microsoft.com/en-us/library/ms180169.aspx*/
OPEN cur_sor
BEGIN TRY
BEGIN TRANSACTION
FETCH NEXT FROM cur_sor INTO @varible1,@variable2 ,... /* not more than selected columns above*/SELECT @CURSOR_FETCH_STATUS = @@FETCH_STATUS WHILE @CURSOR_FETCH_STATUS = 0 BEGIN ....... /* INSERT,DELETE,UPDATE ( DML) or any other process */ ....... FETCH NEXT FROM cur_sor INTO @varible1,@variable2 ,...SELECT @CURSOR_FETCH_STATUS = @@FETCH_STATUS END COMMIT END TRY BEGIN CATCH PRINT(ERROR_NUMBER()) PRINT(ERROR_SEVERITY()) PRINT(ERROR_STATE()) PRINT(ERROR_PROCEDURE()) PRINT(ERROR_LINE()) PRINT(ERROR_MESSAGE()) ROLLBACK END CATCHCLOSE cur_sor DEALLOCATE cur_sor


good luck

An Error is thrown by Distributor Agent about 'Error executing a batch of commands Retrying individual commands' while Replicating Server

If you get an error message on Replication Monitor that is given by Distributor Agent about "Error executing a batch of commands Retrying individual commands" and figure out table does not replicate to subscriber.There will probably occur data integrity problem.Check foreign key or any other relations,constraints over the table and verify in subscriber database Nevertheless you may omit the error adding "-SkipErrors 20598 " parameters into Replication distributor agent job...

good luck,

table partition

-Creating
CREATE PARTITION FUNCTION IdPartition ( int ) AS RANGE RIGHT
FOR VALUES ( 10000 , 20000 , 30000, 40000, 50000 )


CREATE PARTITION SCHEME IdSchema AS PARTITION IdPartition
TO ( Filegroup1,Filegroup2,Filegroup3,Filegroup4,Filegroup5,Filegroup6)



Altering
ALTER PARTITION SCHEME IdSchema NEXT USED Filegroup2

ALTER PARTITION FUNCTION IdPartition () SPLIT RANGE ( 100000 )



retrieving partition status of databases


SELECT $partition.IdPartition(DCEProjects.ID) AS [Partition Number],max(DCEProjects.ID)
FROM dbo.DCEProjects
--WHERE $partition.IdPartition(DCEProjects.ID) = 2
GROUP BY $partition.IdPartition(DCEProjects.ID)
ORDER BY [Partition Number]

Get all Tables rows count in a database

Here is T-SQL Statment;

Select A.name 'TabloAdi_TableName' , B.rowcnt 'SatirSayisi_RowCount' from sysobjects A, sysindexes B where A.id =b.id and A.type = 'u' and indid <2 order by TableName

good luck,

comparision executed user role with given

Syntax : is_srvrolemember(SQLServerRole in String)
Returns : if user has right for given return will be 1

for example;

if (not (is_srvrolemember('sysadmin') = 1)) -- Make sure that executing by SQ.
begin
raiserror(...)
return(1)
end

bird's eye view over SQL Server Performance

There is good statement that you can see what is going on Database
DBCC SQLPERF('waitstats')
it collects wait status group by Wait Type.

get index fragmentation status of SQL Server 2005 database

here is good trick that you can obtain fragmentation status of each table in any selected database

SELECT c.name as TableName, b.name as IndexName, avg_fragmentation_in_percent as Fragmentation
FROM sys.dm_db_index_physical_stats (DB_ID(), null, NULL, NULL, NULL) AS a
JOIN sys.indexes AS b ON a.object_id = b.object_id AND a.index_id = b.index_id, sys.tables as c
where c.object_id=a.object_id
order by avg_fragmentation_in_percent;

Results ;
Fragmentation > 5 AND < 30 : Reorganize Index - ALTER INDEX REORGANIZE

to do

Sp_MSForEachTable @command1 = "PRINT 'ALTER INDEX ALL ON TABLE ? WITH Reorganize'", @command2= "ALTER INDEX ALL ON ? REORGANIZE" for every table on selected database in SQL Server 2005.

Fragmentation > 30 Rebuild Index - ALTER INDEX REBUILD

to do

EXEC Sp_MSForEachTable @command1 = "PRINT 'ALTER INDEX ALL ON TABLE ? REBUILD' ", @command2="ALTER INDEX ALL ON ? REBUILD WITH (FILLFACTOR = 80, ONLINE = OFF,SORT_IN_TEMPDB = ON, STA…

How to add .net based user control to AX 2009

if you would like to add any user control prepared on .net platform into AX 2009 you should follow the steps:
1-Create Active X and wrap the user control with unmanaged code.
2-register to windows as COM object.
3-call it from AX.

1- Here is sample code:
//create Class type project in Visual Studio

//Set events that will be used in AX
//presents to caller
[ComVisible(true)]
//create interface type of Dispatch
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
//Create unique key, used by windows
//you can create a guid from tools menu on visual studio easily.
[Guid("102B961D-60B6-4990-8B29-4802F7F9D293")]

public interface IEventInterface
{
[DispId(1)]
//define events that we want to use
void ValidateEdit(object sender, ValidateEditEventArgs e);
}
[ComVisible(true)]
//class unique ID
[ProgId("DC.ActiveX.C1FlexGrid")]
//declera EventInterface class for the class
[ComSourceInterfaces(typeof(IEventInterface))]
//class type should be AutoDual
[ClassInterface(ClassInterfaceType.AutoDual)]
[Gui…

How to call any web page from SQL Enterprise manager as scheduled job

Here is code with VB Script;
Dim WshShell
Set WshShell =CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("C:\\PROGRA~1\\INTERN~1\\iexplore.exe http://localhost/xxxx/app/pages.aspx")
oExec.Terminate()
Set WsShell = Nothing

Pay attention to terminating iexplore.exe after Job finishes on codes.