Yesterday I wrote a post with same title. In that post I mentioned using char(1) is also same like using one bit column in table. But it is from the perspective of storage space. But using numbers is less burden to Database engine. It means using 1 and 0 is better than using ‘Y’ and ‘N’. Also in comparing data ...
I installed Microsoft Office 2013 few weeks ago. So in Office as usual there are few enhancement and new things. But I should write a blog post about what I love in Office 2013. It is about Outlook. In Outlook they have added new feature to text area which makes us feel that we are typing faster. When we ...
My previous blog post was about using insert in many ways. You can use SELECT INTO to add data from existing table to a new table. In this statement SQL Server will create a table for you. You just want to write the query and add INTO clause to the statement. Rest will done by SQL Server for you. USE ...
Today I wanted to paste few statements on Live Writer which were coded on SQL Server Management Studio 2012. But when I paste the code into Live Writer I got disappointed about the look. Codes were awesome on SMSS 2012 with colors. Then I wanted to find a way to insert those code with Visual Studio formatting. I found few ...
If you want to synchronize data from another table only for once, you can use this way. When you are going to update from another table don’t forget to give a condition. USE [AdventureWorks2012] GO --Inserting data from HumanResources.Employee and Person.Person to non existing table SELECT * INTO Tmp FROM [HumanResources].[Employee] GO --Retrieving data SELECT * FROM Tmp --Update Using ...
In this example I create a temp table on AdventureWorks2012 Database, and first I load all the data in HumanResources.Employee to the temp table. Then I delete data using HumanResources.Employee. This command will delete all the records in Tmp which has Gender = ‘M’ in HumanResources.Employee table. USE [AdventureWorks2012] GO --Inserting data from HumanResources.Employee and Person.Person to non existing table ...
As I read after installing SQL Server on a System it is a best practice to disable SA account. Then I asked from our architect, and one of prod DBAs. Then I got to know Yes it is a good practice if you disable SA Account, because it is a well known account. And also we can rename that account then there is no point to disable it. Somehow finally I got to know that nobody should you SA account.
Previously I wrote a post about CTE (Common Table Expressions). And Common Table Expressions are valid for a single statement only. But single statement can use many CTEs. And statement also should be within same batch. USE AdventureWorks2012 GO --Defining CTE WITH ctePerson AS ( SELECT * FROM Person.Person ) --First Statement will run SELECT FirstName FROM ctePerson --Second statement ...
At the first date I heard about NoSQL DBMS, I felt insane. Then I got an eager to learn. But I didn’t pay any attention to learn. Later I got to know that MongoDB is a scalable one. Then I got a chance to follow free MongoDB course. Although I registered to both Developer and DBA courses I had no ...
I really suffered while using MongoDB Shell because auto completing was not there. I was very hard to type collection and database names correctly. I wished IntelliSense to get into there. I’m tough Microsoft User. Because of that I love IntelliSense a lot. And there was no any other solution to me to make done MongoDB things easier. Because available ...
For some cases we may have access to database instance of MongoDB as DBA. But we may not have access to Linux or Windows box to shutdown the MongoDB service or MongoDB instance. To Shutdown the MongoDB instance you should be able to log in to “admin” database. If your MongoDB instance is running with “auth” mode you really need ...
In Stored procedures and in our SQL Statement sometimes we need to use same query again and again. In that case you can use CTE. USE AdventureWorks2012 GO --Defining CTE WITH Empl AS ( SELECT * FROM HumanResources.Employee ) --Using CTE SELECT Empl.* FROM Empl GO And you can use several CTE’s in one statement. USE AdventureWorks2012 GO --Defining CTE ...
If you are new to MongoDB you may need to discover the databases and collections (basically objects) on your MongoDB instance. For this easily you can use a GUI tool like MongoVUE. But in this blog post I’m not going to describe about GUI tools. I’m going to explain about MongoShell to navigate through database objects. I can remember the ...
I got few questions to answer quickly in last week just like a test. Then I suddenly answered then after that I tried to find correct answers to them. I found answers for most of them. And one of them was there as it was. A Windows server has 32 GB of memory and dedicated for SQL Server database. Every ...
In SQL Server we use varchar, varbinary to save disk space in our tables. But its not saving data always as it sounds. When the data stores it takes few extra bytes to describe the data length. Because of that there is no gain using varchar(2). If you use varchar(2) it will take 4 or 3 bytes to store data. ...
After the first day of linux training, I got IP, Username and Password for a linux box. But I really didn't know how to log in to a linux box with Credentials. Then I asked from few guys, unfortunately they also didn't know what is the way to log in to linux box. Then I asked from the guy who ...
In the beginning of this week I got a task from Susantha to modify a stored procedure. After the modification I had to test to compare the result sets before modification and after modification. That procedure only returns a data table. So I had so many test data on another table. Then I wrote a script to go through the ...
Until few our ago, I was happy. Thought that happiness came to me with a new friend. Now I’m feeling something very bad. I can’t explain it. It’s a problem with time. If you feel that you are going to loose your world what will happen. I don’t know! I don’t know what to do even. Happiness is a mirage ...