Sending Isql Output To Remote Share

Sep 15, 1998

I have a query I`d like to run using the isql command utility. The query works correctly and the output can be sent to a local file with no problem. When I try to designate a network location as an output file (e.g. abcdefgfile.txt), though, I get an error message "No such file or directory."

Is it possible to send SQL output to a remote location?

TIA!

View 1 Replies


ADVERTISEMENT

ISQL - Blank Line At The End Of The ISql Output File

Sep 23, 2005

Hi,I'm using isql to query data and output the same to a flat file.The isql has the following command options ' -h-1 -w500 -n -b -s"" '.In the SQL_CODE, the first two lines before the select statement areuse dbnameset nocount ongoWhen I run this, an additional blank line is put into the output file.Actually, there are two lines after the last result set in the outputfile. This file is being fed into another system and the blank line iscausing validation issues.How can I supress this blank line?This script is run from windows and the isql is called from a batscript.Batch script ...================================================== ========.....isql -Uuserid -Ppassword -Sserver -i"%SQL_CODE%" -h-1 -w500 -n -b -s""[color=blue][color=green]>>"%OUT_FILE%"[/color][/color]IF ERRORLEVEL 0 SET RC=0IF ERRORLEVEL 1 exit 4================================================== ========SQL code ...================================================== ========use punclaimset NOCOUNT ONGOselect * from XYZ;GO================================================== ========Your help is greatly appreciated.Yash

View 3 Replies View Related

ISQL Output To A File...

Jul 25, 2002

SQL 6.5

I am doing a ISQL join on 4 tables that creates a few million record output. This causes some memory grief on my laptop. How do I have my query output to my c: drive??

Thnaks in advance.

Ray

View 1 Replies View Related

Isql Field Output Length Greater Than 255

Jun 15, 2004

Hello,

I am running a stored procedure thru' isql.
This returns only one field.
The sp is executed fine but if the data has length greater than 255 the data is truncated.
How do u capture the full output ?

Thanks In Advance

Ashutosh
:rolleyes:

View 3 Replies View Related

ISQL And OSQL Output Lines Wrapped Around At 256 Characters?

Jul 20, 2005

I am trying to use a command line program to run a stored procedurethat generates output in a comma-delimitted format. Somehow, ISQL orOSQL always wrap the lines at 256 characters. I believe this hassomething to do with the column width switch (-w). But enlarging thecolumn width to 800 characters max still doesn't help. The followingis a stored procedure that is essentially doing what my storedprocedure is doing:create procedure MyTest asset ansi_padding onset nocount ondeclare @sTest varchar(300)-- Output three lines. Each line has 259 characters.select @sTest = "1234 6789 ... 1234 6789"print @sTestselect @sTest = "1 3 5 7 9 ... 1 3 5 7 9"print @sTestselect @sTest = "1 3 5 7 9 ... 1 3 5 7 9"print @sTestset nocount offreturn( 0 )I invoke this stored procedure using this command:isql -SMyDbSrv -E -dMyDb -w800 -x800 -h-1 -n -Q"exec MyTest"-oMyTest.txt-- or --osql -SMyDbSrv -E -dMyDb -w800 -h-1 -n -Q"exec MyTest" -oMyTest.txtBut they have the same problem. The output lines all wrap around at256 characters.Strangely, if I store the result in a temporary table, and then useSELECT to output the result from the temporary table, I will not havethat problem. Seem like the "-w" switch only works for output fromtables, but not for output coming from PRINT. Unfortunately, usingthis approach has another set of problems (one blank space in front ofeach line, "number-of-rows affected" shows up at the bottom).Therefore, I would like to stick with using PRINT statements to outputthe result.Please suggest a way to fix this line-wrapping-around problem.Thanks.Jay Chan

View 5 Replies View Related

Using SSIS To Output SP Return Data To A Share

May 4, 2008



I'm new to SSIS. I'm looking for basic pointers to return temp table created by a proc to be written to file shares. Any pointers/examples appreciated.

Thanks,
Siva

View 5 Replies View Related

Hosting An SQL Database On Remote Share

Apr 27, 2006

Hi,
I would really appreciate help with this query.

I have an SQL 2000 server setup with 2 databases. My boss would like to setup another database but wants the actual database to reside on a different server share.

Is is possible for one database on an SQL server to be hosted on a remote share ?

appreicate any info
thanks

View 2 Replies View Related

SSIS Package Cannot Access Remote UNC File Via The Admin Share

Mar 6, 2008

I am developing a package to restore a database from backup file on a remote server. I am having problems accessing the remote backup file when it is addressed via the admin share, in this case N$. It runs okay if a specific share is created but for some unknown reason fails via the adminshare.

I am executing the package job with a proxy account that is a member of the local administrators group on the remote server.

It appears that access via a remote admin share isn't possible from within a SSIS package. Is this the case?

View 2 Replies View Related

Sending Query Output To A File

Aug 22, 2001

HI,
I have a small problem with SQL server 7.0 where I have to write the output of a query directly to a file without the user going to the menu and clicking on save. Scenario is:
A file is having a query the results of which has to be outputted to a file like in oracle where we have spooling function. Is there any functionality that mimic the oracle functionality where by I can get the output directly to a file?
thanks for your help in advance.
thanks,
Sravan.

View 2 Replies View Related

Sending Output From Xm_cmshell Into Excel Using DTS

May 18, 2004

Is there a way of running an OS command via xp_cmdshell and sending the results to a spreadsheet within a DTS package ?.

View 2 Replies View Related

SQL 2005 Maintenance Cleanup Task Is Not Deleting Files On Remote File Share

Jan 16, 2008

I have the following issue with Maintenance plan backups that work for BAK DIF and TRN to a remote server share.
When I try and remove the old files with a clean up task I get an error and the files don't get deleted.


The version is as follows
Microsoft SQL Server 2005 - 9.00.3054.00 (X64) Mar 23 2007 18:41:50
Copyright (c) 1988-2005 Microsoft Corporation Standard Edition (64-bit) on
Windows NT 5.2 (Build 3790: Service Pack 2)

The error result is as follows,

Failed-1073548784) Executing the query "EXECUTE master.dbo.xp_delete_file
0,N'\\EXECUTE master.dbo.xp_delete_file 0,N'\ABCD-A1\BACKUPS\ABCD_BACKUP\ABC_DAILY\ABCD',N'trn',N'2008-01-13T12:52:49'" failed with the following error: "xp_delete_file() returned error 2, 'The
system cannot find the file specified.'". Possible failure reasons: Problems
with the query, "ResultSet" property not set correctly, parameters not set
correctly, or connection not established correctly.

The maintenance plan seems to be adding extra "" though when i enter the
code directly in a query i get same error.

Query:

EXECUTE master.dbo.xp_delete_file 0,N'\ABCD-A1BACKUPSABCD_BACKUPABC_DAILYABCD',N'trn',N'2008-01-13T12:52:49'

Error:

xp_delete_file() returned error 2, 'The system cannot find the file specified.'

The servers belong to the same domain and are using the same Service account which has all the necessary rights to the share and the file directory location. The backups work but i get the error on the cleanup task.

Trying to figure out how to get the Cleanup task to delete old files. The same happens for all file extensions and I have tried other locations with simpler file paths same error.


Regards,
Scott


View 6 Replies View Related

DTS Active X - Check If Recrords Exist Before Sending Output

May 30, 2008

I've written a DTS transaction that I would like to schedule as a job. I don't want it to run if there is nothing to send.

I this example below on another website and have changed the connection string to reflect my settings. The password has been stared out for security reasons. It's not the way it actually appears in the script. This keeps erroring out on line 21 saying expected end of statement.

I'm sure I'm missing something small and would really like to get this done tomorrow before I leave for the weekend. Any help would be greatly appreciated.
Function Main()
dim myRecordset
dim iRowCount

dim sConnection

sConnection ="Provider=sqloledb;" & _
"Data Source=GLPT-SQLCSI_SQL;" & _
"Initial Catalog=GLPTWEB;" & _
"User Id=sa;" & _
"Password=*************"

Dim oOleDbConnection
oOleDbConnection = New OleDb.OleDbConnection(sConnection)
oOleDbConnection.Open()

mySQLCmdText = "Select Count(*) FROM [GLPTWEB].[dbo].[RunTicketDataView]"

Dim myConn As New OleDbCommand
myConn(mySQLCmdText , oOleDbConnection)


set iRowCount = myConn.ExecuteReader

If iRowCount.Value = 0 then
Main = DTSTaskExecResult_Failure
Else

Main = DTSTaskExecResult_Success
End If

End Function

View 3 Replies View Related

Problems With Sending Event Notifications To Remote Service

May 10, 2006

Hi!



Just set up my first Service Broker test. Wanted to send an Event Notification from one instance to another. Finally, the message arrives but profiler shows that the message is still being continously resent (and rejected as being duplicate). What am I doing wrong?



With best regards,

Artus

--

/* Local Event Source.sql */

USE master
GO

CREATE DATABASE NotificationDB
GO

ALTER DATABASE NotificationDB SET ENABLE_BROKER WITH ROLLBACK IMMEDIATE;
GO

CREATE ENDPOINT BrokerEndpoint
STATE = STARTED
AS TCP
(
LISTENER_PORT = 5554
)
FOR SERVICE_BROKER
(
AUTHENTICATION = WINDOWS,
ENCRYPTION = DISABLED
)
GO

USE NotificationDB
GO

CREATE EVENT NOTIFICATION TestEN
ON DATABASE
FOR CREATE_TABLE
TO SERVICE 'ExpressService', 'AFEDD339-AD3D-4865-AF3C-299B0A0784C6'
GO

CREATE ROUTE ExpressRoute
WITH SERVICE_NAME = 'ExpressService' ,
BROKER_INSTANCE = 'AFEDD339-AD3D-4865-AF3C-299B0A0784C6',
ADDRESS = 'TCP://localhost:5555'
GO

CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'Pa$$w0rd';
GO

ALTER MASTER KEY ADD ENCRYPTION BY SERVICE MASTER KEY;
GO

USE master
GO

SELECT service_broker_guid FROM sys.databases WHERE database_id = DB_ID()
GO




/* Remote Service.sql */

USE master
GO

CREATE DATABASE Test
GO

ALTER DATABASE Test SET ENABLE_BROKER WITH ROLLBACK IMMEDIATE;
GO

CREATE ENDPOINT BrokerEndpoint
STATE = STARTED
AS TCP
(
LISTENER_PORT = 5555
)
FOR SERVICE_BROKER
(
AUTHENTICATION = WINDOWS,
ENCRYPTION = DISABLED
)
GO

USE Test
GO

CREATE QUEUE ExpressQueue
WITH STATUS = ON
GO

CREATE SERVICE ExpressService
ON QUEUE ExpressQueue
(
[http://schemas.microsoft.com/SQL/Notifications/PostEventNotification]
);
GO

GRANT SEND ON SERVICE::ExpressService
TO [public]
GO

CREATE ROUTE ExpressServiceRoute
WITH SERVICE_NAME = 'ExpressService',
BROKER_INSTANCE = 'AFEDD339-AD3D-4865-AF3C-299B0A0784C6',
ADDRESS = 'LOCAL'
GO

CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'Pa$$w0rd';
GO

ALTER MASTER KEY ADD ENCRYPTION BY SERVICE MASTER KEY;
GO

SELECT service_broker_guid FROM sys.databases WHERE database_id = DB_ID()
GO

SELECT * FROM sys.endpoints
GO

View 3 Replies View Related

XML Output Serialized For Remote Query

Jul 23, 2005

Hi,Im running into a strange problem here!I have created a linked server on one of my SQL Servers (local server).Lets call the linked server as LS1.I have an sproc which resides on the remote server(LS1) and uses a FORXML query.On running this sproc from my local server using linked server LS1, Iget a strange serialized data as output instead of the usual XMLoutput.I run the proc asexec [LS1].[DBName].[UserName].[SprocName] '12/1/2004','12/3/2004'the proc accepts 2 parameters as dates.The output generated is smth like:0x44046E0061006D0065004404440061.......(long string of hex codes)Looks like the ouput is getting serialized. How can I avoidserialization OR How to de-serialize this data?Please HelpThanks,Geo

View 5 Replies View Related

No Output Variable In Remote Procedure Call?

Sep 10, 2007

I'm calling a procedure on a remote Server (local SQL2005, remote SQL2005) and I need the return value.

Local:
declare @value int execute ('exec mbtest1.dbo.psybcis ?', @value OUTPUT) at [REMOTESQLSERVER] select @value

Remote:
create procedure [dbo].[psybcis] (@value int OUTPUT) as begin select @value = '13' end


I do not get a value in the OUTPUT variable - just NULL. Documentation says:
Execute a pass-through command against a linked server
{ EXEC | EXECUTE } ( { @string_variable | [ N ] 'command_string [ ? ] ' } [ + ...n ] [ { , { value | @variable [ OUTPUT ] } } [ ...n ] ] ) [ AS { LOGIN | USER } = ' name ' ] [ AT linked_server_name ] [;]
There is an OUTPUT parameter, but how does it work? Is my syntax wrong?


It works when using following syntax,
declare @value int exec [REMOTESQLSERVER].mbtest1.dbo.psybcis @value OUTPUT select @value
but I need to use this procedure call in a distributed transaction to a Sybase ASE server and this syntax is not allowed for cross-system-calls.
So first I want to get it work from SQL2005 to SQL2005.

View 2 Replies View Related

ISQL

Oct 27, 2000

Hello,
how can i do to launch a .bat file that execute my procedures in whitch i populate a table that after must be send whith bcp command to a file??
Can you give me an example for that?What about ISQL??
Thanks

Massimo Nardi

View 2 Replies View Related

Isql

Jan 3, 2000

Does anyone use ISQL to run maintenance? I am trying to write a batch file that will log on to my server and dump a specifice tran log when triggered by a perfmon warning.

I can successfully log on to the server however the dump command does not seem to run? IS it possible to run a predefined task??

ANy assistance would be greatly appreciated,

Thanks
David

View 4 Replies View Related

Isql

Dec 16, 2002

When I am running an SQL query on a SQL server DB from ISQL the results are returning a space in front of every row, plus it is returning the number of rows effected at the bottom. When I run the query without ISQL the results come back without the space in front of every row, but it does come back with the number of rows effected. I need the spaces reomed and the number of rows removed. Here is an example of the ISQL.
ISQL.EXE /U????? /P?????? /n /d????? /h-1 /w 218 /S????? /i????? /o?????

Are ther any arguments to help remove the preceding space and the trailing footer?

Here is a copy of the SQL

select CONVERT(char(49),i.item_number),CONVERT(char(17),s um(s.actual_qty)),CONVERT(char(19),"WMS"),
CONVERT(char(2),DATEPART(month,GETDATE())) + '/' + CONVERT(char(2),DATEPART(day,GETDATE())) + '/' + CONVERT(char(4),DATEPART(year,GETDATE())) + CONVERT(char(109),''),
CONVERT(char(8),"01:00:00") from t_stored_item s, t_item_master i, t_location l
where i.c5 = 'FVM' and
i.item_number = s.item_number and
l.location_id = s.location_id and
l.location_id like 'V-%'
group by i.item_number
order by i.item_number

Thanks!

View 2 Replies View Related

Isql Help

May 4, 2004

Hello all, I'm new to the board...

I'm trying to run a script in isql with a file that contains create database statements and I'm completely lost. If someone could help me and point me in the right direction, please!

Thank you

View 5 Replies View Related

Isql

Jan 31, 2007

Hi,
I'm running isql from a dos batch file and the isql command is below:

%SQLPath%isql -U%DBUser% -P%DBPswd% -S%SQLServer% -d%Gatewaydb% -iBatchScriptsSQL_Get_Create_Batch.sql -oZ:mbox
ecsincreate_1.bat -w100 -s; -h

I want the rows from the SELECT statement in my ".sql" file to appear in the output file but what ends up being written to the file is this:

1> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16> 17> 18> 19> 20> 21> (14 rows affected)

Not sure what I'm doing wrong.
Thanks,
J


1>

View 9 Replies View Related

Isql Display

Aug 9, 2000

Hi,
When I execute a script by using isql, it displays the number of statement executed. can anybody tell me how to turn this off (no display)?
Thanks,

Mark

View 1 Replies View Related

ISQL --URGENT

Oct 3, 2000

Hi

I am running the Stored procedure from using ISQL like this and the stored procedure name is in the input file (c:empinp.txt)

c:>ISQL /S DB1 /U sa /P pass /d test_db /i c:empinp.txt

I want to write a Comment(say 'DONE' OR 'COMPLETED') into a OUTPUT FILE? after executing the stored procedure.

Is there a way to do it?

Thanks
VENU

View 1 Replies View Related

Pb Codepage Et ISQL

Aug 24, 2000

Bonjour,
J'execute un script en sql 7 qui lance isql qui crée un fichier texte en sortie. j'ai un souci, ce fichier de resultat a remplacer les lettres accentuées é è ...
par des virgules ,
Quelle est la solution ? Merci d'avance ...

View 1 Replies View Related

ISQL Shareware

Sep 2, 2000

I am looking for a shareware product I can use in place of ISQL. I am working with databases on a web site, and I want to be able to give different clients access to their data, without forcing them to go out and buy SQL Server.

Thanks,

Doug

View 1 Replies View Related

ISQL Utility

Aug 6, 2001

Hi,

All the wanted to know whether the ISQL utility is optional during the sqlserver setup??? Is it possible to install sql server without installing ISQL utility??

Thanks in advance,

Asha

View 1 Replies View Related

Osql / Isql

Jan 17, 2008

Is osql/isql supported in SQL 2005? How about in 2008? Thanks

View 2 Replies View Related

URGENT Isql Will Not Start

Jan 24, 2002

I'm running sql 6.5. trying to load lots of data. Rec msg that memory was low so I increased memory obvisouly too high. Now sql will not start. found all the documentation to start sql in single user mode however when trying to start isql to change to memory setting, isql would not start. The server is using named pipes. Message I receive is sql server is unavailable or does not exist.

You help would be greatly appreciated as this is a production environment and we are down.

thanks!!
darlene

View 2 Replies View Related

Passing Parameters In ISQL

Aug 30, 2001

Hi,

I would like to pass parameters from isql command line to an input query file. I am working on SQL Server 7.0. How can I accomplish this?

My eg. is like this:

> isql.exe (all the server options etc.,) /iInputfile /oOutput file
I need the output depend on the query given in the input file with the query depending on the parameter I supply on the command line.Thanks for your help in advance.

thanks,
Sravan.

View 1 Replies View Related

ISQL, Xp_cmdShell Question

Dec 27, 1999

Hi,

I have an input file which contains a simple select query. I want to output the results of the query to an output file. I use the following query:

DECLARE @sTemp1 Varchar(100)

SELECT @sTemp1 = "isql -d TestDB /U sa /P SAPassword -n /i C:QRYIn.txt > C:QRYOut.txt"

EXEC master..xp_cmdshell @sTemp1

The problem is that this query looks for the C: drive on the SERVER not on my local machine. C:QRYIn.txt exists on my machine so this does not work. However if I create a C:QRY folder on the SERVER the whole thing works.

Basically I want this query to go to execute the In.txt query from my local machine as opposed to the SERVER.

View 1 Replies View Related

Redirection In FTP Would Not Work From ISQL..

Sep 21, 2000

Gurus,
For some reason the INPUT REDIRECTION of FTP commands from a file does not work when executed from a ISQL session.

"ftp -i -n host_name <serverstare_dirFTP-commands.dat >serverstare_dirFTP-errors.dat " would not work. It gives me an error message - "The handle could not be opened during redirection of handle 0 "

How ever it works from COMMAND prompt and BAT files.
I changed it use "-s:" option instead of INPUT REDIRECTION and it works just fine every where... The command I used is
"ftp -i -n -s:serverstare_dirFTP-commands.dat host_name >serverstare_dirFTP-errors.dat "

I still could not figure out why INPUT REDIRECTION would not work from ISQL only.

any ideas !!!!!!!!

Thanks,
- HemantH

View 2 Replies View Related

Calling A BAT File With ISQL ?

Sep 26, 1999

I am writing a trigger that I want to call a BAT file when there is an insert or update to a paricular table, but don't know the code to that will execute my BAT file.

To reitrate, when a row is inserted, I want to automatically start a particular EXE that our developers created to process rows written into this table.

My BAT that currently runs OK from the Command line is : CBBOP.BAT
-----------------
@echo
"d:program filescabs2000CBBOP.exe" /cabsit /password 2,2,time
-----------------

But what I need to know is the SQL that will run my CBBOP.BAT, and I will code it into my trigger.

Cheers
Brett

View 1 Replies View Related

Cant Get ISQL To Work With Xp_cmdshell

Dec 30, 2002

I have copied a script from the web that allows me to run scripts from a file over multiple databases(have attached file). Now everything works fine on my local SQL server but when I try to run it on my web server I get this msg
''isql' is not recognized as an internal or external command, operable program or batch file.'

I have tried to use the full path to the isql.exe file but still get the msg

Thats about as much info I can provide, my understanding of this is very slight

View 5 Replies View Related

ISQL.EXE Hangs During Installation

Mar 8, 1999

ISQL.EXE hangs during installation. In task manager, when I end task on ISQL.EXE the installation continues, but msdb comes up suspect. Can someone please help me.

View 2 Replies View Related







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