Creation of sample data in database tool # sqlserver - sql-server

I need a database tool where i can easily add information to it.
Example:
I have 2 tables, customers and invoices. The database tool must show me input fields of the customer and invoices. invoice has a foreign key to customer. The input fields of invoices must have a dropdown where i can select the customer so i won't have to copy paste the ID of the customer.

The tags on your question suggest you may be creating test data. Have you considered a tool like RedGate's Data Generator?

If you want to enter the sample data manually (that's how I understood your question), Microsoft Access sounds like the tool of choice here:
Create a new Access DB and link to the SQL Server tables. Enter the customers directly in Table view. For the invoices, use the wizard to create a form, then create a combobox that references to the customers table.

Related

Insert data into SQL tables manually using the related columns in Management Studio

I am trying to insert data into some related table in SQL Server 2008R2 and I am trying to figure out whether there is an easier way to insert data manually (visually) using the related columns and not the IDs. If you check the two snapshots of the tables and table WFUserGroup basically I am trying to see if I can have a bound query (like in MS ACCESS) where I can see the Name column instead of the ID and the name of the Group instead of the group_id
I know that with a TRANSACTION block and INSERT INTO statements I can create a new user in WFUser table and then relate it to a group in the WFUserGroup table, but I am telling myself there should be an easier way. Anyone knows a workaround?
Tables:
Using Edit Top 200 Rows Feature:
You could use a flat file with data in a .csv or excel and use the Import feature in SQL server.
how to navigate, right click on the database and tasks--> Import then the wizard to select the necessary file and tables.
I do see that there are primary key and foreign keys so you have to make sure that its considered in your files you are going to import.

Generate DDL (Create) in SSIS from an Input Source

Suppose you have an Source Component and you are doing a simple One-to-One data load to a Desination Component. A Sample screenshot is as below:
Now when i open my Destination component, i find that it asks me to enter the name of the table where the data would be loaded.
In the dropdown, i find that the names of the table are getting populated which are already present in my database.
My queries are as below:
Do i need to manually create the tables in the database first and then only i can execute the data flow?
Is there any way, i could get the all the Source columns and generate a DDL statement to create the table, if required. I am NOT asking for dynamically creating a table. Just a possible solution to get all you input columns and data-types lists and then auto-generate a sample DDL or SQL query.? (Imagine a scenario where in you have 200-500 columns in a text file/flat file,, manually creating a table with all the columns gets tough)
N.B: Integration Tools like Pentaho Kettle provides you with a similar feature. You don't have to worry about table creation. If its not present, you can use kettle feature to create one in the database.
It would be really helpful if anyone can help me in this. I am also a newbie to SSIS. Not much of a knowledge. Thanks :)

Updating Tables In SQL Server 2005 Using Access 2010

Very new to the world of advanced access and SQL Server 2005. I have now developed all my tables in SQL Server and added them to my blank database now in access using a ODBC connection. This topic is just for advice really, what would be the best way for me to create a form so that users within the company can input customer data without having to go onto SQL?
I have three tables 'Customer Table' 'Enquiry Source' & 'Admin Staff' - the 'Enquiry Source' & 'Admin Staff' consist of Enquiry Source ID, Enquiry Source Name, Admin Staff ID & Admin Staff Name which than have a link to the Customer Table.
When updating the tables myself in the SQL Side I use the ID's as integers but now I am in access I would like my users to be able to update these using the appropriate names on a list box. I have created a View in SQL and exported it to access but when I complete all the information and try and save the record it won't allow me to update multiple tables - which I understand is due to it being a View.
Is there an easier way of doing this so my teams can add new customers on the MS access front end system?
The Enquiry Sources are names of methods of referal: Newspaper, Recommendation, Google etc
The Admin Staff are names of employees creating the Customer.
Thanks Guys!
Callum
Link the three tables or three simple views on the tables. Use the form wizard to create a form based on the customer table. Use the list box or combo box wizard to create a control based on each of the two look-up tables. See create form to add records in multiple tables for some notes on how to use the wizards.

Strategy for seeding a DB

I just started working on a .NET project that uses a SQL Server DB. I was given a script that setup the database with all the tables, SPs, etc. but no data.
My initial impulse was to go into the DB and manually type in some dummy data to setup a couple users, etc. just so I can get started using the application. However, every time I try to add a record, foreign key constraints get in the way. Unfortunately I can't show you the schema, but is there a general strategy I could follow for a situation like this?
If you have FK's getting in the way, you need to start entering data in all the 'master' tables. Then you can enter data into your child or detail tables.
For example, say you have an Orders table and a Customers table, and a FK in place between Orders and Customers. The 'master table' would be Customers and the detail table, in this example, would be your Orders table. You'll probably need to enter a few customers first, so that when you enter an order, you can assign a customer to it, and not get a FK error because there is no customer.
I suspect this example is pretty close to the type of problem you're running into.

Delivering updates to an Access database application

I am creating an application in Microsoft Access. This is for a small database that the customer will run on a desktop. No network of any kind will be involved. All the necessary files to use the database must be on a single desktop computer.
I want to deliver the app to my customer in stages. Most likely I will email the .accdb file to the customer. How do I deliver an update and maintain any data already entered by the customer? Updates may include changes to the table structure as well as to forms.
The answers given to my original question address the issue of changing forms and other UI elements. However, what if I want to add a table or add column to an existing one? How do I seamlessly deliver such changes while preserving as much data as possible on the user's end?
Split the database and the interface into separate files. Google should have plenty of information as this is typical for MS Access apps.
Here are a few resources to get you started:
How to manually split a Access database in Microsoft Access
Splitting an Access Database, Step by Step
You absolutely MUST (!) split your database into two parts. A backend part storing the tables ("the database") and a frontend containing the forms, reports, queries and application logic ("the application"). Link the tables from the backend to the fontend.
The frontend might also contain tables with control paramameters, report dictionaries etc., but no data that your customer enters!
Newer versions of Access have a database splitting wizard.
You might need a code that automatically links the backend to the fontend on the customers site.
UPDATE
You have two possibilities to alter the schema of your database on the customers PC.
1) Do the Updates through the DAO (or ADOX) object models. e.g.
Set tdf = db.CreateTableDef("tblNew")
tdf.Fields.Append tdf.CreateField("fieldname", dbText)
...
db.TableDefs.Append tdf
2) Use DDL queries
CREATE TABLE MyNewTable (
ID AUTOINCREMENT,
Textfield TEXT(50),
LongField LONG,
...,
CONSTRAINT PK_MyNewTable PRIMARY KEY (ID)
)
Or
ALTER TABLE SomeExistingTable ADD COLUMN Newcolumn Text(50)

Resources