Removing Formatting From Imported File
Jul 17, 2007
I have a file I'm pulling from another type of database into an Excel spreadsheet and then using my dtsx package to import the spreadsheet into my SQL database. The problem I'm having is that one of the fields coming out of the database to the spreadsheet has the thousands seperator in the field that I want to use as a numeric field without the ",". Right now I have a macro that I run on the spreadsheet to reset the field to straight numbers without commas before importing it, but would like to configure my Integration package to do it automatically.
Any ideas would be appreciated.
Thanks in Advance
View 1 Replies
ADVERTISEMENT
Dec 3, 2007
I have a datatable with a field called 'Description' that is formatted in html (<P>Some text here</P>). This prints out when I try to report it, is there any way to strip away the formatting tags? (The best solution would be to APPLY the formatting tags, but I doubt that is possible).
View 1 Replies
View Related
Feb 6, 2007
I have a field where the data is stored with RTF. I know SQL Reporting Services cannot display it properly. Is there way to remove the RTF formatting codes through a function to just pull out the text and displya it in the text box?
View 4 Replies
View Related
Jun 26, 2006
Has anyone import into SQL Server a text file generated by DB2?
the DB2 files has bunch of weird characters in it that look like they are used for formatting...as opposed to actually being data.
Also, SQL can't find a row terminator.
I received a cobol declaration copy book for the data, but I have no idea what to do with the special characters.
Any help would be appreiciated.
There's a sample of the copybook...
* COBOL DECLARATION FOR TABLE @TNJ00.PL_JUDGM_ATTORNEY *
************************************************** ****************
01 DCLPL-JUDGM-ATTORNEY.
10 PJATY-ATTORNEY-KEY.
15 PJATY-JUDGMENT-ID PIC X(14).
15 PJATY-GROUPING-CDE PIC S9(4) USAGE COMP.
15 PJATY-ROLE-CDE PIC X(1).
88 PJATY-CREDITOR VALUE 'C'.
88 PJATY-DEBTOR VALUE 'D'.
88 PJATY-TRUSTEE VALUE 'T'.
15 PJATY-GROUP-SEQ PIC S9(4) USAGE COMP.
15 PJATY-ENTRY-SEQ PIC S9(4) USAGE COMP.
10 PJATY-NAME-PREFIX PIC X(4).
10 PJATY-LAST-NME PIC X(25).
10 PJATY-FIRST-NME PIC X(12).
10 PJATY-MIDDLE-NME PIC X(12).
10 PJATY-NAME-SUFFIX PIC X(4).
10 PJATY-CITY-NME PIC X(25).
10 PJATY-STATE PIC X(2).
10 PJATY-ZIP-CDE PIC X(9).
10 PJATY-TELEPHONE PIC X(10).
10 PJATY-LST-MNT-DTE PIC S9(9) USAGE COMP.
10 PJATY-REC-LOCK-CDE PIC X(1).
10 PJATY-ALT-NAME.
49 PJATY-ALT-NAME-LEN PIC S9(4) USAGE COMP.
49 PJATY-ALT-NAME-TEXT PIC X(75).
10 PJATY-ADDR-LINE-1.
49 PJATY-ADDR-LINE-1-LEN PIC S9(4) USAGE COMP.
49 PJATY-ADDR-LINE-1-TEXT PIC X(50).
10 PJATY-ADDR-LINE-2.
49 PJATY-ADDR-LINE-2-LEN PIC S9(4) USAGE COMP.
49 PJATY-ADDR-LINE-2-TEXT PIC X(50).
10 PJATY-ADDR-LINE-3.
49 PJATY-ADDR-LINE-3-LEN PIC S9(4) USAGE COMP.
49 PJATY-ADDR-LINE-3-TEXT PIC X(50).
************************************************** ****************
* THE NUMBER OF COLUMNS DESCRIBED BY THIS DECLARATION IS 20 *
************************************************** ****************
View 6 Replies
View Related
Mar 24, 2015
I have a table with 201 columns . I am importing 200 columns from a file using DFT. I want update the 201th column with the fileId of the file that just imported. I am storing the fileId of the file in varFileID .
How do I go back and update the 201th column ( column name sfileId) with the varFileID value?
I can use Execute SQL Task but how will I know it's the records of the files that I just imported not other rows.
View 0 Replies
View Related
Sep 11, 2015
I have a record in an Excel format (Excel 2010) and I would like to bulk import that into SQL Server 2008 and also while importing, SQL Server will automatically create a new table based on the header fields or row of the source file.
I am not sure if SQL Server 2008 has this capabilities.
View 0 Replies
View Related
Aug 16, 2002
I've inherited a database from a SQL7 system, and converted it to SQL2000. It has a secondary data file (.ndf) and a secondary log file. Because the server configurations are different it's no longer necessary to have the secondary files. How to I merge the secondary file data into the primary files and then delete the secondary files?
Thanks,
Al
View 1 Replies
View Related
Sep 23, 2014
Getting below error while ran EMPTYFILE.
DBCC SHRINKFILE: Page 10:6521 could not be moved because it is a work table page.
Msg 2555, Level 16, State 1, Line 1
Cannot move all contents of file "tempdata" to other places to complete the emptyfile operation.
View 3 Replies
View Related
Oct 5, 2006
Hi There,
I am parsing a directory of flat files and looping through it with a foreach loop. Some of the files have lines that contain characters that I would like to remove. In fact, it would be good if I could remove the entire line. Is there a way to do this with a Script Task or some other way.
Thanks for your help.
View 3 Replies
View Related
Jul 6, 2015
I wanted to remove an extra transaction log file that was no longer required, and ran the following against the database...
DBCC Shrinkfile (DB_Name_log2, Emptyfile);
go
alter database [Db_Name]
remove file DB_Name_log2;
go
I got a successful removal message. But if I go into the properties of the database, and click on files, it still shows up. Why is this and how can I get rid of it?
It shows up in sys.master_files as offline.
View 4 Replies
View Related
Apr 20, 2007
Hi there,
I have a large (420GB) database that has never had data archived off before. I taken a backup to a test server and run a script supplied by the product vendor which has removed a large ammount of old data no longer required.
I have checked within enterprise manager that this data has now gone, however the actual file itself has not shrunk in size. Is there a further step I need to take to get back the space.
Kind Regards
View 2 Replies
View Related
Jul 23, 2005
Hi all,This is my first batch file and I want to query a database and outputit in a textfile. Up to now that works, the only problem is theformatting in the text file. It's all screewed up...lines aren't linedup and columns aren't right....how do you format the result from aquery to a text file. Here's my code:osql.exe -S MYMACHINE -w 30 -E -d Demo2 -Q "select * from Title wherefrequency = 'monthly'" -o "C:output.txt"Thanks....JMT
View 1 Replies
View Related
Nov 21, 2007
Hi,
I am using a data flow task, and outputting the results from the ole db source adapter to a flat file by calling a function. That part works fine.
However, I want the text fields to be surrounded by double-quotes, like so:
"data1", "data2", "data3"
However, what I'm getting is:
"data1 ","data2 ","data3 "
I tried both specifying a "text qualifier" and when that didn't work, I removed the text qualifier and put quotes around the columns in my select statement. But that didn't work either.
How do I get rid of the spaces?
Thanks
View 3 Replies
View Related
Mar 28, 2007
So i've created a flat file destination control and have mapped the columns. At what point can you control which column shows up first?
View 4 Replies
View Related
Feb 21, 2006
I have a
table with column (call it Rate) defined as decimal(18,4). This column
can have any positive decimal value. When the value is less than 1
(e.g. 0.1234) strange things are happening in SSIS.
To set the scenario ...
If I do a select in Management Studio, the value is correctly displayed as 0.1234
If I do the same select from the command line via OSQL, I get .1234
If I do SELECT CONVERT(char(6), Rate) from OSQL, I get 0.1234 (which is what I want)
In SSIS I have an OLE DB Source which defines the SELECT statement to use, and that maps straight to a Flat File Destination.
The
default column type in the flat file connection manager is DT_NUMERIC,
Precision 18, Scale 4. I Set InputColumnWidth to 6 as that's how I need
it in the flat file. The value appears in the file as .1234
I
change the SELECT in the OLEDB Source to apply the CONVERT(char(6),
Rate), and change the column type in the connection manager to DT_STR
length 6. Output is *still* .1234
How can I get the output column in my file to show 0.1234 ??
Greg.
View 3 Replies
View Related
Nov 2, 2015
public void Main()
{
// TODO: Add your code here
string time = System.DateTime.Now.GetDateTimeFormats('G').ToString();
string pathD = @"C:UsersuserDesktop estFileD";
string pathR = @"C:UsersuserDesktop estFileR";
[code]...
Normally (I usually program in JAVA), I would print out the variables to see if there is an issue but I haven't figured out how to do that in SSIS yet.I have to set the Connection string for the Flat File conection using the Expressions tab instead of putting the variable in the connection string tab.Now it works but the file that is spitting out is "testFileDSystem.String[]"
View 7 Replies
View Related
Aug 28, 2015
Declare@QRYvarchar(8000)
Select@QRY='bcp "Select COL1, COl2 From table(nolock)" queryout "D: est.xls" -c -T -S ' + convert(varchar(20), serverproperty('servername'))
Select@QRY
Execmaster..xp_cmdshell@qry
The file test.xls is getting generated but when opening getting the message
"File you are trying to open is in a different format than specified by the file extension"
Is there any property that can be set to avoid this message?
View 6 Replies
View Related
Feb 11, 2014
I setup SQL Server 2012 on Windows Server 2012 with the service accounts in the local Administrator group, but now that I'd like to remove the accounts from this group I'm finding they don't have the appropriate access to the network storage. notes on setting the per-service SID's for SQL (SQL Engine, Analysis Services, Reporting Services, and Agent Service) so they can read the Data, Log, and TempDB mount points?
View 2 Replies
View Related
Mar 16, 2007
Hi,
I have imported 3 DTS from SQL 2000 to the SQL 2005 server. The wizard went fine, everything is ok. When I close the wizard window, I cannot see any of them. If I reimport it, it asks confirmation to override it. Where are the 3 DTS in the management Studio if they are not under Legacy DTS?
Thanks
View 4 Replies
View Related
Jan 18, 2005
I am using the following SQl statement in a DTS vb file.
The data is coming from an Excel spreadsheet and being put into a SQl server table.
oCustomTask1.SourceSQLStatement = "select `Order No`,`Country`,`Desc`,`Amount` from `Sheet1$` WHERE `Order No` = 1 "
I want to validate the data being put into the table to ensure no duplicates records are entered UNLESS the record has changed in any way.
E.g. If record 1 had a column called "NumberOne" which changed to "Number1" change this information and move the original value to another table.
View 2 Replies
View Related
Oct 21, 1998
I installed SQL 7 on a new computer and imported DB from another SQL 6.5.
Tables were imported but index and SPs were not.
I had to script those objects and run it on SQL 7.
Any shortcut to import all objects directly?
Again I was importing not upgrading.
View 2 Replies
View Related
Jun 4, 2004
Hi. I am working on a dynamic website and backed up the data from our database (SQL Server) into a .bak file from our server. I want to develop the site locally on another machine (doesn't have SQL Server, but MSDE) using the database so I restored the database backup using RESTORE DATABASE FROM... (in the DOS prompt). I found a tutorial how to do this at
http://www.popkin.com/customers/customer_service_center/tip_of_the_week/01_19_04/tipofweek.htm
It did the restore successfully (or so it said) but all that it restored was the database structure (table structure, user information, etc.) but not the actual data in the database. I am using Specify (www.specifysoftware.org) as a database manager.
Could anyone help me out? Can I not go from SQL Server to MSDE? This doesn't seem to be the case because the structure restored okay.
What should I do to correct this problem?
Thanks for your help in advance!
Nik
View 1 Replies
View Related
Mar 18, 2004
I am developing a DB with others in my group. When I import tables created on other servers to my server, the primary key and other properties do not import with the tables. Can anyone explain why this is happening? Is there a setting I have over looked?
View 3 Replies
View Related
Jul 20, 2005
I am in the process of importing data that is in a text format to thesql server, I want to add couple of fields and insert general data inthe fields added, this data is going to be similar to all the recordsimported. Your help in this regard will be greatly appreciated.
View 1 Replies
View Related
Apr 9, 2007
Dear All,
I am making web application using Asp.net C#(Visual Studio2005). And Sql server 2000 as a back End.
Actually I am fetching data from other database(named as retailexcel but in same server). I have wriiten a view (in retailexcel database) to get required data from four table of other database. My problem is when I fetch those data(about 40000 to 50000 record) It taking to much time. I tried catch feature of asp.net2.0. Time reduced but not significantly. So I am trying to import those tables to my database (named Inventory) from that retailexcel.
Now problem is every day or two, record of those tables changes. How can I keep update my tables (which are importing from retailexcel)
Please suggest me some idea.
Thanks
View 1 Replies
View Related
May 30, 2003
We have an OLTP application with multiple one to many tables relationships that are edited client side. For Example the primary table has descriptive components. One of the multiple table have things like parts and quantity ordered linked by a record number back to the primary table.
When our client transmits their transaction, they actally running a batch job which sends all the client side tables to the SQL Server and then we are trying to issue a stored procedure server side to push this data into our 'dbo' owned server side master tables.
Our problem is generating the fully qualified table name for the from clause.
We have tried declaring a variable but the stored procedure won't compile. Tried user, user_name().
Any solutions would be greatly appreciated.
View 3 Replies
View Related
Mar 24, 2006
HiI have a script that uses bcp to import data from an ascii text fileinto SQL tables. The french characters are not copied properly. Theyare converted to letters of the alphabet. I tried to change all thefields to nvarchar instead of varchar and nchar instead of char, but Igot Greek characters instead.How can I fix this?Here is some code:--------------------------CREATE TABLE [dbo].[1_HLGT_HLT_COMP_f9.0] ([hlgt_code] [int] NOT NULL ,[hlt_code] [int] NOT NULL) ON [PRIMARY]GOPRINT 'HLGT_HLT'DECLARE @s as nvarchar(300)SET @s='bcp MedDRA..[1_hlgt_hlt_comp_f9.0] in ' + char(34) +'F:MedDRA9.0FrenchMedAsciihlgt_hlt.asc' + char(34) + ' -c -t' +char(34) + '$' + char(34) + ' -r$ -e' + char(34) +'F:MedDRA9.0Frenchlogshlgt_hlt.err.txt' + char(34) + ' -b250 -m50-SDEV -Usa -Ppassword -h' + char(34) + 'TABLOCK' + char(34)EXEC master..xp_cmdshell @s
View 8 Replies
View Related
May 14, 2008
Hi All,
I am importing data from an oracle db and one of the columns is a nclob. I would like to truncate the value if it is more than a certain length. I want to use a derived column transformation. I cannot use the len and substring functions because it is not a string. I could convert it to a unicode string and use those functions, but I am afraid there is a size limitation (4000 characters) on it. Is there smth I am missing? Can anybody please suggest any ideas?
Thanks a lot.
View 2 Replies
View Related
Mar 31, 2006
I have used the wizard to import a DTS package from a SQL 2000 server to our new SQL 2005 server and need to make edits to reference the new server and database. I am able to see the package within the SQL Management studio under Integration Services, but I cannot find it in the Development studio?
What am I missing?
Thanks
View 1 Replies
View Related
Feb 9, 2006
I used a DTS package to import data from one database to a new database (different servers) and it seemed to work fine with the exception that it lost all the passwords. I got one error telling me that for security reasons, it left all passwords NULL. Sure enough - they are now all blank.
Ideas - any good articles with quick fixes ???
Thanks a bunch - I am just getting into a lot of unusual problems this week.
Nancy
By the way - what happened to the SQL*Pass message boards ??? Nobody visits there now....
View 2 Replies
View Related
Nov 25, 1998
hi, I am importing data daily to many tables, I want to keep track of the #of rows for each import process. I already have created a trigger as follow:
CREATE TRIGGER tr_bcp_log ON dbo.A
FOR INSERT
AS
declare @name varchar(30),
@row_count int
select @name=name , @row_count= @@rowcount
from inserted
insert into bcp_tracks (name,row_count)
values(@name,@row_count)
GO
The problem is that I am getting a row for each inserted row in table A.for instance if I have 500 rows in table A, I will get 500 rows in the log table like this
table_name,#of rows
A 1
A 1
A 1
etc up to 500 rows for table A
This is not what I want, I want to capture the num of rows for every bcp process , so in the log table I want to see the following :
table_name, #of rows
A 500
B 600
C 450
A 250
etc
Any help ?
thanks
Ali
View 1 Replies
View Related
Jul 13, 2006
I have a stored procedure which will run automatically. I've got try...catch code in the procedure, but I found a bug with the code where if there are any import errors, it doesn't recognize that that there was an error and it runs through the try code as through there was no problems. (I reported the bug).
I added some code using @@rowcount to check if there were rows imported, and if not, it moves the data file to a error folder so I know there was a problem with the import. But this only checks if at least one row was imported, not if all the rows in the datafile have been imported. (i.e. if the first row imported correctly, and the second did not, it still sees it as successful).
The problem is some of the data files have only one row to import and some have multiple rows. Is there a way to count the number of rows in the datafile, then count the number of rows imported, to verify they are the same number imported?
Thanks,
Laura
View 2 Replies
View Related
Feb 9, 2008
Hi there,
Today I tried out Integration Services and after a couple of hours of confusion I am impressed by the power of this product. I was wondering if I might get some help on the 'best practice' for the following requirements:
I have a foreach container that scans a directory and calls a data flow task for each file in the directory. The files import to the database fine, but I want to modify the procedure so it only imports files that have not yet been imported. There are a couple of scenarios:
- a file is created in the directory
- a file is modified in the directory
In both cases I want to insert (or reinsert) the file. How can I modify my package to accomodate this behaviour? Storing the filename is an option, but I am not sure how to also bring in the file creation/modified dates.
Is this the right approach?
Any other ideas?
Cheers,
Alex
View 6 Replies
View Related