A Cursor is a database objects to retrieve data from a result set one row at a time, instead of the T-SQL commands that operate on all the rows in the result set at one time. We use cursor when we need to update records in a database table in singleton fashion means row by row.
Recently, I have configured database mail in SQL Server 2008. Here, I am sharing what I have learnt and how did I configure this powerful feature of sending mail in SQL server 2008.
From last couple of days, I am trying to call a wcf service using jquery that is hosted in different domain. But every time I was failed to call wcf service from different domain. After spending much time on R&D;, I found the solution and the reason why I was unable to call cross domain wcf service.
A transaction is a set of T-SQL statements that are executed together as a unit like as a single T-SQL statement. If all of these T-SQL statements executed successfully, then a transaction is committed and the changes made by T-SQL statements permanently saved to database. If any of these T-SQL statements within a transaction fail, then the complete transaction is cancelled/ rolled back.
Like C#, SQL Server also has an exception model to handle exceptions and errors that occurs in T-SQL statements. To handle exception in Sql Server we have TRY..CATCH blocks. We put T-SQL statements in TRY block and to handle exception we write code in CATCH block. If there is an error in code within TRY block then the control will automatically jump to the corresponding CATCH blocks.
SQL Server has an exception model to handle exceptions and errors that occurs in T-SQL statements. Exception handling in Sql Server is like as exception handling in other programming language. To understand exception handling, first we need to know how many types of exception we have in Sql Server.
Sql Server provides xquery methods to query xml file or xml data. Using these methods we can Insert, Update, Delete data in xml file or in XML Data Type variable. In Sql Server XQuery statements are case sensitive since xml is case sensitive. Hence while query to xml data remember this thing.
The main advantage of stored procedure is, to execute T-SQL statements in less time than the similar set of T-SQL statements is executed individually. The reason to take less time is that the query execution plan for the stored procedures is already stored in the "sys.procedures" system defined view.
Function is a database object in Sql Server. Basically it is a set of sql statements that accepts only input parameters, perform actions and return the result. Function can return only single value or a table. We can’t use function to Insert, Update, Delete records in the database table(s).
In database, you need to do Insert, Update and Delete. If we want to make a reliable and high performance system then these four operations must be implemented by stored procedures. Stored procedure also prevents Sql Injection attacks and reduce network traffic.
A stored procedure is a precompiled set of one or more SQL statements that is stored on Sql Server. Benifit of Stored Procedures is that they are executed on the server side and perform a set of actions, before returning the results to the client side. This allows a set of actions to be executed with minimum time and also reduce the network traffic.
A SQL Injection attack is an attack mechanisms used by hackers to steal sensitive information from database of an organization. It is the application layer means front-end attack which takes benefit of inappropriate coding of our applications that allows hacker to insert SQL commands into your code that is using sql statement.
SQL Server 2008 and 2005 have five system defined databases: master, model, tempdb, msdb, and resource. These databases are used by SQL Server for its own operation and management. Let’s see these database use and function.
In Sql Server, we have group by clause for grouping the records of the database table(s) according to our need. We use having clause to filter data that we get from group by clause.Having clause operates only on group by clause means to use having clause we need to use group by clause first. Lets go through both the clauses.
xml data type was introduced in SQL Server 2005 to work with XML data. Using this data type, we can store XML in its native format and can also query/modify the xml data within the xml. We can use xml data type like as :
|
10
SEP
|
ASP.NET MVC with AngularJS Development (offline) | ||
|
Sat, Sun (11:30 AM-12:30 PM |
More Details | ||
|
13
AUG
|
NodeJS Development (offline) | ||
|
Sat, Sun 05:00 PM-06:30 PM |
More Details | ||
|
12
AUG
|
NodeJS Development (online) | ||
|
Mon-Fri 06:00 AM-7:30 AM IST |
More Details | ||
|
10
AUG
|
ASP.NET MVC with AngularJS Development (online) | ||
|
Mon-Fri 09:30 PM-11:00 PM IST |
|||
|
1
AUG
|
ASP.NET MVC with AngularJS Development (online) | ||
|
Mon-Fri (07:30 AM-09:00 AM IST) |
|||
|
24
JUL
|
AngularJS Development (offline) | ||
|
Sat,Sun (08:00 AM-09:30 AM) |
|||
|
24
JUL
|
ASP.NET MVC with AngularJS Development (offline) | ||
|
Sat, Sun (09:30 AM-11:00 AM) |
|||