Creating a table is simple enough using the create table SQL. The only way I can think of getting the data in to the table without using DTS or an ASP / VB script would be to set the spreadsheet up as a linked table and do a select statement from it into the new table. Dan
________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of GJ Sent: 14 June 2005 04:36 To: [email protected] Subject: Re: [AspClassicAnyQuestionIsOk] Help in Exporting data Thanks Mark for the reply but I'm not asking for an ASP code or vbscript...What i'm asking is it possible to create a database table in the Enterprise Manager without using the DTS or what we call wizard and instead use Query Analyzer...Tnx! On 6/12/05, Mark E <[EMAIL PROTECTED]> wrote: > Here is what I use to allow clients to run imports of > new items in SQL from a .csv file: > > 'Create our FSO. > set objFSO = > Server.CreateObject("scripting.FileSystemObject") > > 'Set the path to the error log file. > strPath = server.MapPath("NewItems") & > "\NewFCIItems.csv" > > 'Check to make sure the file exists before we process. > if objFSO.FileExists(strPath) then > > 'Get the text file that we will be reading. > set myFile = objFSO.GetFile (strPath) > > 'Open the text file. > set objTextFile = myFile.OpenAsTextStream(ForReading, > -2) > > 'Loop thru the text file and get all the text, assign > to variable. > Do While not objTextFile.AtEndOfStream > > 'Grab each line in the file, store in variable. > strText = objTextFile.ReadLine > > 'Evalute the line to see if data exists. > if len(trim(strText)) > 0 then > > 'This is the code that extracts the items from the > line. > Dim strMyArray, intMaxIndex, intCurrIndex, > strCurrValue > > 'Parse the string passed in, sperating by commas ",". > strMyArray = split(strString, ",") > > 'Find out how many fields we parsed. > intMaxIndex = UBound(strMyArray) > > > 'Make sure we have all the required fields. > if intMaxIndex = 3 then > 'Parse out the values from the string passed in. > strVar1 = strMyArray(0) > strVar2 = strMyArray(1) > strVar3 = strMyArray(2) > end if > > 'The file is not blank, process. > strInsertSuccessful = InsertNewItem(strVar1, strVar2, > strVar3) > > 'Check the response from the insert above and set err > if found. > > End If > > Loop > > End If > > 'Close & destroy the file. > objTextFile.close > set objTextFile = nothing > > Mark > > > --- goriojuan <[EMAIL PROTECTED]> wrote: > > > Aside from using DTS and Export wizard, how can we > > export data from > > Excel to SQL Server2000 database. What is the exact > > script used to do > > this. Help is highly appreciated. > > > > > > > > > ________________________________ > Yahoo! Groups Links > > To visit your group on the web, go to: > http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/ > > To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. ________________________________ Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED] subscribe> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . [Non-text portions of this message have been removed] Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
