SatishKartan



By Satish Kartan 19 Apr, 2018

Microsoft CRM was designed to be easily customizable. Microsoft CRM Software Development Kit (MS CRM SDK) which you can download from Microsoft website contains descriptions of the objects or classes, exposed for customization. It has sample code in C# and partially in VB.Net. In Visual Studio.Net you can analyze all the classes, used by Microsoft developers to create MS CRM - you will discover that most of them are not documented in MS CRM SDK. Microsoft will not support your customization if you use undocumented class or do direct SQL access to CRM database.

 

Below Satish Kartan a webmaster describes you - programmer, software developer typical cases of MS CRM Customizations:

 

1) Integration with SQL Server application. If you have legacy system on MS SQL Server - let's say you are Transportation Company and have in-house developed cargo tracking database. Now in MS CRM you want lookup the shipments for the customer (or account in CRM). This is SDK programming and calling SQL stored proc to retrieve cargo info. Instead of SQL Server you can have other database (ORACLE, MS Access, PervasiveSQL to name a few) - you can access multiple Database platforms via ADO.Net connection from your .Net application, which is easily integrated into MS CRM Account screen.

 

2) Email capturing in MS CRM. You have customer with email Bill@customer.com. Now you want all the emails that you receive from customer.com domain to be attached to Bill who is account in CRM. This is more difficult customization - you have to create MS CRM SDK web service, that one will be creating email activity and call it from COM+ application - Microsoft Exchange event handler (ONSYNCSAVE database event sink). This example maybe complicated with the following requirement. Imagine that Bill, instead of answering to your email (sent from CRM and processed by CRM-Exchange connector) sends you new message from MS Outlook. Then this email will not follow into MS CRM (because it doesn't have GUID in the header and so is ignored by CRM Exchange connector). If you want to capture these emails - you have to do it in Microsoft Exchange event sink. There maybe scenario when you want to capture and analyze in the sink all the outgoing emails - this is even more complex - you have to place the sink on transport event.

 

3) ASP Application integration. You have legacy ASP application, where you capture orders from your customers and you want these orders be transferred to the CRM as activity. Here you understand that ASP doesn't deploy Active Directory security - and the best way is to create HTTP handler and call it from your ASP page. This HTTP handler in turn will call MS CRM SDK web service with predefined (web.config) Active Directory credentials.

 

Some cautions. Never create your custom SQL objects (like stored procedure, SQL view, and table) in MS CRM database. Instead, create your own database and place your objects there. When you see the first caution - you will never try to alter existing CRM objects, like adding new field to the table.

By Satish Kartan 31 Mar, 2018

Most interactive websites nowadays require data to be presented dynamically and interactively based on input from the user. For example, a customer may need to log into a retail website to check his purchasing history. In this instance, the website would have stored two types of data in order for the customer to perform the check – the customer’s personal login details; and the customer’s purchased items. This data can be stored in two types of storage – flat files or databases.

 

Flat files are only feasible in very low to low volume websites as flat files have 3 inherent weaknesses:

 

The inability to index the data. This makes it necessary to potentially read ALL the data sequentially. This is a major problem if there are a lot of records in the flat file because the time required to read the flat file is proportionate to the number of records in the flat file.

The inability to efficiently control access by users to the data

The inefficient storage of the data. In most cases, the data would not be encrypted or compressed as this would exacerbate the problem no. 1 above

 

The alternative which is, in my opinion, the only feasible method, is to store the data in a database. One of the most prevalent databases in use is MySQL. Data that is stored in a database can easily be indexed, managed and stored efficiently. Besides that, most databases also provide a suite of accompanying utilities that allow the database administrator to maintain the database – for example, backup and restore, etc.

 

Websites scripted using PHP are very well suited for the MySQL database as PHP has a custom and integrated MySQL module that communicates very efficiently with MySQL. PHP can also communicate with MySQL through the standard ODBC as MySQL is ODBC-compliant, However, this will not be as efficient as using the custom MySQL module for PHP.

 

The rest of this article is a tutorial on how to use PHP to:

 

  • Connect to a MySQL database
  • Execute standard SQL statements against the MySQL database
  • Starting a Session with MySQL

 

Before the PHP script can communicate with the database to query, insert or update the database, the PHP script will first need to connect to the MySQL server and specify which database in the MySQL server to operate on.

 

The mysql_connect() and mysql_select_db() functions are provided for this purpose. In order to connect to the MySQL server, the server name/address; a username; and a valid password is required. Once a connection is successful, the database needs to be specified.

 

The following 2 code excerpts illustrate how to perform the server connection and database selection:

 

  • @mysql_connect("[servername]", "[username]", "[password]") or die("Cannot connect to DB!");
  • @mysql_select_db("[databasename]") or die("Cannot select DB!");
  • The @ operator is used to suppress any error messages that mysql_connect() and mysql_select_db() functions may produce if an error occurred. The die() function is used to end the script execution and display a custom error message.

 

Executing SQL Statements against a MySQL database

 

Once the connection and database selection is successfully performed, the PHP script can now proceed to operate on the database using standard SQL statements. The mysql_query() function is used for executing standard SQL statements against the database. In the following example, the PHP script queries a table called tbl_login in the previously selected database to determine if a username/password pair provided by the user is valid.

Assumption:

 

The tbl_login table has 3 columns named login, password, last_logged_in. The last_logged_in column stores the time that the user last logged into the system.

 

// The $username and $passwd variable should rightly be set by the login form

// through the POST method. For the purpose of this example, we’re manually coding it.

$username = “john”;

$passwd = “mypassword”;

// We generate a SELECT SQL statement for execution.

$sql="SELECT * FROM tbl_login WHERE login = '".$username."' AND password = '".$passwd."'";

// Execute the SQL statement against the currently selected database.

// The results will be stored in the $r variable.

$r = mysql_query($sql);

// After the mysql_query() command executes, the $r variable is examined to

// determine of the mysql_query() was successfully executed.

if(!$r) {

$err=mysql_error();

print $err;

exit();

}

// If everything went well, check if the query returned a result – i.e. if the username/password

// pair was found in the database. The mysql_affected_rows() function is used for this purpose.

// mysql_affected_rows() will return the number of rows in the database table that was affected

// by the last query

if(mysql_affected_rows()==0){

print "Username/password pair is invalid. Please try again.";

}

else {

// If successful, read out the last logged in time into a $last variable for display to the user

$row=mysql_fetch_array($r);

$last=$row["last_logged_in"];

print “Login successful. You last logged in at ”.$last.”.”;

}

 

The above example demonstrated how a SELECT SQL statement is executed against the selected database. The same method is used to execute other SQL statements (e.g. UPDATE, INSERT, DELETE, etc.) against the database using the mysql_query() and mysql_affected_rows() functions.

By Satish Kartan 16 Mar, 2018

System Stored Procedures System stored procedures are packaged with SQL Server. Many procedures are used to administer SQL Server, but some are utilities that can be profitablly used by developers. They are global, and can be called from any database application without their fully qualified name. (They are all owned by dbo.) . They are all stored in the Master database, and have the prefix sp_. This is a reason why it is considered unwise to name local stored procedures with the sp_ prefix. They can be read by viewing their properties in the Query Analyzer.

 

The system-stored procedures are grouped into these categories.

 

Category

Description

 

Active Directory Procedures

Used to register instances of SQL Server and SQL Server databases in Microsoft Windows® 2000 Active Directory™.

 

Catalog Procedures

Implements ODBC data dictionary functions and isolates ODBC applications from changes to underlying system tables.

 

Cursor Procedures

Implements cursor variable functionality.

 

Database Maintenance Plan Procedures

Used to set up core maintenance tasks necessary to ensure database performance.

 

Distributed Queries Procedures

Used to implement and manage Distributed Queries.

 

Full-Text Search Procedures

Used to implement and query full-text indexes.

 

Log Shipping Procedures

Used to configure and manage log shipping.

 

OLE Automation Procedures

Allows standard OLE automation objects to be used within a standard Transact-SQL batch.

 

Replication Procedures

Used to manage replication.

 

Security Procedures

Used to manage security.

 

SQL Mail Procedures

Used to perform e-mail operations from within SQL Server.

 

SQL Profiler Procedures

Used by SQL Profiler to monitor performance and activity.

 

SQL Server Agent Procedures

Used by SQL Server Agent to manage scheduled and event-driven activities.

 

System Procedures

Used for general maintenance of SQL Server.

 

Web Assistant Procedures

Used by the Web Assistant.

 

XML Procedures

Used for Extensible Markup Language (XML) text management.

 

General Extended Procedures

Provides an interface from SQL Server to external programs for various maintenance activities.

 

 

You can create your own system-stored procedures by following the guidelines outlined above. But, even though it is possible to modify an existing system sproc, it is better to name it with another name than to destroy the system version.

 

Dynamic Queries are created and executed within a stored procedure, and are built typically by passing in text parameters and creating a text SQL string. Then the string is executed using the form EXEC (@createdstring). Dynamic query plans are not stored in cache, and local variables created in the dynamic query are not available after the query is executed. To save the query plan, instead of the keyword EXEC, use sp_executesql. Also, with sp_executesql local variables can be used both as INPUT and as OUTPUT parameters.

 

Autoexec procedures, called autostart procedures can be made by invoking the system stored procedure

sp_procoption procedurename, startup, true

 

Extended Store Procedures

Extended stored procedures are auxiliary stored procedures created in a DLL using C++. They are prefixed with xp_, and stored in the Master database. When called from an application database, they must be fully referenced, using the Master..xp_procname form. Before you can invoke it, you must register the DLL with SQL Server using the syntax:

 

sp_addextendedproc [@functname=] ‘procedure’, [@dllname=] ‘dll’

 

Satish Kartan is a webmaster who is skilled in writing on data recovery topics as he has an in-depth knowledge on the very topic, data recovery. Kartan has been working with SQL Server for the past 20 years.

To read more you can visit Satish Kartan's blog where he has shared much more!

For more reading, please visit here:  http://satishkartan.strikingly.com/

By Satish Kartan 13 Mar, 2018

As any person, who remodeled their home, will tell you that “choosing the right tool for the right job” makes all the difference. The same statement applies when choosing the right database for a project. Some databases are basic, some are “battery operated” and some are “mighty power tools.” Below is a guide by Satish Kartan on selecting the perfect database for the right project.

 

When you only need to store a limited amount of data and require a quick and easy development cycle, Microsoft Access is the right tool for you. It provides a powerful set of database and graphical user interface tools that allows the user to quickly organize, access and share information. Since Access is part of the Microsoft family of office products, it easily integrates with Excel, Word and SQL Server. In addition, it supports Open Database Connectivity (ODBC). However, if the database is going to hit 1GB threshold, you may encounter various performance issues, including slow response and record corruption. Microsoft Access is an equivalent of a Swiss army knife. Each part individually is not as impressive; however, when combined together, it produces an appealing solution.

 

My SQL is a viable alternative to Microsoft Access. Major advantages of My SQL are the low cost (licensing starts below $500) and platform independence (it can be installed on Windows, Linux, Macintosh and UNIX operating systems). My SQL does not, however, come with the development interface tools that Microsoft Access provides and would require the use of a programming language, such as Visual Basic, C, etc., to create user interface and reporting. This is your battery-operated power tool!

 

Microsoft SQL Server is a powerful alternative to My SQL and Oracle. It is moderately priced and yet quite powerful and scalable. It provides a user administration module capable of handling user, group and column-level security. Record-retrieval speed of the SQL Server outperforms both Microsoft Access and My SQL. In addition, Microsoft SQL Server is highly scalable. This is your power tool!

 

Oracle is the oldest of the relational database management systems (RDBMS) discussed in this overview and the most powerful. However, it is also the most expensive and most difficult to implement. Oracle is highly scalable and allows storage of a tremendous amount of records without jeopardizing performance. Like Microsoft SQL Server, it has a powerful user administration module. This is the mighty power tool!

 

When selecting the right tool for your next database project, keep in mind the following:

 

  • The size of the data to be stored over time;
  • Budgetary constraints;
  • Security essentials;
  • Future growth requirements;
  • Platform needs; and
  • Development tools.

 

Satish Kartan is a webmaster who is skilled in writing on data recovery topics as he has an in-depth knowledge on the very topic, data recovery. Kartan has been working with SQL Server for the past 20 years.

To read more you can visit Satish Kartan's blog where he has shared much more!

For more reading, please visit here: http://satishkartan.jigsy.com/


By Satish Kartan 24 Feb, 2018

There are a few products with the letters "SQL" in the title, and these three, SQL*Plus, SQL, and PL/SQL, are frequently utilized together. Along these it's easy to become difficult as to which product is doing the work is being finished. This segment explained by Satish Kartan quickly portrays each of these three products.

 

SQL

 

It remains for Structured Query Language. This has turned into the lingua franca of database get to languages. It has been adopted by the International Standards Organization (ISO) and has likewise been embraced by the American National Standards Institute (ANSI). When you code proclamations, for example, SELECT, INSERT, UPDATE, and DELETE, it is the language you are utilizing. It is an explanatory language and is constantly executed on the database server. Regularly you will yourself coding and statement in a development tool, for example, Power Builder or Visual Basic, yet at runtime those statements are sent to the server for execution.

 

PL SQL

 

It is Oracle's Procedural Language extension to SQL. It, as well, normally running on the database server, yet some Oracle products, for example, Developer/2000 additionally contains a PL SQL engine that resides on the customer. Along these lines, you can run your code on either the client or the server relying upon which is more proper for the task at hand. Not at all like these are procedural, not explanatory. This implies your code determines precisely how things complete. As in be that as it may, you require some approach to send your code up to the server for execution. It likewise empowers you to implant statement inside its procedural code. This tight knit connection between these three types of SQL is the reason for a portion of the confusion between the products. Most of the institutes are giving PL SQL online training.

 

SQL*Plus

 

It is an intuitive program that enables you to sort in and execute statements. It likewise empowers you to sort in PL/SQL code and send it to the server to be executed. This is a standout amongst the most widely recognized front finishes used to create and make put away strategies and functions.

 

What happens when you run and sort in a statement? Where does the preparing occur? What precisely does SQL*Plus do and what does the database do? In the event that you are in a Windows situation and you have a database server some place on the system.

 

PL/SQL is executed in much a similar way. Type a PL/SQL obstruct into SQL*Plus, and it is transmitted to the database server for execution. In the event that there is any statement in the code, they are sent to the server's engine for execution, and the outcomes are returned back to the program.

 

The vital thing is that SQL*Plus does not execute your questions. This is additionally does not execute your code. It basically fills in as your window into the Oracle database, which is the place the real action makes put.

 

Satish Kartan is a webmaster who is skilled in writing on data recovery topics as he has an in-depth knowledge on the very topic, data recovery. Kartan has been working with SQL Server for the past 20 years.

To read more you can visit Satish Kartan's blog where he has shared much more!

For more reading, please visit here: http://satishkartan.kinja.com/

By Satish Kartan 08 Feb, 2018

Over the years, the value of a backup program has become more and more important, especially considering the amount of data that we have on our computers. If you are running a Microsoft Exchange server, then having an Exchange backup system running and ready to go is one of the most important things you can do to help protect your business.

 

Much like insurance that you might buy for your home or your vehicle, you never really see the value of paying for an Exchange backup system until after a disaster strikes. In fact, you may be backing up your data for years without ever having to rely on the backup. But one day, it will happen. You will need to get access to uncorrupted data and that is the day you will be glad you had the backup.

 

There are several very good Exchange backup programs available that will not only protect your data in case your servers go down or are destroyed entirely, but also in case of virus or worm attack. The possibilities for this type of attack are virtually endless these days, and no matter how many times you tell your employees not to open attachments, they will continue to do so.

 

In fact, many of the attacks that Microsoft Exchange servers succumb to these days are not due to user error, but due to malicious viruses that are simply running rampant on the internet. They can come in the form of emails, websites, or applications that your users employ. No matter what you do, there is virtually no way of stopping them, but by having a backup, at least you will be able to recover. Having a good backup for your Microsoft Exchange server is the best insurance you will ever buy for the future of your company.

 

Satish Kartan has been working with SQL Server for the past 20 years. To read more, please visit Satish Kartan's blog at http://www.sqlfood.com/ where he has shared more details on this.


By Satish Kartan 27 Oct, 2017
Access to SQL servers are easier with SQL server client tools that allow for seamless navigation and management of SQL servers. Some SQL server client tools are comprehensive, with reliable reporting tools and support with known database programs like Azure SQL Data Warehouse, Azure SQL Database, and Server Database. When choosing client tools, consider something that is entirely web-based for an efficient and quicker way to create and manage SQL-queries. High-end tools are capable of building drag and drop database tables, too, resulting in an intuitive and simplified point-and-click interface that lets you connect directly to an server database.

Simplify tasks

The best SQL server client tools offer a data browser for managing your SQL server data simply and efficiently. With a user-friendly interface, you can quickly edit, browse, delete, filter, or update SQL server table data. Likewise, it is easy to update, insert, or view MSSQL binary data, and export it into PDF, HTML, or CSV in a few clicks. The MS data editor lets you insert, create, delete, or update data, or update binary data and text. You can construct complex queries or build one without writing any code using an SQL-server query builder. All these features enable you to save time and effort when performing certain tasks.

Import and export data with ease

High-end SQL server client tools simplify the viewing or exporting of data into many different formats, such as CSV, HTML, and PDF, and as insert statements. If you want to import CSV data, you can upload the CSV file, and the server client tool will automatically map the table columns with the uploaded CSV files. If importing is successful, you can now schedule import jobs, in case you want the tool to import at regular intervals automatically.

Manage your data easily

An online SQL server table manager is one of the most important and useful server client tools that can let you control your SQL-server database tables. With that, it is easier to rename, create, truncate, or drop tables. You have access to a full set of tools for altering and viewing column details, create new rows and columns, and import CSV data. A good server client tool comes with a reporting feature that will provide everything you need to know in terms of statistics and dependencies. Comprehensive server client tools come with options that allow users to create dashboards and charts, and share them with other users.

Satish Kartan has been working with SQL Server for the past 20 years. He has worked for many years in leading IT Services firms worldwide. He writes on SQL and IT services.
For more reading, please visit here: http://satishkartan.strikingly.com/
By Satish Kartan 14 Oct, 2017
We have all bought software that was just so difficult to use that we gave up. This happens a lot with SQL backup software, because there are often so many options that people find it too difficult to navigate. So, instead of installing the software and setting it to backup the data, they forget about it or leave it sitting on the shelf, where it serves no purpose.

Being able to properly operate your SQL backup software is imperative if you want it to work correctly. The problem really is that a lot of the older packages are too complicated and far too expensive. Luckily, the software of today is cheaper, easier to use, and actually a lot more powerful than before. There is no excuse not to have your data backed up at all times.

Although you may think that your SQL server is completely safe and that all of your staff is properly trained in how to avoid getting viruses, you never know when your server will go down. It could be because of a malicious employee, an ex-employee who still has access to your data, a bored hacker, or even a natural disaster. You just never know when something will happen, and if you don't have your SQL backup running at all times, you might have no other way out.

Whether you have a powerful server with hundreds of users, or a small one that holds just a little data, it is just as important to have a backup that you can depend on. Once you set up your backup program, you won't have to do anything again until you need it. It will continue to run in the background, providing you the security you need, which will enable you to sleep at night, knowing your data is safe.

Satish Kartan has been working with SQL Server for the past 20 years. To read more, please visit Satish Kartan's blog at http://www.sqlfood.com/ where he has shared more details.

Also read here:  Installing SQL Server Monitoring Software Means Confidentiality
By Satish Kartan 11 Oct, 2017
Using a reliable and versatile SQL server query builder allows you to manage, browse, and modify all major database structures, like SQL Server, Oracle, Netezza, Teradata, SAP HANA, MySQL, PostgreSQL, and Hadoop/Hive. You don't necessarily have to install new software or learn a new query language or SQL. Some of the best server query builders are web-based and easy to use, so you can quickly and easily generate complicated queries for every database that you own. When looking for a server query builder, consider a platform that is supported by all commonly used databases.

SQL server query builders have intuitive interfaces that let you build your queries and add conditions with a few clicks. They let you build queries, perform an expression, and apply aggregate functions among many other functions. A web-based query builder lets you open built queries in an SQL editor for formatting and execution. These features make it easier to modify or browse any database structure.

Some features of a good SQL server query builder

The platform should make it easy to drag and drop database tables from the schema browser to the query builder to create SQL select statements. From there, the platform should automatically build join conditions based on primary and foreign keys between the two tables. An SQL-query-builder supports left outer join, inner join, full outer join, and right outer join, and can open any number of query tabs as required, so you can work on different builders simultaneously. A good server query builder will show live data previews as you make queries while enabling you to apply various conditions or filters on the data preview window.

Live data preview is an important feature of a good SQL-server-query builder. It must let you apply different filter conditions on running data as well as allow you to unselect or select columns and sort results even without this knowledge. You may export data from the data preview window into different formats, like HTML, PDF, and CSV. If you configured to export to an external storage, you may export data and save it directly on an external storage like Google Drive or Amazon S3. It is easy to run and manage SQL query builders for known databases like MySQL and Oracle. These platforms let you open the query builder and create queries by dragging and dropping tables.

Satish Kartan has been working with SQL Server for the past 20 years. To read more, please visit Satish Kartan's blog at http://www.sqlfood.com/ where he has shared more details.
By Satish Kartan 05 Oct, 2017
After you have designed a database in MSSQL Server or MySQL, how do you retrieve specific information from the database? You need to know Structured Query Language (SQL) and that is what will help you retrieve information. Read on for highlights.

First of all, you need to know what a schema and instance mean for database tables.

A schema includes all the fields of the table while instance means collection of data at a specific moment.

For example, you have created the following tables for a small university database. (I give you only the schemas of tables here.)

Student:

matNr|sName

Professor:

pName|psalary

Class:

classNr|room|day|pname

Takes:

matNr|classNr|grade

TA:

matNr|classNr|hours|tasalary

The bold field(s) of a table represent the primary key of that table which uniquely identifies entities (tables) within an entity set (a set of similar tables).

Now several queries to the database and SQL statements for those queries could be:

1) List all students of the university.

SELECT sName FROM Student

Here SELECT is an SQL keyword that is targeting to display names of students in the university from Student table. FROM is also an SQL keyword.

2) List students whose grade was 'A' in CSE 303.

SELECT sName FROM Student, Takes WHERE Student.matNr=Takes.matNr AND classNr = 'CSE 303' AND grade = 'A'

Here SELECT is targeting to show the student names from a join of Student and Takes tables given that classNr or course is 'CSE 303' and student's grade is 'A'.

3) Display the names of TAs whose salary is greater than $1500.

SELECT sName from Student, TA WHERE Student.matNr=TA.matNr AND tasalary>1500

4) Which professor takes classes on CSE 303?

SELECT pName FROM Class, Professor WHERE Class.pName = Professor.pName AND classNr='CSE 303'

5) List Students of CSE Department.

SELECT sName from Student, Takes WHERE Student.matNr=Takes.matNr AND classNr='CSE%'

Here the query asks to list students of CSE department. But in our tables we have no field for department. So we find a way out by a join of Student and Takes tables and writing classNr= 'CSE%' meaning the courses beginning with the characters 'CSE'.

Summing up, those are a few examples how you use SQL query language to extract your desired information from a specific database, in my case, a small university database. You can find other query languages such as relational algebra to extract information from databases. But SQL is more user-friendly, widespread and popular.

Mr. Satish Kartan has been working with SQL Server for the past 20 years. To read more, please visit Satish Kartan's blog at http://www.sqlfood.com/ where he has shared more details.
More Posts
Share by: