Skip to main content

Posts

Showing posts from November, 2016

GOTO Statement in SQL Server

After a condition/statement execution, if we need to alter the flow of execution to start from a particular label, then GOTO statement will help you. Basically, GOTO keyword uses to skip statement process and continue from a particular label. GOTO Statement in SQL Server contains two parts –
GOTO statement declaration: GOTO statement contains GOTO keywords and label_name as below.

GOTOlabel_name

    Label Declaration: Label contains label_name only with at least one statement as below.

label_name: select*fromtbl

Label_name must be unique within the scope of the code and after label_name declaration, there should be one SQL-statement.
Example: How can we use GOTO statement in SQL server, you can see below.

DECLARE@ratingINT=10 WHILE@rating>0 BEGIN IF@rating=8 GOTOCodefari

Transaction Logs in SQL server. Why we need and how can we read transaction log in SQL Server?

Problem: As we know SQL server Master DB store all the information of table, schema, stored procedures, function, triggers etc. But what is about the operational information, if any problem like error or bug happened in our process execution or some intruder want to do nasty on your server like SQL injection. How can we track this type of issue in Our SQL Server?

Solution:Transaction log may help you to track this problem, Transition log may be the evidence for such type of problems.
Basic Operation captured by Transaction: Before explanation about transaction log, we should to know what SQL operations are captured by transaction log.
Transaction log captured all the DML operation like INSERT, UPDATE, DELETE and also some DDL operation like CREATE, TRUNCATE and DROP,
Why to read SQL Server transaction log?
Transaction log contains all the information about the transaction we performed in our database. If we did some operation by mistake like delete or we lost some data and we want to reco…

MongoDB 3.4: What’s New

In the age of digital transformation and disruption, your ability to thrive depends on how quickly you adapt to a constantly changing market environment. MongoDB 3.4 is the latest release of the industry’s fastest growing database. It offers a major evolution in capabilities and enhancements that enable you to address emerging opportunities and use cases:
Multi-model Done Right: Native graph computation, faceted navigation, rich real-time analytics, and powerful connectors for BI and Apache Spark bring additional mult-imodel database support right into MongoDB.
Mission-Critical Applications: Geo-distributed MongoDB zones, elastic clustering, tuneable consistency, and enhanced security controls bring state-of-the-art database technology to your most mission-critical applications.
Modernized Tooling: Enhanced DBA and DevOps tooling for schema management, fine-grained monitoring, and cloud-native integration allow engineering teams to ship applications faster, with less overhead and higher …

Join between two collections in MongoDB

$lookup command used to perform join between two collections. This is new feature of MongoDB version 3.2
$lookup perform the left outer join between two collections in same database. For the each input document $lookup add a new array fields whose element matches from joined collection.
Syntax:

{    $lookup:      {        from: <collection to join>,        localField: <field from the input documents>,        foreignField: <field from the documents of the "from" collection>,        as: <output array field>      } }