Writing Text Data
Mar 30, 2000
Hello, historically it has been frowned upon to store textual data in sqlserver. In v6.5 and before, 2k pages were allocated regardless of actual data size. Is this still the case in v7.0? I have a situation where the intranet application wants to store documents/images/etc. Currently, we need to have security granted to each user who connects to the web server to allow them to write files. However, if we write the data via sqlserver, then the application only needs permission. Is this the recommended method? What other options can I use? tia, Lee
View 2 Replies
ADVERTISEMENT
Mar 29, 2007
Hi,
I am trying to write the output of an sql query to a text file using bcp. Now the problem am facing is i have to format the text like i the following order...
<DATETIMESTAMP>08:39 Thursday, March 15, 2007</DATETIMESTAMP><CATEGORY>Quarterly Sales</CATEGORY><HEADLINE>Quarterly Corporate Earnings (03/15/07)</HEADLINE><BODY> Quarterly Corporate Profits (03/15/07) PER-SHARE ($) NET EARNINGS (mil$) REV. (mil$)COMPANY CURRENT YEAR-AGO CURRENT YEAR-AGO CURRENT YEAR-AGOabc 0.33 n/a 8.60 (13.30) 144.40 112.50 bcdf 0.16 (0.15) 7.80 (7.40) 101.90 81.20 gha n/a n/a (90.00) (80.00) 488.00 462.00 qwqw (0.10) (0.15) (3.30) (4.30) 2.90 2.20
Copyright(c) 2007 mycompany.com, Inc. All Rights Reserved</BODY>
Would somebody please advice whther this sort of formatting is possible with bcp..Please give some pointers am completely stuck....the company data is coming from a database table...am using sql 2005...
Thanks in advance
View 1 Replies
View Related
Dec 21, 2006
Hi Everyone, I´m new to this group, I´m trying to write a text filesadding content from a text column (more than 8000 characters), I foundcode how to write files and it works but i have the problem when addedthe text column to the body of the file.any idea? tip? thanks in advance! Pablo.
View 1 Replies
View Related
Aug 18, 2006
I am having a scenario where all the stored procedures are stored in a folder (one sql file per sproc). Stored procedure does not have 'IF Exists .... DROP Procedure' in the script so before creating them we have to drop all sproc manually.
Can anyone help me writing a script / SSIS process to loop through each file in folder and write "IF EXISTS ... DROP PROCEDURE" with the procedure name in it ??
I can create a package that loop through each file in FOR each Loop task but dont know how to write in file using .net
Thanks in advance
Furrukh baig
View 3 Replies
View Related
Jul 11, 2007
I have a Foreach loop which scans a table, and gets names of a bunch of procedures, and then back in the foreach loop, they get executed. Im trying to figure out how I can create a sort of log file to say the name of the procedure that is getting executed currently and the current date time stamp onto a flat file. I havent been able to figure this out yet..anyone know how to do this? I grab the names of the storedprocedures from the table and store it in a variable and use the name from the variable to actually execute the stored procedure.
I guess in essence, the question is how do i directly write lines of 'text' (from say a variable) into a flat file.
View 6 Replies
View Related
Jul 23, 2004
I need to create a text file using information from SQL tables/views in the following format...Can anyone recommend a direction or procedure to look into, i.e, sql script, custom dts, etc. The items in parentheses identify specific portions of the text file.
(01)
101081,84423,customer ,072304,customer ,11310 Via Playa De Cortes , ,San Diego ,CA,92124,
(02) 6 ,1 , , , , ,22 ,1 ,0.00 ,160.46 ,160.46 ,0.00 , , , , , , , , ,1,1
(03)B130907540,5.41 ,1
(03)B130907550,5.41 ,1
(03)B130907560,5.41 ,1
(03)B130907570,6.04 ,1
(03)B065007550,1.72 ,2
(03)B065007560,1.72 ,6
(03)B519926530,4.66 ,13
(03)B519926550,4.66 ,12
(03)B560911200,2.14 ,1
(03)B560912500,2.14 ,1
(03)B095305750,3.65 ,1
View 5 Replies
View Related
Apr 7, 2008
I am trying to create a text file from multiple SQL Tables using @BCP_Command. I tried using DTS and SQL but the number of columns in the tables have to be the same size when doing a union. I also not to place a delimeter between each column. I've learned how to use BCP_commands on one file not sure if you can make it work with two or more.
Rich Pezick
View 3 Replies
View Related
Sep 26, 2013
Want to write from a table variable to a text file from a stored procedure.Read about xp_cmdshell bcp etc. but worried because it's supposed to be a security problem and needs to be from a permanent database.Also am getting error "The EXECUTE permission was denied on the object 'xp_cmdshell'..."
1. Is xp_cmdshell a bad idea to use even if I get permissions ?
2. Can a "permanent" table be used in a stored procedure starting out fresh each time with 0 rows rather than use a table variable ?
View 2 Replies
View Related
Oct 4, 2005
Alex writes "Windows Server 2003 Enterprise Version - SQL server 2000
SQL Enterprise Mgr Version 8.0
I am currently developing a backend SQL db for an ASP website. I am only learning, so quite new to it all & would appreciate some help with the following;
I currently have a form that updates a recordset in my SQL db. This is working fine, except for the fact that when the form loads and the db tries to write the field value into my text box, e.g. Address: 20 Harbour Drive, the field value is truncated at the space and it writes the address as 20 in the text box.
When I view the detail page, no problems, the recordset was updated, but when I go back to the update page, the record values are truncated again as though the ASP page thinks the space is some kind of delimiter?
The size property of my textbox element is the same as the varchar datatype size in the SQL table.
Can anyone help?
Thanks in advance, this is driving me nuts.
Alex"
View 1 Replies
View Related
Jul 20, 2005
I need to just back one table and not all the data in the table. Is there away to have SQL save the data return from a query to some text file that Ican then use to build the table in another table on another server?I am SQL server 7Thanks,S
View 1 Replies
View Related
Mar 29, 2006
hi
Writing to text file from table/view is done using osql,bcp etc. How do we write output of stored procedure into text file??
Thank you
View 4 Replies
View Related
Jul 8, 2013
Iam trying to crate a job, that writes the result set on text file and export to location like "abcxyz.txt"
job succeeds but i cant see any thing written on the file and i have given the same path in the job path option.
View 3 Replies
View Related
Nov 26, 2007
Is there a quick way to extract a full dump of 50 tables to 50 corresponding text files?
i.e.
table_a has to be extracted to table_a.txt
table_b has to be extracted to table_b.txt
table_c has to be extracted to table_c.txt
etc.
I don't want to have to add each one separately by hand in the DTSX package designer.
I can't see any way to do it in a loop (because you have to do the field mapping).
I can't seem to get the DTS Wizard to help - it only seems to be able to handle one table-to-text extract at any one time.
And I've tried editing the DTXS file directly (in XML) but it looks like it's going to be rather complex, even if I only do it to define the connection managers.
Feel free to suggest any better way to do this, though the specification has already been agreed, so I'm unlikely to be able to change it.
Thanks
View 3 Replies
View Related
Oct 30, 2006
I am trying to export data from a query in SQL Server 2005 SSIS to a flat file destination. Everything works fine except the rows returned from my query are written to the flat file in one long string (i.e., without line breaks). I have tried appending a new line character to the rows returned from the query but that only throws an error when the package is executed. My rows returned from the query are 133 characters wide (essentially only one column per row) so I have set the properties accordingly for a fixed width file format with 133 character wide rows.
Any suggestions or ideas on how to correct this would be greatly appreciated.
Thank you,
Michael
View 3 Replies
View Related
May 12, 2006
I am getting the following error running a data flow that splits the input data into multiple streams and writes the results of each stream to the same destination table:
"This operation conflicts with another pending operation on this transaction. The operation failed."
The flow starts with a single source table with one row per student and multiple scores for that student. It does a few lookups and then splits the stream (using Multicast) in several layers, ultimately generating 25 destinations (one for each score to be recorded), all going to the same table (like a fact table). This all is running under a transaction at the package level, which is distributed to a separate machine.
Apparently, I cannot have all of these streams inserting data into the same table at one time. I don't understand why not. In an OLTP system, many transactions are inserting records into the same table at once. Why can't I do that within the same transaction?
I suppose I can use a UnionAll to join them back together before writing to a single destination, but that seems like an unnecessary waste and clutters the flow. Can anyone offer a different solution or a reason why this fails in the first place?
Thanks in advance.
View 3 Replies
View Related
Jan 18, 2007
Hello,
I am trying to use a recordable CD as the storage medium for a comma delimited flat file destination in an SSIS package. I am running the developer edition of SQL Server 2005 on Windows XP SP2.
I discovered that in the file connection manager for a flat file, the path to the file can point to a directory on the CD-R. When I set the file name for the connection manager and point it to a file on the CD, the path looks something like this;
C:Documents and SettingsjuserLocal SettingsApplication DataMicrosoftCD BurningArchiveMonthlyMCTxnDetail_Archive.txt
When I run the package, the packge executes without a problem, but no 'burning' occurs. When I check the directory specified in 'file name', there is a header in the directory that states, 'Files Ready to Be Written to the CD'. The file I want to write to is listed there.
Is there some executable I can kick off in another task to complete the process of burning the file to the CD?
Thank you for your help!
cdun2
View 3 Replies
View Related
Sep 7, 2005
Hi guys,I have been trying to write data from a database to XML files andalthough i have been successful in doing that, the file(s) that are madeare not of the form that I would want.I am using:SQLDataSet.WriteXml(strFileName, XmlWriteMode.WriteSchema);to generate the files where strFileName is the name of the file. Thefiles when viewed with XML Editor are seen as lines of data instead ofthe regularly generated XML where each row is one below the other. Whenviewed with WordPad/Notepad i see elements />< betweeen the dataand somehow I think this has to do something with the problem.Can someone help me with this?? Any help or suggestion would be greatlyappreciated.Thanks.*** Sent via Developersdex http://www.developersdex.com ***
View 2 Replies
View Related
May 5, 2007
Hi,
I am working on a project where data is stored remotely in a Postgres database. I need to download some of the postgres data and store it in the SQL Server. The data in PG is in UTF-8. I use another application to write the data to the PG database. To talk to the PG database I am using the npgsql data provider (http://gborg.postgresql.org/project/npgsql/projdisplay.php). The data I am trying to download is arabic.
Everything seems to work fine except when I get the data from the PG DB and write it to SQL Server. I've done lots of debugging and can see that the data is correctly in arabic write until I do the update on the local dataset which saves it in SQL server. For some strange reason it makes the data into jibberish (just question marks).
I am using SQL Server express 2005. If anyone can help me with this I'd be extremely grateful as this has become a big problem and I've tried to find a solution without any success.
Thanks in advance.
Ziad
View 2 Replies
View Related
Jul 5, 2006
I am using OLE DB Destination to write data to a SQL server database. However, nothing is written to the database though there is no error reported. See the following output:
SSIS package "Tbl_Dim_Dates.dtsx" starting.
Information: 0x4004300A at Tbl_Dim_Dates, DTS.Pipeline: Validation phase is beginning.
Information: 0x4004300A at Tbl_Dim_Dates, DTS.Pipeline: Validation phase is beginning.
Information: 0x40043006 at Tbl_Dim_Dates, DTS.Pipeline: Prepare for Execute phase is beginning.
Information: 0x40043007 at Tbl_Dim_Dates, DTS.Pipeline: Pre-Execute phase is beginning.
Information: 0x4004300C at Tbl_Dim_Dates, DTS.Pipeline: Execute phase is beginning.
Information: 0x402090DF at Tbl_Dim_Dates, OLE DB Destination [2396]: The final commit for the data insertion has started.
Information: 0x402090E0 at Tbl_Dim_Dates, OLE DB Destination [2396]: The final commit for the data insertion has ended.
Information: 0x40043008 at Tbl_Dim_Dates, DTS.Pipeline: Post Execute phase is beginning.
Information: 0x40043009 at Tbl_Dim_Dates, DTS.Pipeline: Cleanup phase is beginning.
Information: 0x4004300B at Tbl_Dim_Dates, DTS.Pipeline: "component "Date extract to file" (924)" wrote 3652 rows.
Information: 0x4004300B at Tbl_Dim_Dates, DTS.Pipeline: "component "Raw File Destination" (2518)" wrote 3652 rows.
Information: 0x4004300B at Tbl_Dim_Dates, DTS.Pipeline: "component "OLE DB Destination" (2396)" wrote 3652 rows.
SSIS package "Tbl_Dim_Dates.dtsx" finished: Success.
The program '[2708] Tbl_Dim_Dates.dtsx: DTS' has exited with code 0 (0x0).
View 4 Replies
View Related
Nov 26, 2007
I'm trying to do this: ------------------------------------- 1) Have SQL server return some data from this simple stored procedure. It returns XML: SELECT * FROM eAccessTypes FOR XML AUTO ------------------------------------- 2) In my C# I capture the return value in an XmlReader like so: XmlReader xmlr = mySqlCommand.ExecuteXmlReader();
After this i want to write the xmlr data to a file.
Any ideas
View 2 Replies
View Related
Feb 16, 2008
Hi Guys
In my project I need to write the data from an xml file to Database through a stored precedure.
On line a lot of help is available for writing data from Database to xml but I didnt see much info
about writing xml to database.
If any one could give me some code I will really appreciate it.(I am a newbee).
This application is developed using asp.net 1.1 and sql server 2005.
Thanks for your help in advance.
View 3 Replies
View Related
Sep 9, 2004
I'm trying to read a byte array of an image datatype from sql server, and then to put this in another field in the database. I get a byte array, but somehow the image doesn't get into the db well with the sql parameters. Does anyone have an idea how to tackle this problem?
Thanks a lot, Hugo
View 2 Replies
View Related
Aug 1, 2001
hi,
DataBase i am using is Sql Server6.5.
In a trigger i had written code to transfer updated records from one table to
other table.These updated records needs to be written into a text file.
I had used xp_cmdshell but it is taking time.Is there a way to write data to
flat file.
thanks in advance
karuna
View 2 Replies
View Related
Feb 14, 2008
Hi,
I have a data structure called 'Quote' which contains a number of different variables and controls ranging from text boxes, check boxes and radio buttons, i need to be able to read and write this from a database.
First I think a description of my overall project is needed:
Project Description
I have been given a brief that basically says: i have to create a programmed solution in VB to solve a problem. This problem can be anything we like, and I personally have chosen to create a program that manages quotes for building Log Cabins (this is very contrived and far from anything someone would do in the real world).
My solution will allow a generic user to create a quote (using a form with controls such as text boxes, check boxes, radio buttons) , and then save this to file. These users may then wish to load/edit this quote at a later date, from another form.
Whilst completing this project, i'll only have up to about 5 records (quotes) within the system, so i dont need the ability to store hundreds of records. And each record will be relatively short, with only about 10-15 data items within the data structure.
Also the Admin (or business owner in this case) need to be able to view all saved quotes in a presentable format, and edit them if needs be, from within this same program.
This solution does not need to be absolutely perfect and 100% efficiently coded, or have all the bells and whistles a real-world program would have. This is for an A level computing project by the way.
So basically, i need to be able to read from the database (to populate a Data Grid (i imagine this is best way?)) and so Admin can access any quote and edit it (editing is not vital, but viewing/printing is. Maybe i should stop at just viewing any quote?). Also i need generic users to be able to fill in the Edit Quote form and then save this data into the database.
And is a data structure really required for me to use a database?
I've never used databases in VB before (but have used them elsewhere, mainly Access) and so am completely new to this. Any help will be much appreciated.
Thanks
View 13 Replies
View Related
Oct 24, 2006
I am having a problem with an ASP program that inserts data into a table on
SQL Server 2000.
No error msg is returned upon submission and the confirmation msg that
displays after the commit command is sent to the server displays, but when
we go to the DB, the data sent isn't there. This is an occassional
occurance and usually the data is there, just some times, it isn't. Other
forms function just fine, using the *exact* same file to perform the submit
function (all the forms "include" the same submit page). The only
difference we can find is a trigger on the table having problems which
executes upon update, capturing the information about who updated the record
when. From what we can see, this is the only programmatic difference. The
other thought tickling our minds was the possiblity of a simultaneous
submission, since all the users submit with the same db user name via the
form, if user 1's data gets written but not yet commited, user 2's data is
submitted, then the commit transaction is submitted by user 1 as the program
steps run in sequence, would the commit by user one cause eiither of the
records inserted but not commited to be lost? If so, why wouldn't that be causing problems on other forms ...
View 2 Replies
View Related
Feb 6, 2007
Hello,
I was using for years an application that had an MSDE database.
Recently. I've upgraded my computer to Windows Vista, so I had to upgrade MSDE to SQL Express.
I've managed to attach the old MSDE database of the application to SQL Express, and I am able to retrieve my data from within the application.
My problem is that I can not write or update data from within the application anymore. However, If I open a table in SQL Management Studio Express I can write/ update data with no problem.
The company that build the application I was using doesnt exist any more so I cant take any support from them.
The only thing I know for a fact is that the application is connecting to the database using the sa user.
Any ideas?
Thanks a lot in advance!!!
Tassos
View 3 Replies
View Related
Sep 23, 2006
Can someone show me the command string required to write data out to 2 or 3 tables at once? How about how to write 2 entries at once? Write now my solution writes 1 record to a table and then I write somewhere around 40-200 records to a second child . Write now I'm writing like this:Open --> Add 1 record in table #1 --> closeOpen --> Add 1 record in table #2 --> closeOpen --> Add 1 record in table #2 --> closeOpen --> Add 1 record in table #2 --> closeOpen --> Add 1 record in table #2 --> closeand I'm just wondering if there is a better approach, such as writing all the data at once. Something like:Open --> Add 1 record in table #1 --> Add 5 records in table #2 --> close
View 1 Replies
View Related
Jun 29, 2007
I have a project were I will have it so that users can sign in and change information on an SQL server. The catch is that this site will be from a different domain name and from a different hosting company then where the SQL database is located. Sorry if this is a dumb question but how can I utilize asp.net to change and view an SQL database that is located else-where.
For example: a user logs into www.something.com and he/she can view and edit SQL tables from www.somethingelse.com's database.
Thanks in advance.
View 2 Replies
View Related
Mar 9, 2006
First of all let me say that ASP.NET a new programming environment for me so please forgive my ignorance.
Can someone please tell me how to write data to a SQL table that is a Binary data type? I have a stored procedure on the SQL server that I am calling to insert data into a table. I build a parameter list and set the values. It worked just fine before I added a binary field to the SQL table. My problem is that I don't know how to set the Binay data type to pass it to the stored procedure. Here is part of the code:
GetCMD = Myconnection.CreateCommand
GetCMD.CommandType = CommandType.StoredProcedure
GetCMD.CommandText = "SCHEMANAME.InsertLineItem"
GetCMD.Parameters.Add("HEADER_ID", SqlDbType.VarChar, 150)
GetCMD.Parameters("HEADER_ID").Value = "some value"
GetCMD.Parameters.Add("@OPTIONS", SqlDbType.Binary)
GetCMD.Parameters("@OPTIONS").Value = HOW DO I SET THIS VALUE????
rowsaffected = GetCMD.ExecuteNonQuery()
I assume serialization but have not figured out how. Anyone's help is greatly appreciated!!
View 1 Replies
View Related
May 14, 2008
Hi All,
Here is the scenario:
I am inserting data into a spread sheet from user interface(power builder). But at the same time some one can open that excel spread sheet to read the data. Then the process was going to fail(it won't able to write the data in to the spread sheet). How to avoid this situation? I really appreciate if anyone can shed some light.
Thanks in advance!!
View 2 Replies
View Related
Oct 29, 2007
Hi All,
I currently have the problem that I have to write some data into a SUN Directory Server 5.2 LDAP directory.
Does anyone know how I can do this. I already found some articles in this forum that provide solutions how to access
the active directory - but how can I access a none Microsoft LDAP Server?
Is there any way to use the OLE DB Destination or do I have to implement my own LDAP adapter in VB.net?
Thanks a lot for help.
View 1 Replies
View Related
Apr 28, 2008
i am trying to write a store procedure which inserts data from flat file to table but i want to align the rows for data transformation, like which column should be transferred to which column on the existing table. can anyone help me with this..i know how to do it thru DTS or SSIS but just want it in script...
cheers
Derek
View 10 Replies
View Related
Jan 10, 2006
Hi -
I've never used SQL for anything but simple copies and queries, and now I need to do something that's probably simple, as well, but I don't know how to start. I need to update values in a text field with new values from another table. I can do it individually with an update statement (Set [field1] = 'newvalue' where [field1] = 'oldvalue'). But I have 400 different values and a bunch of different tables that need to be updated, and can't imagine that's the only solution. I can make up a simple table that will have all the old values in one column, and the new values in the next. I need a statement that look at the old value, then fetch the new value from the table I made, and replace the old value with the new.
I've looked at various help files and tried to search for a solution elsewhere, but I'm not coming up with anything. I guess I just don't know where to look. Thanks in advance for any help you can give me.
Rebekkah
View 5 Replies
View Related