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