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
 Help with SQL file

Author  Topic 

lantern497
Starting Member

3 Posts

Posted - 2012-03-12 : 09:55:26
Hello,

I work on a company where I have to type tons of stuff everyday, and it's an exhausting work, I must say. So, I came up with this idea in which I could create a SQL file from a .xls (excel file), containing, for example, the product number and its quantity, that is what I type. I'm a total dummy on SQL, but I started reading some books about it. Is there anyway to implement this, any suggestion, where to start from etc?

Thank you.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-03-12 : 09:58:32
sorry what should .sql file contain? just productnumber and quantity? what use will it make? or do you want to form a query including them?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

lantern497
Starting Member

3 Posts

Posted - 2012-03-12 : 10:31:47
sorry what should .sql file contain? just productnumber and quantity? what use will it make? or do you want to form a query including them


The system would interprete two inputs: productnumber and quantity.. Sorry, I don't know almost nothing about SQL, what is a query?

I would like to know if it is possible to do this: make a system interpret a sql file and include it to its main database, and create this SQL file from an excel file, for example.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-03-12 : 10:34:42
.sql file means it should have a sql script like create table,insert etc. With just two values alone (productnumber and quantity) its not a script. So thats why i asked is the attempt to generate sone kind of script with them ie may be an insert script to insert these values to a table?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

lantern497
Starting Member

3 Posts

Posted - 2012-03-12 : 10:37:34
i guess so, it would be like a script to insert this data on the main database. how would I make this script, what kind of file would it be?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-03-12 : 10:40:37
you can generate the script using excel formula itself. but for automating it you might need a macro to be written in excel to generate and save it in some location.Then you can add a sql agent job to execute the script to do the insert

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -