How to create Linked MS SQL Server in Management Studio?

Creating MS SQL Linked Server means that you can access your remote MS SQL database (on other server) like it is local.

Syntax to access some data is as simple as that:

[linked server name].[database name].dbo.[table name]

Official Microsoft documentation is really sometimes hard to use. A lot of information but none practical example of usage.


Google search also didn’t helped much on the first try. After few tries I finally found out how you can add MS SQL Linked server to your existing database server.

So, you need first to add new linked server going to Server Objects > Linked Servers and then right click with mouse and choose New Linked Server… and you will end up with something like this (what to fill here is the real mistery):


I gave up with this and I finally found the SQL command to do this properly:

EXEC master.dbo.sp_addlinkedserver
@server = N'YOURSERVER\SQL2008,1444', --You can include Your server, DB instance, port in not 1433

--Now set the name of your linked server and access (we used 'Linked')
EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'Linked', @useself=N'False',@locallogin=NULL,@rmtuser=N'sa',@rmtpassword='YourP@@sw0rd'

That’s all folks 🙂

Continue Reading

MongoDB vs MS SQL Server Comparison

We are using both databases for our projects and we can finalize some thoughts on both of them…

Mongo Facts

  • Free – official website is here and you can download it here
  • Because it is using NoSQL concept it is really extremely fast when it comes to the inserts into database. It is almost fast as writing directly into the disk. It is at least 10 times faster when doing inserts.
  • Because is is using NoSQL there is no scheme, you just store your object into database (JSON serialization is done automatically) and when you later add some fields into your business object you don’t need to update scheme for table, just instert it and DB will take care of  everything
  • It is not user friendly when it comes to writing more complex queries especially for grouping especially when you figure our that standard group option is limited and for returning more then 20,000 records you need to use map-reduce
  • When it comes to complex reading, especially grouping it is much slower when this operation need to be done on large group of records. If number of records is small it is still faster then MS SQL.
  • Disk consumption will remain unchanged, even when you delete some records so you will need to do manually optimization to reduce the database size – it can be long operation
  • The more memory you have and tha faster HDD you have (SSD is recommended – this expensive Intel 700 server series) it will work better because it tries to keep all indexes in memory and if number of records is big and you have more then one index then the size of these indexes will grow. We are talking here about maximum RAM capabilities you are able to put into the server.
  • Still there is some issue with a thrust and questions “Is your data safe?”, “What happen when it crash?”
  • You can write “store procedures” – almost exactly as Javascript syntax
  • Desinged for easy sharding

MS SQL Facts

  • Expensive when compared to free MongoDB, also there is a complicated system of Microsoft licensing (per CPU core)
  • Slower inserts because or relational structure
  • Every table should be designed first, all columns need to have type defined and every change of your business object need that also database need to be changed (not 100% true, but almost)
  • It is very user friendly when it comes to writing SQL queries and joins and very fast (compared to Mongo) when it comes to grouping on a large tables
  • Possibility to use Store Procedures and do complex calculations directly in MS SQL (Mongo has also possibility to write these – similar to Javascript syntax)
  • More easy to lookup your data using nice GUI such as MS SQL Server Managament Studio

Do you need some help in implementing your database model?

We have 15 years of experience and if you need any help please contact us.

Continue Reading