Skip to main content

Featured post

How to Insert line break in Text component in React Native

Hi, I was developing an application in react native.I have to handle lots of text data in this small react native application.I have used  Text component in react native many times. While working on this application,i had a requirement to display some text content with line breaks.I will explain it clearly with an example.I want to display a text as shown below  Welcome Please subscribe my channel I wrote react native code as shown below <View> <Text> Welcome Please subscribe my channel </Text> <View> When i run these lines of code,It will display text as shown below Welcome Please subscribe my channel   - instead of displaying in two lines with line break,it displays in a single line.So i have to find a solution to insert line break in Text component in React Native.After lots of research,i found a clean solution as shown below <View> <Text> Welcome{"\n"} Please subscribe my channel </Text> <View> Here ...

Delete vs Truncate in SQL Explained

Hi friends,

Today we will have a detailed discussion about Delete vs Truncate in SQL.Even though they looks similar they have significant differences in SQL.I will explain each and everything in detail with the help of Images.So it will easily understandable for you.


Create Table Customer and CustomerID column as identity




Insert Values into Customer Table



Select Query on Customer Table






Delete Query on Customer Table




Insert and Select Queries in order after Delete operation



Look in the above image,After deleting a row whose CustomerId is 2,then we entered a new row but it is having CustomerId =3 not 2.This is happening in Delete operation whose column having identity as constraint 


Truncate command on Customer Table








Insert and Select command in order after Truncate Command


By checking  the above image,We know that after truncating the table ,when we insert a new row CustomerID column is having a value of 1 instead of starting with 4 as worked with delete command.
This is one of the difference between Delete vs Truncate in SQL.Even though CustomerID column is identity type,after truncate command,it starts from beginning. But in delete command ,it will continue from last entered CustomerId value.




Below Image will explain What will  happen when use Rollback command after Delete command in SQL






Below Image will explain What will  happen when use Rollback command after Truncate command in SQL





Thanks