Showing posts with label folowing. Show all posts
Showing posts with label folowing. Show all posts

Wednesday, March 7, 2012

Help Updating Tables From TAB File

Hi All

Im Really New To SQL Server and need to do the folowing - if anyone can help out i will be VERY happy :)

i have a single table in sql server containing products im selling

withing that table is 2 fields that i need to be able to update without changing any of the other fields in that line. (i need to be able to update price and stock field)

there is a field that is unique (field with the barcode)

the data i need to import is from a TAB text file which contains the barcode, stock and price field

hope this makes sense and if anyone can help thats great

cheers

BenHowdy

You can use DTS to import data which will suck data in from the tab file. However, unless you have a bit of experience with SQL its probably worth trying this on some dummy tables to get it right.
You could use DTS to import the tab data into a new table. Then write some code to work your way through the new table to update the existing production table.

If you wanted to update a column based on a unique column value in a table you could use:

Update <tabel_name>
set <column_to_be_updated> = '<some_value>'
where <unique_column> = '<some_value>'

i.e.

update table_product_data
set saleprice = '100'
where barcode = '097364543'

This ensures only the saleprice column in the table is changed where the barcode column = some unique value. That way you can selectively target a row in a particular column based on a value in the barcode column on the same row. Make sure that the barcode column ( or which ever column you use as the primary key for the table ) has unique values, otherwise you may get multiple rows in the saleprice column being updated at the same time.

Post back if probs.

Cheers,

SG.|||thanks for the reply

the problem is i am cool getting it to update 1 record its getting it to run thro a massive tab file and updating about 1500 prices

any suggestions for a thick person ?

cheers

ben|||right i have realised how to do this now - if anyone can give me some example code for in sql to loop thro i have made it import into a new table and i under stand the code you put before but im not sure how to make it loop thro

hope that makes sense!

cheers

ben|||Hi there!

Here I can give you a little example code. Let's say that:
1. "original" - is the table in the database
2. "new" - is the table which has been filled with the data out of the TAB file

update original
set original.stock = new.stock,
original.price = new.price
from original
,new
where original.bar_code_id = new.bar_code_id

Hope that helps you further. If not, post a reply!

Greetings,
Carsten

NOTE: This will not bring any new bar_code_id into "original"! It just updates existing id's|||thats great thanks

will that loop thro each result in the table new ?

thanks for the help

Ben|||you both rule!

its all working now:D:D - you cant believe how happy i am

please both check you private messages

thansk ben

Sunday, February 26, 2012

Help Start with MSDE???SA password??

While installing the MSDE I get the folowing error:
A storng SA password is required forsecurity reasons.
Please use SAPWD switch to supply the same.
Refer to readme for more details.
Setup will now exit.

Thanks in advance

MustaphaThe installation instructions that came with your version of MSDE should include help on how to do this.

From where did you get MSDE?

Terri|||Hi,
If you need to change the sa password after the install, and you can uses the osql command line tool that will be available through your computer's command prompt.

If you don't know what a strong password is - it's one that meets certain criteria that make it harder for a hacker to break. I belive the min length is eight characters, it should contain a mix of at least three types of characters - upper case, lower case, numerals, punctuation marks (spaces are allowed). I'd opt for a 'pass-phrase'. Because you can use spaces, etc... you can use a phrase rather than just a string of alpha numeric charcaters. A medium length phrase, 40 charcaters or so, that mixes case and has some numerics is eaier to remember (without the need to write it down; a security problem in itself), and hard to crack.

Never leave the sa password blank.|||

I hope you get this. I am having the exact same trouble and the instructions don't tell me how to deal with this. I didn't have this problem the first time I loaded the program back in September but since my computer crashed and I had to reinstall everything, I am now having to fix this. I used the disc that came with the book and I also tried the version from this site.

Do you have any ideas?

Carolyn (crowbare@.sbcglobal.net)

|||

The reason you're seeing this message is that the MSDE installation executable expects you to pass the parameter to the installer when you run it. It's not intuitive that you have to do this, so when you double-click the download file you will see an "error" indicating that you must specify a strong password.

To avoid this, open a command prompt and navigate to the directory in which the installation file was saved. Call the help on that file by executing my_msde_install_file.exe /?. It will tell you the appropriate switch to use to set the password at runtime.

Hope this helps.