HI WELCOME TO KANSIRIS
Showing posts with label SQL server. Show all posts
Showing posts with label SQL server. Show all posts

How to insert values to identity column in SQL Server

Leave a Comment
Identity field is usually used as a primary key. When you insert a new record into your table, this field automatically assign an incremented value from the previous entry. Usually, you can't insert your own value to this field.In this article, I am going to expose the tips for inserting your own value to this field. It is simple and easy. Consider you have the following Customer table.CREATE TABLE Customer( ID int IDENTITY, Name varchar(100),.

Difference between inner join and equi join and natural join

Leave a Comment
SQL join clause is used to to retrieve data from two or more database tables. Inner JoinThis is the most used join in the SQL. this join returns only those records/rows that match/exists in both the database tables.Inner Join ExampleSELECT * FROM tblEmp JOIN tblDeptON tblEmp.DeptID = tblDept.DeptID;Inner Join ResulttblEmp.NametblEmp.DeptIDtblDept.NametblDept.DeptIDRam1HR1Raju2IT2Soya2IT2Sam3ADMIN3In the join condition, you can also use other operators like <,>,<>.Equi JoinEqui join is a special type of join.

SQL Server Naming Conventions and Standards

Leave a Comment
In programming, we have many naming conventions like camelCase, PascalCase, under_scores etc. But each and every organization has its own naming conventions. In this article, I would like to share some common and useful naming conventions and standards that you should use while programming with SQL Server.TableTables are used to store data in the database. The naming conventions for a table may have a "tbl" prefix, followed by the table name. Moreover, TableName should be plural. The syntax should be "tbl<TableName>".Examples.

Swap the values of two columns in SQL Server

Leave a Comment
Do you have fun with SQL Server?. Let's start fun with SQL Server. Suppose you want to swap the values of two columns of a table in SQL Server, how could you achieve this tricky task?. Actually, it is simple and so funny.Suppose you have a Customer table in the database with the following data and you want to interchange the values of columns Name and Address then how do you do? SELECT * FROM CUSTOMER Don't worry, to do this task, you.