You can use some alias for table in the select query for better readability of the query, Aliases of the table are very useful when you are using complex query with multiple lines. Aliases of the tables in the Sql server are also called as a correlation name or range variable. Continue reading Using Aliases in SQL Server
Joins are used to extract information from more than one table based on the related column/columns means you can retrieve data from two or more tables based on logical relationships between the tables. Continue reading Join in SQL Server
We are going to discuss some points that help improve database performance. Always try keep this point in mind before creating new database or writing query or procedures. Continue reading Improve SQL Server Performance
In this article i will explain you how we can create a stored procedure for inserting, deleting and updating records in the table. and how we can execute that stored procedure using C# language. Continue reading Steps to create and run SQL stored procedure in C#.
Update statement is different from INSERT and DELETE statements.UPDATE statements is used for updating a single records to multiple records. UPDATE statements use a WHERE clause, same as SELECT statement. Continue reading UPDATE Statement in SQL Server
IN operator we use when we Determines whether a specified value matches any value in a sub query or a list. The IN operator allows you to specify multiple values in a WHERE clause.it also helps reduce the need to use multiple OR conditions. Continue reading Using IN in SQL Server
DATEPART() function returns a value equal to the part of a specified date.
where date is the valid date or a string in date format
and datepart can be one of the following:
Suppose you have a table ‘tbl_employee’
The following query return the date of joining of the Ankur:
SELECT datepart("year", DateOfJoin)
Output will be:
Now if you want to current year, you can use the following query:
GETDATE() function return the current date.
DATEDIFF() function is very useful when we are working with date operations. DATEDIFF function return the difference between date items in days, weeks, minutes, years and hours. It can also used with WHERE clause. Continue reading DATEDIFF() function in SQL Server
In Sql Server STR() function converts a numeric value to character data. STR() function allows us to specify the total length and number of decimal places to be included when it is converted to character data. Continue reading STR(), CHAR(), and ASCII() function in SQL Server
DATALENGTH function returns the number of bytes used to represent any expression. DATALENGTH is especially very useful with varchar, varbinary, text, image, nvarchar, and ntext data types because these data types can store variable-length data. Continue reading DATALENGTH() AND COL_LENGTH() in SQL Server