Showing posts with label SQL Server. Show all posts
Showing posts with label SQL Server. Show all posts
Monday, March 20, 2017
What is Common Table Expression in MS SQL Server?
We can think of common table expression as a temporary result set that is defined within the execution scope of a single SELECT, INSERT, UPDATE, DELETE, or CREATE VIEW statement. It lasts only for the duration of the query and can be referenced multiple times in the same query.
What is linked server?
Linked Servers allows us to connect to other database instances on the same server or on another machine or remote servers. It allows SQL Server to execute SQL scripts against OLE DB data sources on remote servers using OLE DB providers.
After setting up the Linked Servers we can easily access the other server tables, procedures etc.
Once the connection is established, we can start with the CRUD operations. The advantage is about security; its works on Windows as well as SQL Server Authentications.
In Sql Server we refer as linked servers and in Oracle we refer them as database links.
Sunday, March 19, 2017
What is stored procedure
A stored procedure is a set of Structured Query Language (SQL) statements with an assigned name, which are stored in database as a group, so it can be used and shared by multiple programs any number of times.
Wednesday, March 8, 2017
What is a "Table", "Record", "Field" ?
A table is a collection of records of specific type.
Ex:Employee Table, Salary Table.
A record is a collection of values/specific entity.
Ex:Employee, Salary.
A field is an area within a record for a specific piece of data.
Ex:Employee Name, Employee Id.
Ex:Employee Table, Salary Table.
A record is a collection of values/specific entity.
Ex:Employee, Salary.
A field is an area within a record for a specific piece of data.
Ex:Employee Name, Employee Id.
What is a foreign key?
When a 'one' table's primary key field is added to a related "many" table in order to create a common field which relates the two tables , it is called foreign key in the "many" table.
What is a primary key?
A primary key is a column whose values uniquely identify every row in a table. It should be unique and not null.
How to reset column identity in SQL server?
Sometimes we delete rows from a table and the identity will not start as expected from one, it would assign a random value. In order to reset the value we have to use the following command.
DBCC CHECKIDENT ('[TableName]', RESEED, 0);
GO
Saturday, March 4, 2017
Using Column Names "FROM" and "TO" in a table and trying to lnsert data into table
When in a database if you have a table with column names "FROM" and "TO" you should be careful while trying to reference these column names in your sql command.
You should enclose these column names in square brackets so that SQL will identify them as column names and our command works as we expected without any errors.
You should enclose as shown here:
Select CompanyName,[From],[To],Skillset from WorkExperience
You should enclose these column names in square brackets so that SQL will identify them as column names and our command works as we expected without any errors.
You should enclose as shown here:
Select CompanyName,[From],[To],Skillset from WorkExperience
Subscribe to:
Posts (Atom)
Call a function in child component from parent component in React
Consider the following parent component class Parent extends React.Component { constructor(props) { super(props); thi...
-
The process of replacing a module with generic and mostly empty object, called a mock. Advantages: Isolates our code from its dependen...
-
When we create a class or struct, its constructor is called. Constructor will have same name as a class or struct and is usually used to ini...
-
What is Git?? Git is a version control system for tracking changes in computer files. It is developed in 2005 . It is distributed vers...