when you excute sql query in sql management studio System.OutOfMemoryException SQL Management Studio

C:UsersGaurav>cd documents
C:UsersGauravDocuments>sqlcmd -S GAURAV-PCSQLEXPRESS  -d ifsc_code  -i ifsc.sql
Msg 4060, Level 11, State 1, Server GAURAV-PCSQLEXPRESS, Line 1
Cannot open database "databaseName" requested by the login. The login failed.
Msg 18456, Level 14, State 1, Server GAURAV-PCSQLEXPRESS, Line 1
Login failed for user 'Gaurav-PCGaurav'.

you need to create database first then you need to write cmd in and put script file in Your Document Folder

and write following code in 

C:UsersGauravDocuments>sqlcmd -S server_name  -d database_name  -i filename.sql