Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Easy data entry in SQL Server

Author  Topic 

token
Posting Yak Master

133 Posts

Posted - 2006-01-22 : 13:36:41
Hi all,

I have been using SQL Server 2K for a couple of months now and I have been entering data into my tables through Enterprise Manager. I do this by selecting the table, right-clicking on it, and selecting Return All Rows.

After months of use, this method of entering data has become tedious and cumbersome. Is there an easier way to enter data into SQL Server? I don't know how to program Visual Basic, but I know how to create dynamic websites.

Microsoft Access offers the ability to make Forms, so that data entry is easier. Can SQL Server offer anything similar? Maybe SQL Server 2005 offers a GUI for data entry?

Cheers for your help!

spinoza
Starting Member

49 Posts

Posted - 2006-01-22 : 14:29:10
I am not an expert but i know that there is a way to insert data using QUERY ANALYSER.
The command u can use to insert the data into a table is the INSERT command.
I am sure that the folks here will tell you more about this soon.
Go to Top of Page

svicky9
Posting Yak Master

232 Posts

Posted - 2006-01-22 : 15:07:10
In query analyser its better to create a procedure


create procedure procedure_name(param1,param2...param3)
as
insert into table_name(col1,col2...,coln) values(param1,param2...paramn)


http://www.awprofessional.com/articles/article.asp?p=25288&seqNum=4&rl=1

Go to Top of Page

Wanderer
Master Smack Fu Yak Hacker

1168 Posts

Posted - 2006-01-22 : 16:43:13
This should really be done via a program. Fortunately, there are many alternatives for you.

You can make use of Access, and it's forms, and link to the SQL Server database. I don't recommend this, but that is beacuse I'm biased against Access, and don't use it.

An option you could consider is making use of the object browser, and templates.Open Query analyzer, sign on to the specific server with a userid that has sufficient rights (select, insert, update maybe) on the tables you want to change. Hit f8 - this should open the object browser on the left (unless it was already open - in which case it will close it ). Browse through the databases, then hit the + on your DB. Do the same for User Table. Whe you get the table you want, select it, the right-click and drag to the main pane, and release. This should open a menu for you - you will want "insert". This creates a statement that you can now save as a template for the inserting into that table (until someone changes the structure - so remember that!). When you want to sue the template, press ctrl+M (I think that's right - or else it is ctrl+shift+M ... writing this at home ). That will give you a pop-up where you can enter your data. You should, imho, then save that script before running it, so you have a trail, and can redo it.

Of course, writing an application to do data entry is where you SHOULD be - I'd be driving for that as the end-goal, but the above will work in a pinch!

*##* *##* *##* *##*

Chaos, Disorder and Panic ... my work is done here!
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-01-23 : 00:26:57
Dont use Enterprise Manager to enter data to a table. Use Query Analyser, Front End Application, DTS or bcp

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

token
Posting Yak Master

133 Posts

Posted - 2006-01-23 : 06:23:38
Thanks for those replies :D

I guess it would be ideal for me to make an Front End App then. Because I need to retrieve data in a more readable format as well. My database holds data on products (e.g. laptops) and I find it hard to find what I want using Enterprise Manager.

Is Visual Studio the software I need to learn to make a Front End Application for SQL Server? I know a bit of Java but I'd rather not use it beacause its too difficult to work with.
Go to Top of Page

mr_mist
Grunnio

1870 Posts

Posted - 2006-01-23 : 07:31:13
It sounds like you are getting bogged down in the technical specifications rather than looking at simplifying what you need to do.

What process are you trying to achieve?
How often do you do it?
Where does the data come from?

If you can answer some of those questions on here people might be able to suggest a method.

-------
Moo. :)
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2006-01-23 : 08:55:56
Along the same lines, when you say data entry, what are you talking about? For your users, or for yourself while developing and testing and setting up the appplication?

For users, of course you want to deploy as secure, user-friendlty application. For yourself, I find that Access is excellent for doing initial data entry, writing some quick reports to see how things look, storing some data locally for testing and moving from one point to the next, etc. Access is a great tool; it is clearly not a true client/server app designed to serve multiple users accross a network, but as a client application or as a single user database it is excellent.
Go to Top of Page

token
Posting Yak Master

133 Posts

Posted - 2006-01-23 : 09:40:02
I am trying to create an online shop. So first I am making my database by placing all my products into SQL Server. I made some tables e.g. Products, Availability, Manufacturers.

Now I am entering in my data (e.g. product name, specifications) into the tables using the Return All Rows screen in Enterprise Manager.

I am looking for some kind of Front End Application that allows me to view all my records in my tables and also insert records into my tables. MS Access lets you do this by creating a Form. Essentially I need a front end that will let me retrieve, insert, update, and delete records.

Any ideas? Someone told me I need to make this front end in Visual Basic, which means I now I need to learn that software. I was thinking there must be an easier way.... maybe I can make a dynamic webpage that connects to the database and allows me to alter the database how I want?
Go to Top of Page

Wanderer
Master Smack Fu Yak Hacker

1168 Posts

Posted - 2006-01-23 : 10:08:21
Given what you've added, the option I listed for using a template might not be the best way to go. Still, I would advice you to go through the exercise I outlined, as it will show you the kind of SQL you might need to write.

As Dr. Cross Join mention, an access front end could do this job for you. Personally, if you are talking about an online store, and money, I feel you need to be looking at secure, access controlled and robust front-ens. Hence the suggestions around VB or .Net applications. I think Mr Mist put it best... try and distill exactly what you need (sounds like you are getting there), then consider your circumstances: is it a 1-man shop, or are you part of an SME (or larger) where you need to have security?

Consider that if it is easy to "alter" the online stores pricing, then places an order for all the stock at that altered price - how do you dispute/prove the fraud etc.

Again, especialy if this is for a company, this might be an excellent way to learn something new, useful and marketable, while doing the right thing for the company!

Well, have fun and good luck...

*##* *##* *##* *##*

Chaos, Disorder and Panic ... my work is done here!
Go to Top of Page

mr_mist
Grunnio

1870 Posts

Posted - 2006-01-24 : 03:51:38
For an online shop you mind find that writing your own front end (in either VB or using VBscript etc through a web interface) is preferential to manually entering data using query analyzer or similar, and more useful for getting that same data back out again. You may have to put in a bit of initial effort into developing the system, but then if you weren't bothered with that then you wouldn't be here because you'd have purchased one of the many systems already available online to host your shop.

-------
Moo. :)
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-01-24 : 08:43:17
How are you going to make "forms" for the users of shops to enter their data?

I suggest you just make some additional "admin" pages that are only available to appropriately logged in users, and then you can use your own shopping-site admin area to enter the products.

Plus everything is self contained - the database connection etc. - and if you have multiple shops then you will already have the tools in place to administer the data - and it will be multiuser - anyone with an Admin login will be able to do the product maintenance.

Kristen
Go to Top of Page
   

- Advertisement -