Link to home
Start Free TrialLog in
Avatar of Ian Bell
Ian BellFlag for United Kingdom of Great Britain and Northern Ireland

asked on

How to Browse SQL Server data

Hi,
I have what should be a simple question to answer as it is common with many softwares and that is
How to Browse the data in a table in SQL Server Express 2017 ?
I can't seem to find a browse command even online.
I know I can browse the top 1,000 records but I want to browse the whole records.
Can someone please put me out of my misery
Many thanks
Ian
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

Well most of the  SQL tools implement such kind of restrictions in order to avoid issues with memory/network/locking so its natural to return only a subset of the data.
Depending on the tool you use probably you will find some kind of option to return more or even all of the results...older versions of SSMS seemed to be more browser friendly if my memory serves me right (i have quite some time to work with MSSQL)
If you don't manage to any kind of overriding this limitations you could always dump your records to a .CSV and use either Excel (about to 1 Million Rows) or some kind of text editor (notepad++) to view the data.
On the other hand browsing million of rows is pretty much inefficient...just imagine you are trying to find someone mispelled and you scroll and you scroll until you find it...wouldn't it be better to to add some criteria and narrow down your data so that it is easier to spot it.
Since i am an Ms Access guy ..linking Access to SQL would also get you the FULL set of data for browsing  and/or  if you import them instead (limit is 2GB) you will have FULL browsing with great speed.( I am talking about millions of records)
EDIT: well my memory server me right...older SSMS were more browsing friendly and didn't have such kind of restrictions. Here is a blog talking about the restrictions and how to lift them.What you need is to go to Tools --> Options -->SQL Server Object Explorer -->Commands --> Value for Select Top <n>  set it to 0 and you will get the full set
Avatar of Ian Bell

ASKER

Okay here's what I am trying to do bearing in mind I am a beginner to SQL. I would like to copy the data from one table to another and would like to see if the data has been appended correctly.
ASKER CERTIFIED SOLUTION
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
is this formula correct for creating a new table
CREATE TABLE Table_name  ?
I think you need to take a look at the docs.
In general you are have typed the very first line of the table creation...it would be much better to create the table via GUI...given the fact you are a beginner as you previously mentioned.
I have successfully copied the data from several tables to another table. Using your top command.
Thank you also for the information you provided above. I will study it later today.

If I can't easily browse then how can I easily look at size of table ? That way I can approximate what each table contains size wise comared to destination table. Thanks
Can you give me some more info on why you need the size of the table and how is this affecting you.
SQL Express 2017 has a database size limit (per database) 10Gb which can hold quite some data.
If you want to know the size of your tables then you should take a look here where Pinal Dave has made an excellent script to give you all the size info you want.
I have over 100 columns and as they are the same across all of the tables I found it easier to rename one of them and copy the others into it. But thanks for the link, I have bookmarked it.

The reason for wanting to know the size of the tables is simply a workaround for not easily being able to browse.
example
if I have 5 tables  say 1,2,3,4,5 and each table contained say 1MB therefore 5MB in total
then I renamed table 1 and copied 2,3,4,5 into it
In theory I should have a table size of 5 MB
That is one way of knowing if the table size is more or less correct.
A simple browse function would have been simpler and I'm surprised MS doesn't provide one. I'm not convinced they can't do it.
As i mentioned before tweaking the SSMS would give you full browsing ...
On the other hand...the internal mechanism of SQL is not that linear ...so its much safer to rely on the previous script to make size assumptions.
I'll be looking into the browser tweaking later today.
As you rightly pointed out the GUI is the way to go.
I plan to only use code when absolutely necessary.
Thank you John for having the patience to deal with this old codger :)
Np...whatever you need EE is here...:)