Showing posts with label customer. Show all posts
Showing posts with label customer. Show all posts

Tuesday, March 27, 2012

Automating copy between 3 servers

I'm developing a small app (Access), based on a SQL Server 2000 DB.
Development occurs on 3 DBs:
- Office DB - (MS SQL server 2000)
- Customer DB - (MS SQL server 2000)
- Portable DB - (MSDE 2000)
Since moving continuosly, as a daily routine I have to copy the latest DB,
and currently I use Enterprise manager to do so (backup/restore); boring,
'cause db paths are different on the 3 machines hosting the db servers.
Is there an easy way to automate the exchange between the 3 servers?

if all of your data is moving only in one direction and all of your tables have PK's on them, think about transactional replication.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
sql

Thursday, March 8, 2012

Automated import of XLS to SQL

I have a customer who insists on emailing an excel spreadsheet to me to be uploaded to a sql database. I came across a script at one point that laid out how I would script this out. Basically it was in parts, 1. open email program and get attachment. 2.After saving attachment closing email program in order to be used the next day or next time an attachment was sent. 3. import the attached spreadsheet into SQL database. I would also like to be able to schedule this to run with the built in Windows 2000 scheduler.

Can anyone help me out on this one??

Thanks,
WillWhat email application are you using ... Also, you want to do all these steps within sql as a job ?|||Currently I have it set up with the pre-security patched version of Outlook 2k. I would love to have it set up as one job that launches each morning at 8am. Currently I have a script that I run manually that opens Outlook, saves the attachment, moves the message to a subfolder, sends a confirmation email then closes Outlook. It is a wsf file (see below) but when I try to run it as a scheduled task it doesn't do a darn thing.

Code:
<job>
<script language="VBScript">
dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objOL = WScript.CreateObject ("Outlook.Application")
Set MAPI = objOL.GetNamespace("MAPI")
Set myStore = MAPI.Folders("Mailbox - Tunisia Information")
Set Folder = myStore.Folders("Inbox")
' Open up the Processed Folder under the inbox
Set DestFldr = Folder.Folders("Processed")
For Each myItem In Folder.Items
For Each att In myItem.Attachments
att.SaveAsFile "\\naslc03\data\TunisiaProdData\" & att.Filename
Next
' Move the Mail to DestFldr
myItem.Move DestFldr
Next

' Create mail message.
Set olMailMessage = objOl.CreateItem(olMailItem)
With olMailMessage
Set olRecipient = .Recipients.Add("TunisiaProdData@.pioneernrc.com")
.Subject = "Tunisia Attachment"
.Body = "The Tunisia email message was created was processed" _
& " and the attachment was successfully saved to the S: Drive."
.Send
End With
Set olMailMessage = Nothing

objOL.quit

</script>
</job>|||Good - You can try to implement this within dts, using the activex script task. Once this task is complete, you can import the excel file. The easiest way to set this up if you have not worked with dts before, is to go to Enterprise Manager -> Databases -> The database you want to import into -> tables. Right click on tables -> All tasks -> Import Data. Follow the instructions - making sure at the end to save it. When you have saved it, you can modify the package under Data Transformation Services -> Local Packages. Open your package in design mode and create an activex script task. Insert your code into that task and run that step to see if it will function properly.|||Thanks I will give that a shot and let you know.|||If adding it as an activex script does not work, you can still keep the rest of the package (the excel import). When you create a job based on this package, you can add a step that will execute an operating system command (which would be your script).

Monday, February 13, 2012

Auto Number mysql

I had an access database that i use as an ordering system. I have a
form for entering customer details. When i add a new customer on the
form the customer number is an auto number that appears when i type in
the details.
I have just moved over to mysql server with access as the front end. I
have setup the sql tables with the customer number as autonumber.
When i go into the form and add a new customer it does not generate the
customer Number automaticaly on the form like it did before. once i
have entered all the data and saved it i went into the customer table
to see if the data was saved the auto number was in there .
Is there any way for on the form for the autonumber to be displayed
when i start entering the data. Like how it was when i used access as
the back end before i moved to mysql as the back end
Any help would be great
SimonThis question is most likely better positioned at one of the mysql
newsgroups.
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
<S.Dickson@.shos.co.uk> wrote in message
news:1162848855.370242.88140@.h54g2000cwb.googlegroups.com...
>I had an access database that i use as an ordering system. I have a
> form for entering customer details. When i add a new customer on the
> form the customer number is an auto number that appears when i type in
> the details.
>
> I have just moved over to mysql server with access as the front end. I
> have setup the sql tables with the customer number as autonumber.
> When i go into the form and add a new customer it does not generate the
> customer Number automaticaly on the form like it did before. once i
> have entered all the data and saved it i went into the customer table
> to see if the data was saved the auto number was in there .
> Is there any way for on the form for the autonumber to be displayed
> when i start entering the data. Like how it was when i used access as
> the back end before i moved to mysql as the back end
>
> Any help would be great
> Simon
>

Auto Number mysql

I had an access database that i use as an ordering system. I have a
form for entering customer details. When i add a new customer on the
form the customer number is an auto number that appears when i type in
the details.
I have just moved over to mysql server with access as the front end. I
have setup the sql tables with the customer number as autonumber.
When i go into the form and add a new customer it does not generate the
customer Number automaticaly on the form like it did before. once i
have entered all the data and saved it i went into the customer table
to see if the data was saved the auto number was in there .
Is there any way for on the form for the autonumber to be displayed
when i start entering the data. Like how it was when i used access as
the back end before i moved to mysql as the back end
Any help would be great
SimonThis question is most likely better positioned at one of the mysql
newsgroups.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
<S.Dickson@.shos.co.uk> wrote in message
news:1162848855.370242.88140@.h54g2000cwb.googlegroups.com...
>I had an access database that i use as an ordering system. I have a
> form for entering customer details. When i add a new customer on the
> form the customer number is an auto number that appears when i type in
> the details.
>
> I have just moved over to mysql server with access as the front end. I
> have setup the sql tables with the customer number as autonumber.
> When i go into the form and add a new customer it does not generate the
> customer Number automaticaly on the form like it did before. once i
> have entered all the data and saved it i went into the customer table
> to see if the data was saved the auto number was in there .
> Is there any way for on the form for the autonumber to be displayed
> when i start entering the data. Like how it was when i used access as
> the back end before i moved to mysql as the back end
>
> Any help would be great
> Simon
>