Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. WelshyWizard

    Create multiple entries based upon quantity

    Hi all, I have a SQL Server 2000 table that holds a long list of parts. Each row is show something like this: ID Cont# Str# PartID GdrNo Qty Length Width Thick Grade 1 927 001 P12 A1 3 2100 250 12 S355J2G3 2 927 001 P13 A1 6...
  2. WelshyWizard

    Remove duplicates and update quantities

    Hi all, I've imported a csv file into SQL Server 2000 and it is riddled with duplicates. Each record has a quantity and what I want to do is remove the records that are duplicated and finally end up with one record which has an updated quantity. So, for example, part P12 is found on 3 records...
  3. WelshyWizard

    Call multiple stored procedures

    Really easy question for you guys... How on earth do I call multiple stored procedures? I've got 2 procedures, sp_ADDCOLS and sp_SPLITDIMS, all I want is some SQL that allows me to run sp_ADDCOLS and then sp_SPLITDIMS. I'm sure it's very simple but it's driving me mad! Today is the tomorrow...
  4. WelshyWizard

    Split Function

    Thanks for your time on this guys... I created my solution as follows: UPDATE IMPORT SET field2 = SUBSTRING(field1, 1, CHARINDEX('X',field1)-1) , field3 =...
  5. WelshyWizard

    Split Function

    Sorry, I should have added that ther end will not always be FLAT... It could be any number of things! Today is the tomorrow you worried about yesterday - and all is well.....
  6. WelshyWizard

    Split Function

    Unfortunately the value after the X could be 2 digits, 3 digits or even a decimal value! (i.e. 25.5) Any ideas how I'd do this? Thanks for the help so far. Today is the tomorrow you worried about yesterday - and all is well.....
  7. WelshyWizard

    Split Function

    Hi all, I am looking to split a value held in a SQL Server 2000 table, and the split results need to be returned into 2 new fields on the same row. For example: Field 1 = 900X10FLAT Field 2 = 900 Field 3 = 10 The value in field 1 should be split into the other 2 fields. These values will...
  8. WelshyWizard

    Import CSV file into SQL Server

    Actually, that last question is probably one for a different forum as It'll be done in SQL. Today is the tomorrow you worried about yesterday - and all is well.....
  9. WelshyWizard

    Import CSV file into SQL Server

    Staging table... Yea, that sounds like exactly what I want. That was how I was going to go about this but wasn't too sure if it was the right way. Ok. One of the 1st things I need to do is to split out a field into two seperate fields. The field will read something like: 900X50FLAT 9123X100PLT...
  10. WelshyWizard

    Import CSV file into SQL Server

    Ok.... Note to myself and everyone else... Try before you ask! I was coming back on here to say I'd done it but you beat me to it! Ok, so that worked a treat. My next question is this. When I was putting each row in at a time using the FOR loop I was going to create additional information for...
  11. WelshyWizard

    Import CSV file into SQL Server

    Ok, I looked at BULK INSERT. Can I just write the SQL into a SQLCommand like I would a normal insert? When I tried to creat the BULK INSERT command in the graphical SQLCommand tool it told me that: "the designer does not graphically support the BULK SQL INSERT construct" This is why I did it...
  12. WelshyWizard

    Imported CSV formatting issues

    Hi all, I've got a datagrid on a windows form which is populated by a CSV file, using the following code: If OpenFileDialog1.ShowDialog(Me) = DialogResult.OK Then Dim fi As New FileInfo(OpenFileDialog1.FileName) Dim sConnectionString As String =...
  13. WelshyWizard

    Import CSV file into SQL Server

    Thanks for the tips. I've actually cracked it and thought it might be useful to post how I did it. Firstly I imported the csv file into a datagrid: If OpenFileDialog1.ShowDialog(Me) = DialogResult.OK Then Dim fi As New FileInfo(OpenFileDialog1.FileName) Dim...
  14. WelshyWizard

    Import CSV file into SQL Server

    Hi all, I'm using Visual Studio 2003 and SQL Server 2000. I am looking to insert the contents of a csv file into an existing SQL Server table. I would like to do this via VB.NET. Could someone post some code to show me how to do this? Is it easier if I import the csv into a datagrid and then...
  15. WelshyWizard

    Update Database from DataGrid

    Sorry... I don't want to update, I want to INSERT! The table will be empty. Today is the tomorrow you worried about yesterday - and all is well.....
  16. WelshyWizard

    Update Database from DataGrid

    Hi all, I am using the following code to fill a datagrid with the contents of a csv file. If OpenFileDialog1.ShowDialog(Me) = DialogResult.OK Then Dim fi As New FileInfo(OpenFileDialog1.FileName) Dim sConnectionString As String =...
  17. WelshyWizard

    Best practice

    Cheers for this reply SiriusBlackOp. I have a question regarding this post. Open to everyone of course... What do I declare sPathNew, fsStream and tsFile as? Also, could you explain a little bit about how this will work? Cheers. Today is the tomorrow you worried about yesterday - and all...
  18. WelshyWizard

    Datagrid ComboBox

    Hi again, Just to let you all know that I've found the answer to my question in thread796-1151632. Thought I'd checked the threads before but obviously I overlooked that one! Cheers. Today is the tomorrow you worried about yesterday - and all is well.....
  19. WelshyWizard

    Datagrid ComboBox

    Hi all, I have the following code populating a datagrid and also setting some of the columnstyle settings: SqlDataAdapter1.Fill(DsPlates1) DgPlates.DataSource = DataView1 Dim ts1 As New DataGridTableStyle ' Table stlye Dim cs0 As DataGridColumnStyle = New...
  20. WelshyWizard

    Change form from another form.

    Thanks guys, I tried this first time around and for some reason, when I type this in I get the ominous squiggly blue line under Main1.Enabled. When I hover over this the tooltip tells me 'Reference to a non-shared member requires an object refernce'. Any ideas? Cheers Today is the tomorrow...

Part and Inventory Search

Back
Top