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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by nitram

  1. nitram

    I have a pre-formatted ASCII report

    Hi, No it's not on AIX, it's on NT. We solved this one by re-coding the report to generate PS using the following component. http://fytek.com/pdfrpt.html Thanks, Martin Martin Ramsay Martin.Ramsay@company-net.co.uk http://www.company-net.co.uk Looking for interesting work in Canada - any...
  2. nitram

    I have a pre-formatted ASCII report

    I have a pre-formatted ASCII report which I create programatically. I would like to convert this into a PS file. I had hoped that there may be the equivalent of the HTML <PRE> </PRE> tags which I could stick around my existing document but no such luck. Can someone direct me to the simplest...
  3. nitram

    Maintaining a db table to reflects the contents of a file tree

    Sorry - should have emphasised that this code loads the <b>structure</b> of the file-tree into the table - not the contents of the files themselves. <p>Martin Ramsay<br><a href=mailto:Martin.Ramsay@company-net.co.uk>Martin.Ramsay@company-net.co.uk</a><br><a href=http://www.company-net.co.uk>My...
  4. nitram

    Maintaining a db table to reflects the contents of a file tree

    A while back I posted a tip to get a csv file into a db table using an O/S command and the 'xp_cmd_shell' call in a stored procedure.<br><br>I mentioned that I used the same principle to maintain a table to reflect the structure of a file tree. Somebody mailed me asking for a more details on...
  5. nitram

    Retrieving one value from one table and many from another

    Hmmm. Not sure you need the 'group by', yaffle. <br> I suggest the following: (MS SQL server syntax)<br> <br> SELECT ISNULL(c, s)<br> FROM <br> (SELECT state s, ' - ' + county c<br> FROM county_table<br> UNION<br> SELECT state s, NULL c<br> FROM...
  6. nitram

    Updating SQL databse

    Perhaps slightly off topic, but if your goal was to synchronise the data in your database with the records that you receive every week then this can be done with an UPDATE and INSERT (as explained above) followed by a DELETE.<br> <br> The delete removes any records which no longer exist in the...
  7. nitram

    CSV file to SQL SERVER

    Should have added to my original post ...<br> <br> To manipulate 2 rows at a time as you asked in your original request then you could process the table using a cursor, extracting the data into @variables and then processing the results from the 2 previous rows read in to the cursor using TSQL...
  8. nitram

    CSV file to SQL SERVER

    Yes I would recommend BCP. However, as an alternative I have used the following in the past, wrapped up in a Transact SQL stored procedure:<br> <br> 1. Create a (temporary) table to hold the file. eg.<br> <br> create table #input_file ( line varchar(255) NULL)<br> <br> 2. Use an extended...
  9. nitram

    SQL Database as a web backend

    In general you may want to look at the DTS (Data Transformation Service) features of SQL Server.<br> This will allow the import of many formats<br> (eg. csv, excel, access db) into a SQL server table.<br> <br> Perhaps what you could do is ftp your input files to<br> somewhere accessible by SQL...
  10. nitram

    How to adapt or map data to sql?

    insert into NEWTABLE<br> (select 198, breed, dogid, description<br> from OLDTABLE<br> where code1='B1' and code2='C2');<br> <br> <br> Should work (I think). If 198, 'B1' and 'C2' are<br> not constants then you'll need to wrap the whole<br> lot up in into a procedure and pass these in...
  11. nitram

    How to adapt or map data to sql?

    Depends on what dbase you are using but if you didn't want to write programs to parse the data, then I would create an input table with columns matching the inital ascii text file and then write an 'on_insert' trigger (dbase specific syntax) which fired on insert and contained the logic which...

Part and Inventory Search

Back
Top