Skip to content

Instantly share code, notes, and snippets.

View alikrc's full-sized avatar

Ali alikrc

View GitHub Profile
@alikrc
alikrc / fetch.js
Created November 15, 2018 11:28
fetch example
var url='http://example.com/movies.json';
fetch(url)
.then(function(response) {
console.log(response);
return response.json();
})
.then(function(json) {
console.log(JSON.stringify(json));
});
@alikrc
alikrc / MS CRM Dynamics Entity StateCodes and StatusCodes.md
Last active February 29, 2024 14:41
MS CRM Dynamics Entity StateCodes and StatusCodes
Entity Status (statecode) Status Reason (statuscode)
Account (account) 0 Active 1 Active
1 Inactive 2 Inactive
Activity (activitypointer) 0 Open 1 Open
1 Completed 2 Completed
2 Canceled 3 Canceled
3 Scheduled 4 Scheduled
Appointment (appointment) 0 Open
@alikrc
alikrc / workflow statuscode
Created September 27, 2018 08:11
Asyncoperationbase table - operationtype, status code and state code dynamics crm
operationtype Description
1 System Event
9 Collect SQM data
10* Workflow Operation
12 Update Match Code
25 Generate Full Text Catalog
27 Update Contract States
@alikrc
alikrc / findstr.txt
Created September 16, 2018 08:51
how to serach a string word in files, windows command
findstr "hello there" *.cs
ref:
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/findstr
@alikrc
alikrc / sp_helptext.sql
Last active August 9, 2018 13:21
see contents of a db object(function, sp etc)
sp_helptext SpNameHere
@alikrc
alikrc / Conditional where clause.sql
Created July 12, 2018 13:13
If param is not null then add to where clause
declare
@id int--=123
select @id
select * from FOOTABLE t
where
(@id is null or t.ID = @id) --if param is null it doesnt add the condition
@alikrc
alikrc / DATE.SQL
Created July 12, 2018 08:10
Take only date part of full date
select CONVERT(DATE,'2018-07-18 00:00:00')
--RESULT: 2018-07-18
@alikrc
alikrc / FLOOR AND CEILING.SQL
Created July 12, 2018 06:42
Find largest and smallest values of an integer which is less greater or equal.
SELECT FLOOR(25.9); --25
SELECT CEILING(25.1); --26
@alikrc
alikrc / Find Usage Of Function Stored Proc.sql
Created July 9, 2018 10:52
Find usage of a db object like function, store procedure etc
SELECT DISTINCT sc.id,
so.name
FROM syscomments sc
INNER JOIN sysobjects so
ON so.id = sc.id
WHERE sc.TEXT LIKE '%functionname%'
ORDER BY 2
@alikrc
alikrc / search in contents of stored procedures
Last active July 4, 2018 13:48
Its used for searching a keyword in all stored procedures func etc.sql
SELECT DISTINCT
o.name AS Object_Name,
o.type_desc
FROM sys.sql_modules m
INNER JOIN
sys.objects o
ON m.object_id = o.object_id
WHERE m.definition Like '%your keyword here%';
----------------------------------------------