Quantcast
Channel: CodeFari
Browsing all 265 articles
Browse latest View live

Nested Transaction in SQL Server

Transaction: Transaction is the collection of T-SQL statements which executes in single unit. Transaction begins with a specific T-SQL statement and ends when all T-SQL statements execute successfully....

View Article


Greater than and greater than equal to query in MongoDB

To fetch records “greater than” and “greater than equals to” to a specific value, mongodb provide $gt and $gte operator respectively.Syntax: --For greater than{field: {$gt: value} }--For greater than...

View Article


Less than and Less than equals to query in MongoDB

To fetch records “less than” and “less than equals to” to specific value mongodb provide $lt and $lte operator respectively.Syntax:{ field: { $lt: value} } // for greater than{ field: { $lte: value} }...

View Article

Update a table using JOIN in SQL Server

Suppose we have a table INVENTORY (books data) and another table PUBLISHER. We need update daily INVENTORY table due to price fluctuation by PUBLISHER. We will use bulk update to update INVENTORY...

View Article

$in and $nin operator in MongoDB

$in operator is responsible to select those records where value of the fields is equal to the any elements specified in the array.Same as $nin operator is responsible to select those records where...

View Article


Find all stored procedures related to table in database in SQL Server

There are many different ways to find all stored procedures related to specific table, some are described below.Using sp_depends: This is the system stored procedure which can use to find all users...

View Article

Case statement in SQL Server

SQL Server gives us facility to fetch or modify records on condition basis. Suppose we have an “Order” table and we need to fetch records with conditions if user order price is less than 200 Rs it...

View Article

Drop and Disable trigger using query in SQL Server

Drop Trigger: We can drop trigger using following query.Example:USE[DB_NAME]GODROPTRIGGERTGGR_NAMEGODisable Trigger: You can disable/enable trigger using following queryExample: --Disable...

View Article


$or operator in MongoDB

$or: If you aware with SQL Server, $or operator behave same like OR in SQL Server. $or operator uses to perform logical OR operation on two or more than two arrays and its select the documents that...

View Article


$and operator in MongoDB

$and: This operator works same as AND in SQL Server. $and operator uses to perform logical operation on two or more than two arrays and its select the documents that satisfy to all expression. Syntax:...

View Article

Text Index in MongoDB

Text index supports to text search queries on string content. We can any add fields which value is string or an array of string elements.Text index is introduced in mongodb version 3 but some key...

View Article

$not operator in MongoDB

Before explaining $not operator I want to remind you about NOT IN in SQL Server. In T-SQL query we used NOT operator like below.<SELECT QUERY> <WHERE ID> NOT IN (<a sub query>)Same...

View Article

Add day to ISODate in MongoDB

We can use $add operator to add days in ISODate in mongodb, $add is the Arithmetic Aggregation Operator which adds number and date in mongodb.Syntax: { $add: [ <expression1>, <expression2>,...

View Article


Remove special character from string in MongoDB

Problem: Suppose wehave a collection and one field is type string contains some special character (like !@#$%) and we don’t want these special character.Solution: We can easily remove the special...

View Article

Image may be NSFW.
Clik here to view.

Move Files from one folder to another folder in SSIS

Problem: Suppose we have a source directory where more than one tab delimited files exists and we need to move files in archive folder one by one after read and transform the data from these...

View Article


List of indexed field(s) of collection and database in MongoDB

getIndexes() method is responsible to list indexes of collection. You can find all indexes in collection using getIndexes() method.Syntex: db.CollectionName. getIndexes()Example: Suppose we have a...

View Article

Arithmetic aggregation operators in MongoDB

$abs: $abs returns absolute value of the number.$add: $add use to summation numbers and date it returns same as added number and new added date. If you are adding date mean first expression is date and...

View Article


Image may be NSFW.
Clik here to view.

Paging in SQL server 2012 stored procedure using OFFSET and FETCH

In this article we will learn about pagination using OFFSET and FETCH, OFFSET and FETCH is the new features of SQL Server 2012. In earlier version this feature is not available so was very difficult to...

View Article

Difference between function and stored procedure in SQL Server

Some basic difference between stored procedure and function is described below.The main difference between stored procedure and function is Function must returns a value while stored procedure can or...

View Article

How to get name, data type and fields size of table in SQL Server

Sometimes we need to see the column details like name, data type and size, this article may help you to find the details of column is database table.Suppose we have an”Inventory” table as...

View Article
Browsing all 265 articles
Browse latest View live