Download ms sql server management studio express

You have to know the name of the Table(s) that were created / inserted into your database by the script.

Presumably your SQL script already did that, otherwise you would have seen errors when the script ran (but it appears from your screen shot that you have "1 rows affected" messages, which probably means that a row was inserted into a database's table.

You probably were not able to see any error messages during the running of the script ... so you won't know if all rows were successfully inserted. However, the fact that the script finished showing all "1 rows affected" messages is a good sign - the script most likely did create a database.

Start your SQL tool and use this command to view the database names:

SELECT name
FROM sys.databases
ORDER BY name
GO

ignore "master", "tempdb", "model" and "msdb". Hopefully there is just one other name, and that will be your database. I'll call it "YourDatabaseName"

Then you can "connect" to that database with:

USE YourDatabaseName
GO

Once you are connected to the right database you can see what schema and tables it contains:

SELECT	[TableName] = S.name + '.' + T.name
FROM	sys.tables AS T
	JOIN sys.schemas AS S
		 ON S.schema_id = T.schema_id
ORDER BY [TableName]
GO

If you see a schema / table that you like the look of type:

SELECT	TOP 100 *
FROM	dbo.YourTableName
GO

which will show you the first 100 rows (i.e. as s sample)

Once you have decided on which tables you are interested in then you can export them to Excel. Probably best to use the SSIS tool for that if you have that installed? Other people here may have suggests on how you can best export your database to Excel, given that you have zero knowledge of the tools available and how to use them it would clearly help if you have the "easiest" method, starting from that base.

NOTE: I presume you were not able to see any error messages when you ran your script, as they would have scroll up / off the screen very quickly. Thus you should review the data (once you have exported it to Excel) to make sure nothing is missing.

You can also do:

SELECT	COUNT(*)
FROM	dbo.YourTableName
GO

which will tell you how many rows are in the table. You could use that to check that you have exactly the right number (compared to the original database that your script was created from)

Also beware that your script was very big, and it might be that there are too many rows in the table to be able to export to Excel. (I've forgotten what the size limit is in Excel, it used to be 32K, maybe it is "huge" now?)

1 Like

Hi,

I want to create new database. I have:

  1. .sql file (image size 5GB).
  2. Installed microsoft sql server

how to create new database, what are the requirements needed for this, except above 2.

Pls advise me asap.

Really appreciation for your kind assistance.

Please refer to below
Create a Database

Hi,

If i use the link: https://msdn.microsoft.com/en-sg/library/ms186312.aspx

i can`t able to create new database and also im not able to import my .sql file.

For another method:

When i tried to import .sqlfile to toad and tried to create new database, get an error as:

Out of memory.

May i know how to import through toad or Microsoft SQL management studio?

Please assist on this.

Why you can't create new database ? How are you doing it ? Using Mangement Studio or Transact SQL ?

Any error message ?

Post the SQL code. Or are you the one with the HUGE sql file?

Hi,

Yes. I have the huge .SQL file. But i would like to create database using that huge .sql file in microsoft sql server management studio.

Pls assist on this.

Thank you.

You haven't replied to either of the messages I posted to help you earlier. Please do so.

Your previous attempt appeared to work using SQLCMD - but as you did not save the output to a file, if there were any errors you won't have been able to see them as they scrolled up the screen and you can't check the file, retrospectively, to check for any errors. (In any event the output would have been huge, so trying to find any errors in such a file would be a "challenge")

I think it is very unlikely that, without more knowledge about MS SQL than you have, that you will be able to "just use" the SQL script that you have. Therefore I suggest that you either ask the person who sent you the SQL script to, instead, send you a Full Backup File (which it will be easy for people here to help you restore onto your computer), or you ask someone with more MS SQL knowledge to modify your script so that it will run safely on your machine and create the database etc.

The reason I say this is that it is likely that your script uses a specifically named database, and creates it on a specifically named drive in specifically named folders (all/any of which may not exist on your computer). There are a whole host of similar things which could go wrong which someone with a bit of MS SQL knowledge will easily be able to solve but if you do it on your own, with the help of a forum like this, it will take "for ever" and may well destroy something useful (e.g. by overwriting it, or deleting it) on your computer.

Links to my earlier posts:

forums.sqlteam.com/t/download-ms-sql-server-management-studio-express/4708/41

forums.sqlteam.com/t/download-ms-sql-server-management-studio-express/4708/32

1 Like

Hi All,

Thank you for your everyones kind support. But i did not get the info.what im expected.

Actually i would like to create new database in microsoft sql server management studio 214 using .sql file (its size was 5.89GB).

I need to know the proper steps and procedures..If i import this file to MSSQL server management studio getting error, if not I used the below script:
USE master ;
GO
CREATE DATABASE maximo_2
ON
( NAME = Sales_dat,
FILENAME = 'c:\testtdatt.mdf',
SIZE = 10,
MAXSIZE = 50,
FILEGROWTH = 5 )
LOG ON
( NAME = maximo_log,
FILENAME = 'c:\testtlogg.ldf',
SIZE = 5MB,
MAXSIZE = 25MB,
FILEGROWTH = 5MB ) ;
GO

comment executed successfully.But i could not able to view my database, .mdf and .ldf file could not be executed too.
Im really not too sure how to get my new database in proper manner.

Dear Experts please kindly give me a suggestion. Really need your great help.

Thanks.

Hi Experts,

Any updates for my above request.

Still no answer to my questions ...

sorry....why not power shell?

example

$sql = Get-Content D:\test.sql

Write-Host $sql

Invoke-Sqlcmd -Query $sql -ServerInstance "localhost"

Personally I don't think that runing the script is the problem; because the script was generated on a different server it may well be completely inappropriate for the current environment (location of files etc. or assumption that DB, of specific name, exists, or chance that that DB does exist and is pre-DROPPed / whatever). Also the need to check for errors - all the output is going to go flying up the screen!! and even if diverted to file if the script is full of INSERT statements (and no NOCOUNT statement) it would be impossible to see the wood for the trees ...)

As I said earlier, but O/P has not bothered to respond, I don't think it is possible for someone with no experience of SQL to create and populate a database from a "database dump" script provided by 3rd party and using only Forum for assistance.

it needs either:

  1. Some help from someone with enough SQL experience to be able to review/adjust the script to run safely and make sure that any errors are both found AND dealt with (including ignoring them if it is deemed safe & appropriate to do so ...)

  2. Get the original provider to provide a Database BACKUP. That would be trivial, by comparison, to get help from a Forum to RESTORE. Note that the backup must be made from a version of SQL that is not newer than the O/P's and also not more than 2 versions earlier. (It is not possible to Restore backups from "very old databases" onto a "much newer version").

But I am talking to myself so will now give up.

Im new to powershell too but i believe it can help, just use the piping thingy and output the result so later on can debug based on the outputed text file. Assuming the file is generated from ssms scripted database.....op might had to debug from start to end and this topic will be a never ending story and he/she might become one of the sql pro in the future. Hahahahahahahaha

Hi Expert,

I had tried to create database by using microsoft sql server management studio, really got very tired..
My size of the data is 5GB. Really im very new for microsoft sql server, shall you knows anyone for most expert to assist me to create databse.

My expertise:
->Would like to create database.

On hand:
->5GB data, which is .sql format data.
->Installed microsft sql serevr management studio
-> have sqlcmd command prompt.

  1. how i can create database with help of above on hand items. ?
  2. What are the steps and what is the query i can used for that?

Can you pls assist on this.

No. I tried ... several times ... but you don't answer any of my questions, you just keep asking the same one each time ...

The best option I think is to go back to the party that provide you with the file. Ask for detail instruction on what is it / how you should do with the file.

Hi Kristen,

Can i know actually what is your question.

Pls send me the qn again.!

Thanks

Hi Khtan,

The file was extracted by myself from our othet server.
Now would like to create teating database by using this file.

how do you extract it ? Can you just perform a DATABASE backup instead ? It is much much much easier to handle it

Just use BACKUP instead, like I suggested back on the 19-January.

They are all in this thread. But if you need links here they are:

19-January
http://forums.sqlteam.com/t/download-ms-sql-server-management-studio-express/4708/32

22-January
http://forums.sqlteam.com/t/download-ms-sql-server-management-studio-express/4708/41

12-February
http://forums.sqlteam.com/t/download-ms-sql-server-management-studio-express/4708/48

29-February
http://forums.sqlteam.com/t/download-ms-sql-server-management-studio-express/4708/51

01-March
http://forums.sqlteam.com/t/download-ms-sql-server-management-studio-express/4708/53

1 Like