Write Text Files In Transac Sql

Jul 20, 2005

Hi

I need create, write and read text files in a procedure transac sql
from sql server 2000
How i do this ??




Thanks,

View 3 Replies


ADVERTISEMENT

How To Import A Text File With Transac-sql

Mar 27, 2007

Hi allI am looking for examples of scripts that will help me doing these things:
 - import a text file delimited with the character "*", representing a new month of data, for example data from march 2007
- create a new table with the structure of an existing one to import the data, for example  Data_March_2007
- alter an existing totals table adding a new column for the new moth imported, adding a new colum for the month of March 2007.
 
 

View 1 Replies View Related

Error Msg 6522, Level 16, State 1 Receives When Call The Assembly From Store Procedure To Create A Text File And To Write Text

Jun 21, 2006

Hi,
I want to create a text file and write to text it by calling its assembly from Stored Procedure. Full Detail is given below

I write a code in class to create a text file and write text in it.
1) I creat a class in Visual Basic.Net 2005, whose code is given below:
Imports System
Imports System.IO
Imports Microsoft.VisualBasic
Imports System.Diagnostics
Public Class WLog
Public Shared Sub LogToTextFile(ByVal LogName As String, ByVal newMessage As String)
Dim w As StreamWriter = File.AppendText(LogName)
LogIt(newMessage, w)
w.Close()
End Sub
Public Shared Sub LogIt(ByVal logMessage As String, ByVal wr As StreamWriter)
wr.Write(ControlChars.CrLf & "Log Entry:")
wr.WriteLine("(0) {1}", DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString())
wr.WriteLine(" :")
wr.WriteLine(" :{0}", logMessage)
wr.WriteLine("---------------------------")
wr.Flush()
End Sub
Public Shared Sub LotToEventLog(ByVal errorMessage As String)
Dim log As System.Diagnostics.EventLog = New System.Diagnostics.EventLog
log.Source = "My Application"
log.WriteEntry(errorMessage)
End Sub
End Class

2) Make & register its assembly, in SQL Server 2005.
3)Create Stored Procedure as given below:

CREATE PROCEDURE dbo.SP_LogTextFile
(
@LogName nvarchar(255), @NewMessage nvarchar(255)
)
AS EXTERNAL NAME
[asmLog].[WriteLog.WLog].[LogToTextFile]

4) When i execute this stored procedure as
Execute SP_LogTextFile 'C:Test.txt','Message1'

5) Then i got the following error
Msg 6522, Level 16, State 1, Procedure SP_LogTextFile, Line 0
A .NET Framework error occurred during execution of user defined routine or aggregate 'SP_LogTextFile':
System.UnauthorizedAccessException: Access to the path 'C:Test.txt' is denied.
System.UnauthorizedAccessException:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, ileOptions options)
at System.IO.StreamWriter.CreateFile(String path, Boolean append)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
at System.IO.StreamWriter..ctor(String path, Boolean append)
at System.IO.File.AppendText(String path)
at WriteLog.WLog.LogToTextFile(String LogName, String newMessage)

View 13 Replies View Related

Write In Files

May 31, 2004

Hi ..
How can i write or read in a file.*
forexample a.txt in a strore Prosedure ?

thanks

View 2 Replies View Related

Problems Importing Text Files With Double-quotes As Text Qualifier

Jul 14, 2006

I have text data files from a third party and they use comma as field delimiters and enclose the text for each column in double-quotes. Not a problem for most of the data files until they start sending files where there is " within the column values. SSIS package fails with the error:

The column delimiter for column "Column 1" was not found.

Any ideas on how to resolve this issue will be greatly appreciated.Thankspcp

View 15 Replies View Related

How To Write Text In SQL Column

Feb 5, 2005

Hi:

I wanna write text in a sql column of type nvarchar, this text is of type Query, Do you understand me?

Mi problem is that when I write this:

SELECT * FROM SCAT WHERE SC_ID = 'froog'

The simple comillas, they cause an error in my command of insert.

How can I write this type of text in a colum SQL?

View 1 Replies View Related

Write Text Urgent

Nov 15, 2000

Can Some one please tell me how can I write text to SQL Database. Schema is as follows

Database Name db1
Code : varchar(3)
description : Text


I need to append the follwoing "This is testxxx" into field Description for Code = "AAA"

Urgent Pls help
Thanks in advance

View 1 Replies View Related

Write To Text File

Mar 8, 2001

I am using bcp to write from a query or table into a text file from a stored procedure. No problem. However, what do I do if I want to write to a text file from another stored procedure which returns a record set? Any help gratefully received. thanks.

View 1 Replies View Related

T-SQL (SS2K8) :: How To Write A Procedure To Upload XML Files Into Above Tables

Jul 15, 2014

There are two tables in my database HotelList_Temp, AsiaHotelChildrenAges_Temp

I need to write a procedure to upload the xml files into above tables .xmlfile is in my pc

xml to table column mapping are given below

<HOTEL>
<SEQNO>1</SEQNO>
<GRADE>5</GRADE> --StarRating
<PRODUCT>H</PRODUCT>
<CITYAREA>CKOWM</CITYAREA> --CityLocation
<CITY>HKG</CITY> --ResortCode
<CITYAREANAME>Mong Kok </CITYAREANAME> --ResortName

[code]....

View 9 Replies View Related

C# And SQL Server. Why Select Can Transac But Insert ?

Jan 4, 2005

string connectionString;
string queryString;
SqlConnection sqlconnection;connectionString="server=fatyi;integrated security=SSPI;initial catalog=tempdb";
queryString="insert into products values(5,'BaoMa',200596,900000,0)";
sqlconnection=new SqlConnection(connectionString);
SqlCommand addScorce=new SqlCommand(queryString,sqlconnection);
sqlconnection.Open();
addScorce.ExecuteNonQuery();
sqlconnection.Close();

help to find out why? if i use "select" it can transaction in this code. And here "insert" .My WebAplication could work,but have no result of "insert".and no error information.The "insert" purview of "products" table have selected.
I help you can help me to point out maybe where is error.
Thank you !

View 1 Replies View Related

Creating And Configuring JOBs Using Transac-SQL

Sep 17, 1999

I am new to SQL7 (in fact new to Database Management as well).

I am trying to write some store procedures to create and manage JOBs within SQL7 Server. For example, to cause data-migration to a different place everyday at certain time. I have tried to use things like sp_add_job. However, I kept getting messages like "Cannot find procedure sp_add_job" although I can see it under Master database. (I have been refering to Master database when I tried these commands).

What I would like to achieve at the end is to be able to specify and create JOBs entirely using Transac-SQL. (I have made it with the Enterprise manager, but that can not be the solution here. )Any help and tips would be greatly appreciated!

View 2 Replies View Related

Creating And Configuring JOBs Using Transac-SQL

Sep 21, 1999

I am new to SQL7 (in fact new to Database Management as well).

I am trying to write some store procedures to create and manage JOBs within SQL7 Server. For example, to cause data-migration to a different place everyday at certain time. I have tried to use things like sp_add_job. However, I kept getting messages like "Cannot find procedure sp_add_job" although I can see it under Master database. (I have been refering to Master database when I tried these commands).

What I would like to achieve at the end is to be able to specify and create JOBs entirely using Transac-SQL. (I have made it with the Enterprise manager, but that can not be the solution here. )Any help and tips would be greatly appreciated!

View 1 Replies View Related

Running Transac SQL In Command Line

May 4, 2004

Hi all

I currently have a problem where I need to create a backup from MSSQL, via a command line, ideally from a batch script. This is on a PC. Each machine has SQL Server 2000 on.

I just need to know the code that dos will tell it to run the sql statement. Ideally the command will also give the directory to place the backup.

Regards MiloJ

View 2 Replies View Related

Write Output To A Text File

Jan 28, 2002

how to write a query output into a text file in a c: directory
the field datatype is text .

Thanks

Al

View 2 Replies View Related

Write To Text Destination Only The 2006-03-13

Mar 4, 2008

Hi,

I want to convert/write from my source to my text file: the date column.

I have a date column of : 2006-03-13 00:00:00.000

but when it writes to flat destination i only want to write: 2006-03-13

Any ideas, Please assist!

Regards

View 4 Replies View Related

Retrieve From Db Then Write To Text File

Jan 4, 2007

basically i am trying to create a program wherein after saving a new transaction to the sql database, the fields saved will be retrieved and then written to a text file.

i read a thread here which is similar to what i am trying to do but it was in xml format..

hope someone anwers me...i really need help!

thanks!

View 1 Replies View Related

Help, How To Write 2 Outputs To One Text File??

Mar 13, 2007

Hi,

SQL Server 2005, sp2

What I am trying to do is very simple. I just want to run 2 stored procedures, then have the output from both sp's written to a single file.

I created a Data Flow task, then put 2 OLE DB Source adapters in the Data Flow task, one for each stored procedure.

Next, I dropped a Flat File destination object onto the page. However, I can only connect ONE arrow from one of the OLE DB Source adapters to the Flat File destination. It won't let me connect both.

What am I doing wrong here? How can I accomplish what I am trying to do here?

Thanks much

View 3 Replies View Related

Is Ssis The Only Technology That Can Read/write Raw Data Type Files?

Sep 21, 2007

I'm contemplating a sql server archive strategy that rolls really old data off any sort of dbms and onto low cost media like dvds in a non relational archive format. I dont want to ever worry about these archives spanning different versions of sql when i go to retrieve a range of data that happens to span sql versions (eg one disc was sourced from 2005 another by 2008 but my report needs a union of both).

So I'm thinking about neutral/efficient formats for these archives and a live homegrown catalog that can determine exactly what disc(s) need to be mounted based on passed from and to date parameters...all so that the data that might span discs (and versions and maybe even schemas) can be merged and loaded into my sql version d'jour's "throw away" archive database for a one time report or other unplanned activity.

I remember raw data types being very convenient as an ETL format for our customers who have ssis, but wouldn't want our sqlexpress customers to be left without the archiving capability. Do the "things" that read and write raw data files really originate in some special T-SQL command that all sql editions can use, or is it strictly an ssis thing?

View 4 Replies View Related

Write To A Text File From A Stored Procedure

Oct 19, 2011

I have a sp which saves the necessary information regarding the status of action(whether success or failure, rows affected etc) to a log table say( StatusLog )After this, I was sending a database mail with information taken from the log table via sp_send_dbmail. Now I would like to write the status information to a 'txt' file instead of sending via mail.How can I write to a text file from a stored procedure in ms sql server 2005?

View 6 Replies View Related

Write Content Of TEXT Field To A File

Sep 19, 2007

I have a table with a column [FileData] of type TEXT or XML. I need to write the content of the column to a file, using sp_OAWrite for example, but the stored procedure who needs to read the content and write it to the file does not work because the limitation is no local variable for those types. What use is that datatype if i can not use it in procedures like this?

Anyone out there who could give me a tip on how to solve that?

View 6 Replies View Related

SQL 2012 :: TEMPDB High Avg Write Wait Time On Data Files

Apr 15, 2014

I am currently investigating aa high avg write time ms issue (145ms) which seems to be only occuring on the tempdb data files.I have followed the recommended setup of TEMPDB in that

1. Data files = number of physical cores
2. Data files and logfiles are on separate partitions away from the other databases.
3. Tempdb is presized and no incremental file increases look like they are happening with frequency.

We have sharepoint 2012 setup on other sql servers and with TEMPDB setup following the same guidelines, with far more Sharepoint activity on a similary specified hardware which is why its confusing.FileIO auditing on the partitions themselves shows that the FileIO is very fast on the partitions that the tempdb data file which leads me to beleive that Sharepoint may be the culprit perhaps due to excess use of tempdb with operations taking a long time to resolve.

View 3 Replies View Related

Added A Column To My SQL Database And Now Text Field Will Not Write To It. Why???

Aug 28, 2006

I have a web form that is an interface for a database.  The code was working fine until a field needed to be added.  So I added the new field, updated the data adapter and data set, and when i enter the data into the field, all of the old fields are getting updated, but the new ones aren't.  I am at wits end as to why.  Can someone please help!!! I am using VS Studio 2000 ASP.NET and C#.  The code is below.  The bold items are the new fields.using System;using System.Collections;using System.ComponentModel;using System.Data;using System.Drawing;using System.Web;using System.Web.SessionState;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.HtmlControls;namespace TrafficDept{/// <summary>/// Summary description for AddOwner./// </summary>public class AddOwner : System.Web.UI.Page{protected System.Web.UI.WebControls.Button Button1;protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator3;protected System.Data.SqlClient.SqlConnection sqlConnection1;protected System.Web.UI.WebControls.TextBox TextBox1;protected System.Web.UI.WebControls.TextBox TextBox2;protected System.Data.SqlClient.SqlDataAdapter daAddOwner;protected System.Web.UI.WebControls.TextBox tbOtherOwnerLName;protected System.Web.UI.WebControls.Panel namePanel;protected System.Web.UI.WebControls.TextBox tbOtherOwnerMI;protected System.Web.UI.WebControls.TextBox tbOtherOwnerFName;protected System.Web.UI.WebControls.TextBox tbSecondOwnerLName;protected System.Web.UI.WebControls.TextBox tbSecondOwnerMI;protected System.Web.UI.WebControls.TextBox tbSecondOwnerFName;protected System.Web.UI.WebControls.Button Button4;protected SiteCubed.EditWorksProfessional tbNote;protected System.Web.UI.WebControls.Panel notePanel;protected System.Web.UI.WebControls.DropDownList ddlStatus;protected PeterBlum.PetersDatePackage.DateTextBox tbRegDate;protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2;protected System.Web.UI.WebControls.TextBox tbOwner;protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;protected System.Web.UI.WebControls.TextBox tbOwnerMI;protected System.Web.UI.WebControls.TextBox tbOwnerLName;protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator4;protected System.Web.UI.WebControls.TextBox tbBusinessName;protected System.Web.UI.WebControls.TextBox tbAddress;protected System.Web.UI.WebControls.TextBox tbRegNo;protected System.Web.UI.WebControls.TextBox tbPreviousOwner;protected System.Web.UI.WebControls.TextBox tbPOwnerAddress;protected System.Web.UI.WebControls.TextBox tbPORegNo;protected PeterBlum.PetersDatePackage.DateTextBox tbTransferDate;protected System.Web.UI.WebControls.DropDownList ddlMeans;protected System.Web.UI.WebControls.Button Button3;protected System.Web.UI.WebControls.Button Button2;protected System.Data.SqlClient.SqlCommand sqlSelectCommand1;protected System.Data.SqlClient.SqlCommand sqlInsertCommand1;protected System.Data.SqlClient.SqlCommand sqlUpdateCommand1;protected System.Data.SqlClient.SqlCommand sqlDeleteCommand1;protected TrafficDept.dsAddOwner dsAddOwner1;  private void Page_Load(object sender, System.EventArgs e){// Put user code to initialize the page here}#region Web Form Designer generated codeprivate void Button2_Click(object sender, System.EventArgs e){Response.Redirect("AddOthers.aspx");}private void Button1_Click(object sender, System.EventArgs e){daAddOwner.Fill(dsAddOwner1);dsAddOwner.OwnershipRow drOwner = dsAddOwner1.Ownership.NewOwnershipRow();drOwner.Plates_ID = int.Parse(Session["PlatesID"].ToString());drOwner.Status = ddlStatus.SelectedItem.Text;drOwner.Current_Legal_Owner = tbOwner.Text;drOwner.Owner_CurrentLegalOwnerMI = tbOwnerMI.Text.ToString();drOwner.Owner_CurrentLegalOwnerLName = tbOwnerLName.Text;drOwner.Owner_CurrentBusinessName = tbBusinessName.Text;if (!tbRegDate.xIsEmpty)drOwner.Date_of_Registration = DateTime.Parse(tbRegDate.Text.ToString());drOwner.Address_of_Current_Owner = tbAddress.Text;drOwner.Reg_No_for_Current_Owner = tbRegNo.Text;drOwner.Previous_Owner = tbPreviousOwner.Text;drOwner.Previous_Owner_Address = tbPOwnerAddress.Text;drOwner.Reg_No_for_Previous_Owner = tbPORegNo.Text;if (!tbTransferDate.xIsEmpty)drOwner.Date_of_Transfer = DateTime.Parse(tbTransferDate.Text.ToString());drOwner.By_Means_of = ddlMeans.SelectedItem.Text;drOwner.Owner_SecondaryLegalOwnerFName = tbSecondOwnerFName.Text;drOwner.Owner_SecondaryLegalOwnerMI = tbSecondOwnerMI.Text;drOwner.Owner_SecondaryLegalOwnerLName = tbSecondOwnerLName.Text;drOwner.Owner_OtherLegalOwnerFName = tbOtherOwnerFName.Text;drOwner.Owner_OtherLegalOwnerMI = tbOtherOwnerMI.Text;drOwner.Owner_OtherLegalOwnerLName = tbOtherOwnerLName.Text;drOwner.Owner_Notes = tbNote.Text;dsAddOwner1.Ownership.Rows.Add(drOwner);daAddOwner.Update(dsAddOwner1);Response.Redirect("AddOthersTP.aspx");}private void Button3_Click(object sender, System.EventArgs e){//daAddOwner.Fill(dsAddOwner1);//dsAddOwner.OwnershipRow drAddOwner = dsAddOwner1.Ownership.NewOwnershipRow();namePanel.Visible = true; }private void Button4_Click(object sender, System.EventArgs e){notePanel.Visible = true;}}}

View 1 Replies View Related

DTS To Write To Text File (fails When Scheduled) (Urgent!!!)

Aug 21, 2001

Recently converted from 7 to sql 2k.

Running NT 4.0, sp6a. and sql 2k. I have a DTS job that works just fine if i go to 'design view' and then 'execute' it. But if I schedule it, the following error appears.. My question is... why? Also I modified the path from the current below (denapp02cmc$cd01.txt to the local path of the server as well... still came up with the same problem. ?? TIA! ::

DTSRun: Loading... DTSRun: Executing... DTSRun OnStart: Copy Data from Results to denapp02cmc$cd01.txt Step DTSRun OnError: Copy Data from Results to denapp02cmc$cd01.txt Step, Error = -2147467259 (80004005) Error string: Error opening datafile: Access is denied. Error source: Microsoft Data Transformation Services Flat File Rowset Provider Help file: DTSFFile.hlp Help context: 0 Error Detail Records: Error: 5 (5); Provider Error: 5 (5) Error string: Error opening datafile: Access is denied.

View 2 Replies View Related

Reporting Services :: How To Write Custom Legend Text

Oct 23, 2015

I was trying to write a custom legend text for a chart that I have in SSRS. In the chart I have a Bar chart and a Line chart. I have two values coming from a dataset. One is a running value. All the series values are from year dataset.

I need to get a custom legend text for the three data series looking like this. "2013- Mth", "2014-Mth". Year should be dynamic and coming from the dataset.

I tried writing an expression in the series legend option as shown below.

But I don't get the required text for the chart. I only get the default series text for the legend. If I only write a text without the dynamic year taken from the dataset columns I get the custom text. But not when I concatenate the dynamic year series with the static text. Any property to enable/disable?

View 2 Replies View Related

How Do You Write Text Upside Down In A Textbox On A SSRS Report?

Dec 27, 2007



I found this thread which allows me to write vertical from the bottom up but I want to flip the text 180 degrees and write it upside down:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=559933&SiteID=1

I tried modifying it and playing around with the TranslateTranform function but I'm really confused on how it works. I can get the first letter in my text to be upside down but the rest is not showing up. It's like it's being cut off or something. Can anyone point me in the right direction?

Thank you in advanced.

View 1 Replies View Related

Linked Server To Text Files: Is Possible To Detect Changes Made To Those Files? (SQL Server 2005)

Sep 3, 2007

Hi gurus,

I've created a linked server (and set up the corresponding schema.ini file) in order to perform bulk-inserts from some CSV text files into SQL tables (from my standpoint the text files are just for reading purposes). The linked server works fine (I can select the data in the files without a problem).

Now the question: is possible to automatically detect when one or more of those files change in order to start the import process automatically? Something like having a trigger created on the CSV files Or there's no easy way to do that so I have, to say something, to create a Job that periodically checks if the files have changed programatically (say, recording each file's timestamp everytime is imported and comparing the recorded value with the current one, or whatever)?


Thanks a lot in advance!

View 1 Replies View Related

SQL 2012 :: Blank Database Created On Two Separate Disks - Write To Multiple Files

Mar 17, 2014

I am testing out a blank database created over two physical files on two separate disks with one table called data which has one column called values nvarchar(max).

I filled the table up with a whole load of data and ran a select * against it. If I run Permon at the same time I can see that the read load has been spread over multiple disks as each of these disks is getting read from in parallel. If I create the same database on a single file and run the same select * again it takes much longer, proving that the read load has been distributed across multiple disks.

Now moving onto writes, this is where the confusion lies. I understand that SQL server fills files evenly until they need growing, after which it will then fill files individually until they are full in a round robin fashion unless you have trace 1117 turned on. What I don't understand is why the writes aren't distributed out whilst it is filling these file groups.

I ran an continual insert into my table with go 1000000 to monitor how the files are being filled up. I monitored where SQL server was physically placing the files as they were being inserted by running the following query:

;WITH CTE AS
(SELECT
sys.fn_PhysLocFormatter (%%physloc%%) col1,
RIGHT(LEFT(sys.fn_PhysLocFormatter (%%physloc%%),2),1) AS [Physical RID],
DATAID

[Code] ....

I could see that it would a thousand or so records into file 1, then a thousand or so into file 2, then a thousand or so into file 1 etc etc. In another words it would hit one disk, then another disk, then back to disk one to fill the file evenly. Is there any way to make SQL Server distribute the writes out in parallel so that both disks are writing in tandem?

By the looks of it, multiple disks only scale reads, as with writes only one disk is ever written to at once which is annoying. Any way to harness the write power of multiple disks?

View 6 Replies View Related

How To Write Selected Table Data To A Text File Daily?

Aug 24, 1999

I want to check a table to see what rows have been updated today, then write to a text file some data from the selected rows; then I want to automate this (DTS package? TSQL stored procedure job?) to run every night at midnight. Is the DTS Wizard the best way, that's what I did, but have not confirmed that it is writing a new text file every day, and does each new version write over the old one?

View 1 Replies View Related

SQL Server 2012 :: How To Write Text Out To Grid View In Results Tab

Dec 1, 2014

I can create a string into a local "@" variable. It can include a date/time, and text for my timing testing.

I need to be able to send that string to the results window where table output goes, rather than to the message window where a PRINT statement goes.

How do I do that?

View 2 Replies View Related

Using Script Destination Object To Create And Write To New Text File

Jul 31, 2007

Is there a better way to do this?

We've all seen this, where it uses an individual .write statement for each column.





Code Snippet

Public Overrides Sub AWCCogent_ProcessInputRow(ByVal Row As AWCCogentBuffer)


With textWriter

Dim item As Object

If Not Row.AddressID_IsNull Then
.Write(Row.AddressID)
End If
.Write(columnDelimiter)
If Not Row.City_IsNull Then
.Write(Row.City)
End If

.WriteLine()


End With

End Sub


But hard coding this seems not the smartest way. Especially since in my text file, there needs to be close to 100 columns. This could be a nightmare to update down the road. But I can't seem to find the object collection to loop through, like row.items which would seem to be logical.

There's gotta be a better way, right Microsoft?

View 4 Replies View Related

T-SQL (SS2K8) :: Trigger To Call A Program To Write Text File Onto A Folder In Server

Apr 29, 2014

I have created a trigger to call a program that is written by our program. The program is basically read the record in the table and write to a text file, then delete the record from the table.

The trigger is a after insert trigger. After we added the trigger, we insert a record to the table. The result is that the record still and did not get deleted. Also, the text file didn't get created either. It seems that it take a long time for the record to be written to the table.

But if we just run the program (a exe file), it can write a text file in the folder and delete the record. the trigger is basically:

USE [Zinter]
GO
/****** Object: Trigger [dbo].[ZinterProcess] Script Date: 04/29/2014 18:34:56 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

[Code] ....

View 9 Replies View Related

T-SQL And Text Files

Sep 26, 2006

I was asked at work to create an audit log to track user changes to our SQL Server 2005 database.  My plans were to use a trigger to store the changes in a database table.  I was just told that rather then storing these changes the database, that I should write these changes to a text file. I am having problems finding a good example of how to write to a text file in T-SQL.   Does anyone have an example of how to do this? Thanks

View 2 Replies View Related

DTS For 100 Text Files

Jan 16, 2004

Hello DBA's:

I want to upload 100 text files to a single table on SQL Server 2000.
Records from these text files would be selected on the basis of a where clause.

What would be the best way of accomplishing this? Using DTS, I can do only one file at a time. Is there a faster approach.

Thanks

Vivek

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved