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...
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...
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...
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 =...
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.....
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.....
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...
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.....
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...
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...
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...
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 =...
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...
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...
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 =...
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...
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.....
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...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.