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 SkipVought 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. mariayx

    Why it keeps telling me syntax error?

    Hi, I have the following line in my ActiveX script in a DTS package, it keeps giving me compilation error. Can anyone tell me why? MyStringPosition = InStr( 1 , v_fullfilename , 'ABC' , 1 ) Thanks, mariayx
  2. mariayx

    How to specify a source file name using a parameter in DTS

    Hi all, Is there any guru out there that can help? I could not figure out how to put a variable as file name at step Text File(Source) in a DTS package. The previous step in the package is an Active X script which defines the variable. Appreciate any help! -mariayx
  3. mariayx

    How to specify a source file name using a parameter in DTS

    Hi all, My ActiveX script loops on file names in a file directory and passes file name in a parameter one at a time as input source file for process in DTS package instead of specifying a fixed file name. Can anyone tell me about the syntax on how to pass the parameter for the file name? Thanks...
  4. mariayx

    Is there an Oracle like '%type' variable in SQL Server

    In Oracle procedure, when you declare a variable for a column in a table, you do variable_name tble_name.column_name%type; The variable will inherit the data type/size of the column in the table. If you need to change the column type/size in the future, you don't need to change all the...
  5. mariayx

    How to read a file name and keep it in DTS package as source file

    Hi Jay, Here is what I did before I ran into a problem. I mapped the FTP directory to my local drive. And ran the following commands in DTS(I was logged on to the remote SQL Server at that moment from my PC and ran the step from there), but LoadFiles.txt did not get created on my local machine...
  6. mariayx

    How to read a file name and keep it in DTS package as source file

    Thanks a lot! That was very helpful! I will give it try. In my case, I will need to read a directory from a remote FTP server though. mariayx
  7. mariayx

    How to read a file name and keep it in DTS package as source file

    Hi everyone, I need to read file names in a directory on an FTP server one at a time, pass the file name as a source data file in a DTS package, then load it into SQL Server tables. Keep on doing that until all the files in the directory are read and processed. My question lies with the file...
  8. mariayx

    Why does substring take smaller size than specified

    Thanks! That's exactly what has happened.
  9. mariayx

    Why does substring take smaller size than specified

    I use SUBSTRING(@data_string, 12, 17) to get a substring from the following whole string '140PTOHCO 2DTT707904 CCONTINENTAL AIRLINES 460120030822 N' But instead of getting '2DTT707904', I got only '2DTT707'. Can someone help? Thanks, mariayx
  10. mariayx

    Data Type Conversion

    It worked with ISNULL. Thanks a lot for your help! Have a nice weekend. mariayx
  11. mariayx

    Data Type Conversion

    In my case the substring could either be a null or a string of 'yyyymmdd' format. Error returned:Syntax error converting datetime from character string. Here is part of the code. set @l_Submit_Date = SUBSTRING(@data_string, 54, 8) set @l_Date_Updated = SUBSTRING(@data_string, 62, 8)...
  12. mariayx

    Data Type Conversion

    Thanks for your response. I changed it to convert(datetime,SUBSTRING(@data_string, 54, 8)), the procedure got created with out errors. So I ran the procedure with the case that the substring is a NULL there. It looks like this: set @data_string = '383430473 E...
  13. mariayx

    Data Type Conversion

    Hi all, I need to parse a char(97) string using substring and convert it into a date. The following substring is either in 'yyyymmdd' format or a null. SUBSTRING(@data_string, 54, 8) I tried CAST to convert it to a date. But it said "Syntax error converting datetime from character...
  14. mariayx

    How to transfer a text source file into multiple destination tables?

    Good to know that I am in the right direction. But one more thing I am not sure how to handle is that if you look at the data format, one V or B type record could have more than more one N01, N02, N03 records. I wonder whether you have handled something similar with this before and could give...
  15. mariayx

    How to transfer a text source file into multiple destination tables?

    Thanks for the response! I appreciate it. The first three positions of the text file always hold data type followed by data of that type. The total length of each line is 100 with carriage return. Each column has fixed length also. The file looks like this: V 1019060 PNP B...
  16. mariayx

    How to transfer a text source file into multiple destination tables?

    Hi DTS gurus, I have a text source file and the data in it is supposed to go to different SQL Server tables. Is there a way of doing it? Thanks in advance for any help.

Part and Inventory Search

Back
Top