SP To Write File On Another Machine

Feb 14, 2008

Hi,
I m new to SQL,I have created a Stored Procedure that writes a file on SQL server,but I want that it should write file on another machine.How can it be done.

View 2 Replies


ADVERTISEMENT

SQL Sever 2005 Write XML Data Stored In A Table Out To A XML File On My Local Machine

Mar 16, 2008

Hello All
Just wondered if someone could help me with a bit of T-SQL, i have a application in ASP.NET/VB that allows the user to update a message board by clicking a button "update" this in turn triggers my Stored Procedure for inserting this data into a table, which works great.
It inserts the data into its respective fields and also takes The Title, Line 1, Line 2 and so on and creates a XML file  (Using FOR XML) which is stored in the same Table under a column call XML_Data. Which again works great.
My problem now is how do i output this XML_Data to an actual XML file that is on my local machine, i.e. It be created in say C:Inetpubwwwrootxmlfiles("xml file name inserted here from another column that holds xml file name").xml
Any help on this would be greatfully apreciated
 Thanks In Advance
Neil

View 4 Replies View Related

Backup Master Key, Cannot Write Into File 'c: Empmaster'. Verify That You Have Write Permissions, That The File Path Is Valid.

Jul 12, 2006

Hi,



I tried to backup the master key by the following syntax :

OPEN MASTER KEY DECRYPTION BY PASSWORD = 'mypassword'

BACKUP MASTER KEY TO FILE = 'c: empmaster' ENCRYPTION BY PASSWORD = 'mypassword'

but it failed and i got the following message:

Cannot write into file 'c: empmaster'. Verify that you have write permissions, that the file path is valid, and that the file does not already exist.

NB: I am using the "sa" user to execute this command.

I know that we have a security permission issue , but where and how ?



Regards,

Tarek Ghazali

SQL Server MVP

View 12 Replies View Related

SQL 2005 Enterprise Edition The Image File Setup.exe Is Valid, But Is For A Machine Type Other Than The Current Machine

Nov 28, 2006

Hi All,

I have enterprise version software CD1 and CD2 of SQL server 2005

when i try to run setup.exe..the following error pops -up

The image file Setup.exe is valid, but is for a machine type other than the current machine

MY OS version is windows 2003 32bit Operating system...

I am suspecting the binarie may be of 64bit.. How do we check the binaries are 32 bit and 64 bit software

Thanks for your Help

Mohan



View 4 Replies View Related

How To Write Errors In Event Log Of Machine From SQL Server Through XP_Cmdshell

Feb 15, 2008

How to write errors in event log of machine from SQL Server through XP_Cmdshell

View 1 Replies View Related

SQL Server 2012 :: Write A Process To Get File Size In Kb And Record Count In A File?

Jul 31, 2014

I need to write a process to get file size in kb and record count in a file. I was planning on writing a c# console app that takes the file path and name as a param however should i use a CLR?

I cant put a script in the ssis when it's bringing the file down because it has been deemed that we only use ssis for file consumption.

View 1 Replies View Related

Is It Possible To Write A Format File That Skips A Few Bytes Of Header In Data File?

Jul 23, 2005

Hi,I am trying to use BULK INSERT with format file. All of our data hasfew bytes of header in the data file which I would like to skip beforedoing BULK INSERT.Is it possible to write format file to skip these few bytes ofheader before doing BULK INSERT? For example, I have a 1 GB data filewith 1000 byte header. Except for first 1000 bytes, rest of the data isgood for BULK INSERT.Thanks in advance. Sorry if it is really a dumb question as I am newto BULK INSERT and practicing still.Bob

View 7 Replies View Related

Using The File Connection Manager To Write To A File

Jan 7, 2008

Is there any real purpose to the File Connection Manager? Not the Flat File Connection Manager, just the plain old File Connection Manager.

I have one in my SSIS package because I thought it might make writing to a file easier. But from what I can tell, it doesn't really do much. I have to pull the file name from the connection manager and basically open and manage the file myself in my scripts.

I went this route because I have two scripts that write to the file in turn... one writing out parent records and the other inserting the child records after each parent.

The script looks like this:




Code Block
Dim outFile As String
outFile = Dts.Connections("TestFile.LDIF").AcquireConnection(Dts.Transaction).ToString()

Dim sw As New StreamWriter(outFile, True)
sw.WriteLine()
sw.WriteLine("dn: " & Dts.Variables("GroupID").Value.ToString())
sw.WriteLine("changeType: add")

sw.Close()

I have to close the connection every time because the other script uses the file. It seems that this is quite inefficient. Am I using the File Connection Manager incorrectly? What's a more appropriate way to do this?

I could open the file in a different script and store the StreamWriter object in a global variable, I suppose...

Thoughts, suggestions?

Thanks.

J


View 9 Replies View Related

Write Into File Using SQL.

Apr 16, 2008

I need how we can write into a file result of query in SQL.
i need to write into a file the details we get after executing a query.
 

View 3 Replies View Related

Write To A File

Oct 23, 2000

I'm a junior programmer, and i must write/append several string into a file
but i don't know how to do it??
In oracle i used UTL_FILE

View 3 Replies View Related

SQL Output A XML File To My Local Machine

Mar 17, 2008

Hi, i wondered if anyone could help me with my stored procedure.
It updates a table with users messageboard and saves the Title, Line 1, Line 2 and so on into a XML thats stored in the column named XML_Data.

How can i then output this xml to a file on my local machine?



T-SQL :-

ALTER PROCEDURE [dbo].[prUpdateMessageBoardVetted]

(PARAMS GO HERE)

UPDATE CustomerData
SET Title = @Title,

Line1 = @Line1,
Line2 = @Line2,

Line3 = @Line3,
Line4 = @Line4,

Line5 = @Line5,
Line6 = @Line6,

XmlFileName = @XmlFileName,
FlashFileName = @FlashFileName,

HtmlFileName = @HtmlFileName,
Vetted = @Vetted,

ClientName = @ClientName
WHERE

(UserRef = @original_UserRef)

END

BEGIN

IF @Vetted = 1

DECLARE @xmlData AS XML

SET @xmlData = (SELECT
UserRef,

Title,

Line1,

Line2,

Line3,

Line4,

Line5,

Line6

FROM dbo.CustomerData
WHERE (UserRef = @original_UserRef) FOR XML RAW('Message'), ELEMENTS)

SELECT @xmlData


UPDATE [dbo].[CustomerData]
SET

XML_Data = @xmlData
WHERE

(UserRef = @original_UserRef)



(THEN HERE DO SOME SORT PROCEDURE TO OUTPUT @xmlData to a XML FILE ON MY LOCAL MACHINE,

BUT ALSO NAME THE XML FILE VIA @XmlFileName BY DOING SOME SORT OF CONCANTENATION)

any ideas?

Thanks in advance !



Neil

View 1 Replies View Related

Data File In A Different Machine On The Network.

Jul 20, 2005

Hi All,I have a requirement to create the database with data and log files ina different machine on the network.Googling, I got a link which said Mapped drives do not work but UNC pathswork. However in my case, both are failing.Any advices or links on net will be highly useful.Thanks and Regards,Chandra Mohan

View 5 Replies View Related

Write File To DB From Server

Aug 27, 2006

Hi, How can I read a file on the server and insert it into my SQL Server database.  The user is not uploading the file, but it already exists on the Server. Thanks

View 1 Replies View Related

Write Binary From Sql To File In Vb.net

Mar 17, 2008

Hi,
 
I need help please.
 I have a image field in SQL called AttachData.
 I need to retrieve the information and save it on my computer.
I tried the following but it fails on the line 7.
How can I write the data from sql to my computer?
Here is my table in sql:
CREATE TABLE [dbo].[MailAttachment](
[MsgID] [int] NOT NULL,
[AttachName] [nvarchar](255) COLLATE Hebrew_CI_AS NULL,
[AttachType] [nvarchar](255) COLLATE Hebrew_CI_AS NULL,
[AttachSize] [int] NOT NULL DEFAULT (0),
[AttachCompSize] [int] NOT NULL DEFAULT (0),[AttachData] [image] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]1 Dim s As New _
2 System.IO.FileStream("c:emails" _
3 & "" & AttachName.ToString, System.IO.FileMode.CreateNew,System.IO.FileAccess.Write)
4
6
7 ' s.Write(CType(AttachData, Byte()), 0, CInt(AttachSize))
8
10
11 s.Close()
 

View 7 Replies View Related

Error Trying To Write File

Aug 3, 2004

I don't have direct access to the SQL server. I have to write/read through a class I recieved from the IT department. The class also had an example in it but I can't get it to work correctly.

I get an error: Object reference not set to an instance of an object. Line 35


Dim clsWDD As New WebDevDB.WebDevDB
Dim intLeng As Int32
Dim intLock As Int32

Dim strAppl As String = "MyApplication"
Dim strData As String = "This is my text data!"

Dim strFile As String = "MyFile"

intLock = clsWDD.LockTextFile(strAppl, strFile) 'line 35
intLeng = clsWDD.WriteTextFile(strAppl, strFile, strData, WriteAction.Create)
intLock = clsWDD.UnlockTextFile(intLock)

View 2 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

Write SQL Data To An XML File

Aug 3, 2007

I need to write data returned by a stored proc to an XML file. The resultant file will then be consumed by an external application. The file has to adhere to a specific schema. Is there a way to do this through SSIS? Is .NET CLR a better option?

View 1 Replies View Related

Write SQL Data To An XML File

Aug 3, 2007

I need to write data returned by a stored proc to an XML file. The resultant file will then be consumed by an external application. The file has to adhere to a specific schema. Is there a way to do this through .NET CLR in SQL Serer 2005? Is SSIS a better option? Thanks.

View 5 Replies View Related

How To -- Write To Flat File Using Sp

Mar 31, 2008



How to write to a flat file, using a stored procedure?
Thank you,
SQL Server 2005 (SP2).
Smith

View 11 Replies View Related

Write To Csv File Oledb

Jul 27, 2007

How do I write the record set to a .csv file using oledb in vb.net? If anyone has sample code to write to .csv file, I greatly appreciated.

View 1 Replies View Related

CLR Trigger To Write File.......

Feb 28, 2006

Hello, theres,

I have a request to write to a file whenever new record added to the table.

When records insert row by row, it goes well. but when more than 2 session insert at the same time, sometimes it duplicate some record in the file. I try to add synchonize code ( like lock , Monitor) but it doesn't work. any idea ?

Regards,

Agi

View 3 Replies View Related

Get Local Machine Name In MSDE Setup .bat File

Nov 5, 2003

I have the following command in a .bat file

osql -E -S localhost sp_grantlogin 'GREGASPNET'"

What I would like to do is replace GREG with the name of the local computer this .bat file is being run on.

Is there any string for this... i.e [LOCALMACHINE]ASPNET or something like that?

Greg

View 1 Replies View Related

Local Storage In Client's Machine In .sdf File

Apr 2, 2008



How to create a db in clients local machine with sql server ce and .net?Is any sample applications available?so,that later i can sync the data to the sql server db.
Please help.I am new to sql server ce.

View 3 Replies View Related

Add Sdf File To My Project When All My Sources Are On Remote Machine

Sep 3, 2007

I posted this question in the past and did not get any answer.
I put all my sources on a remote server mainly for backup purposes (the remote server is backuped every day) but when I have the .sdf file I can not open it from the visual studio 2005 configuration server here is the description of the problem:
I have an application that runs on a PDA and manage a database (.sdf) file I use C# with visual studio 2005
What I want to do is to add the database file (.sdf) to my project files and open a connection to it.
The problem is that all my source file are stored on remote machine and not locally on my machine and the .sdf file is also stored with the project source files.
When I try to add the file to the project I get the following error fro the data source configuration wizard :

"An error occured while retrieving the information from the database"

DRIVE_REMOTE
Parameter Name : N:

I get the same error also when I try to open a new connection to the file from the server explorer. When i copy the file to drive "C:" I can open a connection to it with no errors.


View 4 Replies View Related

Export To Flat File Using T-SQL And Import To Another Machine

Jan 9, 2008



Hi,

I need to export some data from SQL 2005 to a flat file, The data and flat file names will be dynamic and will be be fired programaticaly so I can't use DTS or SSIS.

In SQL2000 I did it using bcp, but that's quite a security hole so I don't want to use external utilities. I'll need to do something similar on another machine to import the data as well.

I find it strange there's no easy way to do this!

Thanks.

View 4 Replies View Related

Uninstall On New Machine Causes Resource File Error

Dec 4, 2006

OK heres the deal, I just purchased a new dell and uninstalled the sql server. Now i am getting- Execution cannot continue as the language dependent resource fil could not be loaded. Any ideas where i could download it or where to get some answers??? My laptop is only 3months old what the fudge!!!!!!!!!!!

View 2 Replies View Related

How Do I Write Content In A Table To File

Mar 20, 2002

I know oracle uses UTL_FILE procedures lik putline, but microsoft?
Thank you for trying to help.

View 1 Replies View Related

How To Write The Result Of A Querry To A File

Aug 15, 2000

hello!

can somebody tell me how i can redirect the result of my
select statement to a file.

thank's

View 1 Replies View Related

Write To A File From A Stored Procedures

Mar 2, 2000

May i know whether i can write some text/string to
a file from inside a stored procedures?
Currently i can retrieve data from a query and use bcp
to write it to a file but i need to add some others text
to the same file.
Thanks for any reply!

View 1 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 IS Logging In Flat File

May 2, 2007

Hi,


I've created SQL Server job that executes my IS package in regular schedule, is there a way to redirect IS logging (Progress tab when the package is executed from VS) to flat file in same path as my packge.

When my job fails I want to know wich particular step fail and progress tab olso contain usefull info like the duration for each step.



Thank very much for your help

View 1 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

Write MS Sql Data To XLM File And ASP.net VB Script

Feb 29, 2008

I use asp.net 2.0 and SqlDataSource to connect mdf file,

I want the date could write in xlm file, How do it,

Please help, thanks

SQL script : <aspqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT å?ˆé¤?編號, å?ˆé¤?å??稱, å?ˆé¤?價錢, 說明, 顯示, 更新日期 FROM lunch WHERE (顯示 = 'A') >
</aspqlDataSource>

View 7 Replies View Related







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