Showing posts with label file. Show all posts
Showing posts with label file. Show all posts

Friday, March 30, 2012

Output Column Width not refected in the Flat File that is created using a Flat File Destination?

I am transferring data from an OLEDB source to a Flat File Destination and I want the column width for all of the output columns to 30 (max width amongst the columns selected), but that is not refected in the Fixed Width Flat File that got created. The outputcolumnwidth seems to be the same as the inputcolumnwidth. Is there any other setting that I am possibly missing or is this a possible defect?

Any inputs will be appreciated.

M.Shah

InputColumnWidth represents the width in the file and OutputColumnWidth is the width in the data flow.

This may sound confusing for the case of Flat File destination connection, but the same connection manager object is used for sources and destination. There is also the description of these properties in the property grid of the Flat File Connection Manager UI.

So, to conclude the InputColumnWidth is the one controlling the size of the columns in the destination file.

Thanks.

|||

Thanks for the information. That was definitely helpful to figure out why the OutputColumnWidth was not reflected in the flat file.

Output Column Width not refected in the Flat File that is created using a Flat File Destination?

I am transferring data from an OLEDB source to a Flat File Destination and I want the column width for all of the output columns to 30 (max width amongst the columns selected), but that is not refected in the Fixed Width Flat File that got created. The outputcolumnwidth seems to be the same as the inputcolumnwidth. Is there any other setting that I am possibly missing or is this a possible defect?

Any inputs will be appreciated.

M.Shah

InputColumnWidth represents the width in the file and OutputColumnWidth is the width in the data flow.

This may sound confusing for the case of Flat File destination connection, but the same connection manager object is used for sources and destination. There is also the description of these properties in the property grid of the Flat File Connection Manager UI.

So, to conclude the InputColumnWidth is the one controlling the size of the columns in the destination file.

Thanks.

|||

Thanks for the information. That was definitely helpful to figure out why the OutputColumnWidth was not reflected in the flat file.

sql

Output an SQL Query to a text file

Hi,

How would I go about writing the results of an SQL query to a text
file?

I cannot find any info in the Online help files.

For example, I would like the results of:

SELECT * FROM TableA

To be written to the file result.txt

AlexOpen query analyzer. Go to Query and select Result to file... and
during execution, it will prompt a file name...|||Thanks but I cannot do that.

This must query must be invisible to the end user.

For example, if a user performs some function on my system, I wish to
execute a query on what they have selected and output the results to a
file. I do not want my user to be selecting Save As etc..|||First your question is not clear. I am still not sure what you are
trying to accomplish.

First if you have a query that you dont want your user to know, wrap it
up in a stored proc and schedule it in a job and let the user execute
the job.

Another easy way is to create a dts and let the user run the dts that
should run the query and output the file.

Hope this helps..!|||Ok, I have no idea what a dts is!!

Is it possible to output the results from a stored procedure to a
specified file.

I do not want to use a tool or anything, just simply write the results
from a query to a file.|||Alex,
You might try adding this to your connection string: -o '<path
name>\results.txt.

such as: isql -SMyserver -Uusera -Puserapassword -i mysqlquery.sql -o
results.tx

hth

"Alex" <alex_seymour@.lineone.net> wrote in message
news:1108412990.821013.237700@.g14g2000cwa.googlegr oups.com...
> Hi,
> How would I go about writing the results of an SQL query to a text
> file?
> I cannot find any info in the Online help files.
> For example, I would like the results of:
> SELECT * FROM TableA
> To be written to the file result.txt
>
> Alex|||On 2/14/05 4:24 PM, in article
1108416279.303119.278950@.z14g2000cwz.googlegroups. com, "Alex"
<alex_seymour@.lineone.net> wrote:

> Ok, I have no idea what a dts is!!
> Is it possible to output the results from a stored procedure to a
> specified file.
> I do not want to use a tool or anything, just simply write the results
> from a query to a file.

There is no OUTPUT TO FILE argument in a SELECT clause. You can SELECT INTO
a temporary table but this doesn't help you. The simplest thing to do (path
of least resistance) is to use a program in the middle to handle the query
and writing the recordset into a file. For example, if you wanted to create
an .ASP web form you could simply ask for the customer's email address, run
a query and send them the results. You could write a VB app or VB script to
run locally and generate a file from your query.

-Greg|||There isn't a direct method. Two possible workarounds are OSQL and
BCP. I tend to use BCP. BCP only lets you output from a permanent
table, though.

I would create a table called "CACHE" where one of the columns is "IP"
and the other cols match the SELECT query. Then store the output into
CACHE along with the user's IP. Then run BCP to output from CACHE.|||Alex (alex_seymour@.lineone.net) writes:
> Ok, I have no idea what a dts is!!
> Is it possible to output the results from a stored procedure to a
> specified file.
> I do not want to use a tool or anything, just simply write the results
> from a query to a file.

No, you don't want to do that. Yes, you can invoke xp_cmdshell and from
there do all sorts of things. But then your users would have to have
permission to use xp_cmdshell, and that could be a security issue.

It's not clear why you want to write to a file, but if you want to
log some stuff for debug reasons - write to a table instead. You are
in a database, not in a file system.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Ok this is great, the tables I need data outputting from are permanent.

Basically it is for creating a log file. The database is huge, but the
log only needs to contain the contents of a few tables. It has to go to
a file because I want to be able to save the results of the query to
disk or print it out.

Can I BCP out from several tables into the same file?

i.e. I need SELECT * from TableA, TableB, TableC to result.txt

Security is not an issue.|||Alex wrote:
> Ok this is great, the tables I need data outputting from are
permanent.
> Basically it is for creating a log file. The database is huge, but
the
> log only needs to contain the contents of a few tables. It has to go
to
> a file because I want to be able to save the results of the query to
> disk or print it out.
> Can I BCP out from several tables into the same file?
> i.e. I need SELECT * from TableA, TableB, TableC to result.txt
> Security is not an issue.

It's a little involved but you can write a select statement joining
several tables. Each time BCP executes, I believe it overwrites the
text file.

Check out this article:
http://www.sqlteam.com/item.asp?ItemID=4722

output 2 table data to a text file

hi, how to output 2 table data to a text file?Not specifing what you want...
You can use bcp, osql with the -o switch or if you just wanna put out the
result of a query in QA you can send the result to a fiel rather than to the
result pane.
Is it that what you need ?
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"js" <js@.someone@.hotmail.com> schrieb im Newsbeitrag
news:uCTvwdPTFHA.632@.TK2MSFTNGP10.phx.gbl...
> hi, how to output 2 table data to a text file?
>|||can I do it in a query: select * from tb1 output my.txt?
"Jens Smeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> wrote in
message news:OoINvkPTFHA.1148@.tk2msftngp13.phx.gbl...
> Not specifing what you want...
> You can use bcp, osql with the -o switch or if you just wanna put out the
> result of a query in QA you can send the result to a fiel rather than to
> the result pane.
> Is it that what you need ?
> HTH, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
>
> "js" <js@.someone@.hotmail.com> schrieb im Newsbeitrag
> news:uCTvwdPTFHA.632@.TK2MSFTNGP10.phx.gbl...
>|||Yes of course, here is an example:
osql -E -Q"Select TOP 1 * from Northwind..Orders" -o "C:\Output.txt"
will produuce the following output:
OrderID CustomerID EmployeeID OrderDate
RequiredDate ShippedDate ShipVia
Freight ShipName
ShipAddress
ShipCity ShipRegion ShipPostalCode ShipCountry
-- -- -- --
-- -- --
-- ---
----
-- -- -- --
10248 VINET 5 1996-07-04 00:00:00.000
1996-08-01 00:00:00.000 1996-07-16 00:00:00.000 3
32.3800 Vins et als Chevalier
59 rue de l'Abbaye
Reims NULL 51100 France
(1 row affected)
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"js" <js@.someone@.hotmail.com> schrieb im Newsbeitrag
news:uoTJioPTFHA.2336@.TK2MSFTNGP12.phx.gbl...
> can I do it in a query: select * from tb1 output my.txt?
> "Jens Smeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> wrote
> in message news:OoINvkPTFHA.1148@.tk2msftngp13.phx.gbl...
>|||Thanks Jens...|||how about this:
osql -E -Q"backup Northwind to disk='c:\output1.txt " -o "C:\Output2.txt" -S
myServer
'c:\output1.txt : Server Path
'C:\Output2.txt : Local Path
can I run it in another worksation? and want to 'c:\output1.txt' located in
the workdation?
"Jens Smeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> wrote in
message news:eEF4GuPTFHA.3392@.TK2MSFTNGP12.phx.gbl...
> Yes of course, here is an example:
> osql -E -Q"Select TOP 1 * from Northwind..Orders" -o "C:\Output.txt"
> will produuce the following output:
> OrderID CustomerID EmployeeID OrderDate
> RequiredDate ShippedDate ShipVia
> Freight ShipName
> ShipAddress
> ShipCity ShipRegion ShipPostalCode ShipCountry
> -- -- -- --
> -- -- --
> -- ---
> ----
> -- -- -- --
> 10248 VINET 5 1996-07-04 00:00:00.000
> 1996-08-01 00:00:00.000 1996-07-16 00:00:00.000 3
> 32.3800 Vins et als Chevalier
> 59 rue de l'Abbaye
> Reims NULL 51100 France
> (1 row affected)
>
> HTH, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
> "js" <js@.someone@.hotmail.com> schrieb im Newsbeitrag
> news:uoTJioPTFHA.2336@.TK2MSFTNGP12.phx.gbl...
>|||Output will be redirected to the workstation due to the output of osql,
backup will be made to the server.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"js" <js@.someone@.hotmail.com> schrieb im Newsbeitrag
news:eOlPq3PTFHA.228@.TK2MSFTNGP12.phx.gbl...
> how about this:
> osql -E -Q"backup Northwind to disk='c:\output1.txt " -o
> "C:\Output2.txt" -S myServer
> 'c:\output1.txt : Server Path
> 'C:\Output2.txt : Local Path
> can I run it in another worksation? and want to 'c:\output1.txt' located
> in the workdation?
>
> "Jens Smeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> wrote
> in message news:eEF4GuPTFHA.3392@.TK2MSFTNGP12.phx.gbl...
>|||can backup to disk=unc format?
"Jens Smeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> wrote in
message news:uGRII%23PTFHA.1152@.tk2msftngp13.phx.gbl...
> Output will be redirected to the workstation due to the output of osql,
> backup will be made to the server.
> HTH, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
> "js" <js@.someone@.hotmail.com> schrieb im Newsbeitrag
> news:eOlPq3PTFHA.228@.TK2MSFTNGP12.phx.gbl...
>|||YEah that works,
Jens Suessmeyer.
"js" <js@.someone@.hotmail.com> schrieb im Newsbeitrag
news:OdHsAJQTFHA.2812@.TK2MSFTNGP09.phx.gbl...
> can backup to disk=unc format?
> "Jens Smeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> wrote
> in message news:uGRII%23PTFHA.1152@.tk2msftngp13.phx.gbl...
>

Friday, March 23, 2012

out to expand tempdb log file

I have a problem cause by an extensive sql statement that causes the tempdb
log file to be too small for execution. how can i extend the size of the log
file ?
is
ALTER DATABASE tempdb
MODIFY FILE (
NAME=templog,
FILENAME='E:\tempdb.ldf',
SIZE = 5MB,
MAXSIZE = 10MB,
FILEGROWTH = 1MB )
a safe bet from the default size?
thanks
It all depends on the amount of "temp" work your server does (joins,
temp tables, temp variables, etc.). Although a tempdb log that starts
at 5MB and can autogrow by 1MB to a max size of 10MB is the smallest
tempdb log file I've ever seen. My small-to-medium sized production
servers have tempdb log files that range from 100MB to 2GB.
You've got the right syntax for the ALTER DATABASE statement, although
you don't need to specify the filename (that's an optional in this
case), but why set such a low max size? Are you a bit strapped for space?
*mike hodgson* |/ database administrator/ | mallesons stephen jaques
*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
*E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
David Tucker wrote:

>I have a problem cause by an extensive sql statement that causes the tempdb
>log file to be too small for execution. how can i extend the size of the log
>file ?
>is
>ALTER DATABASE tempdb
>MODIFY FILE (
>NAME=templog,
>FILENAME='E:\tempdb.ldf',
>SIZE = 5MB,
>MAXSIZE = 10MB,
>FILEGROWTH = 1MB )
>
>a safe bet from the default size?
>
>thanks
>
>
>
|||Thanks Mike
no this was just a sample, just to illustrate the question.
thanks for answering . regards
*** Sent via Developersdex http://www.codecomments.com ***

out to expand tempdb log file

I have a problem cause by an extensive sql statement that causes the tempdb
log file to be too small for execution. how can i extend the size of the log
file '
is
ALTER DATABASE tempdb
MODIFY FILE (
NAME=templog,
FILENAME='E:\tempdb.ldf',
SIZE = 5MB,
MAXSIZE = 10MB,
FILEGROWTH = 1MB )
a safe bet from the default size?
thanksIt all depends on the amount of "temp" work your server does (joins,
temp tables, temp variables, etc.). Although a tempdb log that starts
at 5MB and can autogrow by 1MB to a max size of 10MB is the smallest
tempdb log file I've ever seen. My small-to-medium sized production
servers have tempdb log files that range from 100MB to 2GB.
You've got the right syntax for the ALTER DATABASE statement, although
you don't need to specify the filename (that's an optional in this
case), but why set such a low max size? Are you a bit strapped for space?
*mike hodgson* |/ database administrator/ | mallesons stephen jaques
*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
*E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
David Tucker wrote:

>I have a problem cause by an extensive sql statement that causes the tempdb
>log file to be too small for execution. how can i extend the size of the lo
g
>file '
>is
>ALTER DATABASE tempdb
>MODIFY FILE (
>NAME=templog,
>FILENAME='E:\tempdb.ldf',
>SIZE = 5MB,
>MAXSIZE = 10MB,
>FILEGROWTH = 1MB )
>
>a safe bet from the default size?
>
>thanks
>
>
>|||Thanks Mike
no this was just a sample, just to illustrate the question.
thanks for answering . regards
*** Sent via Developersdex http://www.codecomments.com ***

out to expand tempdb log file

I have a problem cause by an extensive sql statement that causes the tempdb
log file to be too small for execution. how can i extend the size of the log
file '
is
ALTER DATABASE tempdb
MODIFY FILE (
NAME=templog,
FILENAME='E:\tempdb.ldf',
SIZE = 5MB,
MAXSIZE = 10MB,
FILEGROWTH = 1MB )
a safe bet from the default size?
thanksThis is a multi-part message in MIME format.
--020102060703060100090302
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
It all depends on the amount of "temp" work your server does (joins,
temp tables, temp variables, etc.). Although a tempdb log that starts
at 5MB and can autogrow by 1MB to a max size of 10MB is the smallest
tempdb log file I've ever seen. My small-to-medium sized production
servers have tempdb log files that range from 100MB to 2GB.
You've got the right syntax for the ALTER DATABASE statement, although
you don't need to specify the filename (that's an optional in this
case), but why set such a low max size? Are you a bit strapped for space?
--
*mike hodgson* |/ database administrator/ | mallesons stephen jaques
*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
*E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
David Tucker wrote:
>I have a problem cause by an extensive sql statement that causes the tempdb
>log file to be too small for execution. how can i extend the size of the log
>file '
>is
>ALTER DATABASE tempdb
>MODIFY FILE (
>NAME=templog,
>FILENAME='E:\tempdb.ldf',
>SIZE = 5MB,
>MAXSIZE = 10MB,
>FILEGROWTH = 1MB )
>
>a safe bet from the default size?
>
>thanks
>
>
>
--020102060703060100090302
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>It all depends on the amount of "temp" work your server does
(joins, temp tables, temp variables, etc.). Although a tempdb log that
starts at 5MB and can autogrow by 1MB to a max size of 10MB is the
smallest tempdb log file I've ever seen. My small-to-medium sized
production servers have tempdb log files that range from 100MB to 2GB.<br>
<br>
You've got the right syntax for the ALTER DATABASE statement, although
you don't need to specify the filename (that's an optional in this
case), but why set such a low max size? Are you a bit strapped for
space?</tt><br>
<div class="moz-signature">
<title></title>
<meta http-equiv="Content-Type" content="text/html; ">
<p><span lang="en-au"><font face="Tahoma" size="2">--<br>
</font> </span><b><span lang="en-au"><font face="Tahoma" size="2">mike
hodgson</font></span></b><span lang="en-au"> <font face="Tahoma"
size="2">|</font><i><font face="Tahoma"> </font><font face="Tahoma"
size="2"> database administrator</font></i><font face="Tahoma" size="2">
| mallesons</font><font face="Tahoma"> </font><font face="Tahoma"
size="2">stephen</font><font face="Tahoma"> </font><font face="Tahoma"
size="2"> jaques</font><font face="Tahoma"><br>
</font><b><font face="Tahoma" size="2">T</font></b><font face="Tahoma"
size="2"> +61 (2) 9296 3668 |</font><b><font face="Tahoma"> </font><font
face="Tahoma" size="2"> F</font></b><font face="Tahoma" size="2"> +61
(2) 9296 3885 |</font><b><font face="Tahoma"> </font><font
face="Tahoma" size="2">M</font></b><font face="Tahoma" size="2"> +61
(408) 675 907</font><br>
<b><font face="Tahoma" size="2">E</font></b><font face="Tahoma" size="2">
<a href="http://links.10026.com/?link=mailto:mike.hodgson@.mallesons.nospam.com">
mailto:mike.hodgson@.mallesons.nospam.com</a> |</font><b><font
face="Tahoma"> </font><font face="Tahoma" size="2">W</font></b><font
face="Tahoma" size="2"> <a href="http://links.10026.com/?link=/">http://www.mallesons.com">
http://www.mallesons.com</a></font></span> </p>
</div>
<br>
<br>
David Tucker wrote:
<blockquote cite="midOS3S0DhdFHA.1504@.TK2MSFTNGP15.phx.gbl" type="cite">
<pre wrap="">I have a problem cause by an extensive sql statement that causes the tempdb
log file to be too small for execution. how can i extend the size of the log
file '
is
ALTER DATABASE tempdb
MODIFY FILE (
NAME=templog,
FILENAME='E:\tempdb.ldf',
SIZE = 5MB,
MAXSIZE = 10MB,
FILEGROWTH = 1MB )
a safe bet from the default size?
thanks
</pre>
</blockquote>
</body>
</html>
--020102060703060100090302--

out put to text file issue

DECLARE @.cdr_date datetime
SET @.cdr_date = getdate()-1
SET NOCOUNT ON
select *
from call
where year(starttime)=year(@.cdr_date) and month(starttime)=month(@.cdr_date) and day(starttime)=day(@.cdr_date)

I want to run this query with output file like g_YYMMDD ( where YYMMDD will come from @.cdr_date

How can I do thatFor this to work reliably you need to create a couple of procedures:

create proc dbo.sp_test
@.cdr_date datetime = current_timestamp
as
SET NOCOUNT ON
select *
from call
where year(starttime)=year(@.cdr_date) and month(starttime)=month(@.cdr_date) and day(starttime)=day(@.cdr_date)
return (0)
go

Then create another procedure that will create the output file:

create proc dbo.sp_bcp_queryout as
@.cdr_date datetime = current_timestamp
as
declare @.cmd varchar(8000)
--assuming the db name is MYDB, server name - MYSERVER
set @.cmd = 'bcp "exec MYDB.dbo.sp_test ' + char(39) +
convert(char(10), @.cdr_date, 101) + char(39) + '" queryout D:\g_' +
convert(char(6), @.cdr_date, 12) + ' -S MYSERVER -T -c'

exec master.dbo.xp_cmdshell @.cmd
return (0)
go|||Thank you very much|||now I get following error

SQLState = 37000, NativeError = 8146
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure sp_call_get_cdr has no parameters and arguments were supplied.
NULL|||At what point are you getting the error? I also recommend to use "-e Error-ExceptionFile.ERR" on BCP so that you can check what record(-s) caused the error.|||Thanks for the quick reply

I got it. it works now. the only quesitons remains is that if I want to create csv file can I do that with column name as headers.

please advice.

thanks for your help in advance|||Yes you can, but you'll need to switch from BCP to OSQL.|||so can you please be specific. which command I need to put|||You should be able to create a CSV with BCP by using Column terminators:
8.0
4
1 SQLSMALLINT 0 2 "" 1 smallintField ","
2 SQLNCHAR 2 100 "'" 2 charField1 "',"
3 SQLNCHAR 2 100 "'" 3 charField2 "',"
4 SQLDATETIME 0 8 "'" 4 datetimeField "',"

Wednesday, March 21, 2012

Out of memory Exception when Running a package with XML Task

Hi..

I'm running a package that has a XML Task in the control flow. This task tranforms a XML file with a XSLT.

The file is about 2 megs on a daily basis, but at the end of the month there is a full dump of data that makes the file to be around 400 megs. There is where my problem is.

I run this on my 2 GB memory workstation and when the memory gauge on the task manager reaches about 1.5gb the package fails with an "Out of memory exception".

I also run this package on a 8GB Ram server, and same applies.

Is there any way of making this package utilize all the available memory, I even increased the virtual memory to see if that helped my issue, but nothing.

Thanks

Are you running on a 32-bit or 64-bit OS? 32-bit servers are generally limited to about 2 gb of addressable memory, unless you have made some changes to the server configuration.|||

I'm running 32-bit... I wasn't aware of that!! I hope my admins knew that and made whatever change (I'm been highly opomistic, givin them the benefit of the doubt).

**UPDATE**

Yes... The server has the "/PAE" switch in the boot.ini, so its configured to use the 8 gigs of memory available to it.

|||Are other things running on the server - for example, the SQL Server relational engine? How much memory is allocated to it?|||

I'm looking at the Performance Tab in Task Manager and there is

Total Physical Memory: 8.32 Gigs

Available Physical Mem: 7.12 Gigs

From that 1 gig of memory taken is about 600 Megs devoted to System Cache and the rest is commited to running programs like SQL Server.

The only SQL server 2005 services that are running are

SSIS (of course) Smile

Full Text Search

SQL Server

SQL Server Agent

Again... Thanks for all your help

|||

This is a good work around.

I used a Script Task (I find myself using it more and more as I find limitations in SSIS) and with 3 simple lines of code I resolved the issue.

Code Snippet

Dim xslt As New XslTransform()
xslt.Load("C:\Temp\Template.xslt")
xslt.Transform("C:\Temp\XMLSource.xml", "C:\Temp\XMLSource_Revised.xml")

This code performs the task in 5 mins -/+ consumming about 900 megs of memory space, for a 500 meg file.

Out of memory Exception when Running a package with XML Task

Hi..

I'm running a package that has a XML Task in the control flow. This task tranforms a XML file with a XSLT.

The file is about 2 megs on a daily basis, but at the end of the month there is a full dump of data that makes the file to be around 400 megs. There is where my problem is.

I run this on my 2 GB memory workstation and when the memory gauge on the task manager reaches about 1.5gb the package fails with an "Out of memory exception".

I also run this package on a 8GB Ram server, and same applies.

Is there any way of making this package utilize all the available memory, I even increased the virtual memory to see if that helped my issue, but nothing.

Thanks

Are you running on a 32-bit or 64-bit OS? 32-bit servers are generally limited to about 2 gb of addressable memory, unless you have made some changes to the server configuration.|||

I'm running 32-bit... I wasn't aware of that!! I hope my admins knew that and made whatever change (I'm been highly opomistic, givin them the benefit of the doubt).

**UPDATE**

Yes... The server has the "/PAE" switch in the boot.ini, so its configured to use the 8 gigs of memory available to it.

|||Are other things running on the server - for example, the SQL Server relational engine? How much memory is allocated to it?|||

I'm looking at the Performance Tab in Task Manager and there is

Total Physical Memory: 8.32 Gigs

Available Physical Mem: 7.12 Gigs

From that 1 gig of memory taken is about 600 Megs devoted to System Cache and the rest is commited to running programs like SQL Server.

The only SQL server 2005 services that are running are

SSIS (of course) Smile

Full Text Search

SQL Server

SQL Server Agent

Again... Thanks for all your help

|||

This is a good work around.

I used a Script Task (I find myself using it more and more as I find limitations in SSIS) and with 3 simple lines of code I resolved the issue.

Code Snippet

Dim xslt As New XslTransform()
xslt.Load("C:\Temp\Template.xslt")
xslt.Transform("C:\Temp\XMLSource.xml", "C:\Temp\XMLSource_Revised.xml")

This code performs the task in 5 mins -/+ consumming about 900 megs of memory space, for a 500 meg file.

Out Of Memory

Hi Guys,
What i'm trying here is to run a .bat file containing Osql Command's on the server using asp. Which is Generating Out Of Memory Error.

In Detail.

This .bat file is having a Osql command to connect to a database with a parameter to run a .sql file and output parameter to give to output in .txt file. This is working fine if I simply run the .bat file on the server. its working fine no probes, but when I try the same from a .asp file running this .asp file from the same machine its giving me the Out of Memory Error.


Content of the .bat file is
@.cd
@.osql -U user -P Password -i c:\BatchUpdateTest\test.sql -o c:\BatchUpdateTest\test.txt
@.pause


Content of the .sql file is
SELECT * INTO ARC_TABLENAME TABLENAME
GO

DECLARE @.del_error int
DECLARE @.description VARCHAR(1000)

SELECT @.del_error= @.@.ERROR
SELECT @.description= description FROM MASTER..SYSMESSAGES WHERE error = @.del_error

IF @.del_error = 0
SELECT * FROM ARC_TABLENAME
ELSE
PRINT @.description+' ARC_TABLENAME'
GO


Content of the .asp file is

<%
var server_shell = Server.CreateObject("wscript.shell")
try{
server_shell.Run("c:\BatchUpdateTest\test.bat",1)
}catch(e){
Response.Write(e.description)
}
%>



Actualy when i run this code in the .bat file from .asp it did not give any error. So what i did is put a try catch block to trap the error which gives me this error Out of memory.

What should i do to solve this problem
Plz Help me out in this

Thanks in advance
Dinesh

I can't tell exactly what is going on here, but it seems to be limited to the web access method, since it works correctly from the batch file. So I would limit my search to that area - you might want to try turning on garbage collection:

http://support.microsoft.com/kb/911716

Buck Woody

Out of Memory

Hi Guys,
What i'm trying here is to run a .bat file containing Osql Command's on the server using asp. Which is Generating Out Of Memory Error.

In Detail.

This .bat file is having a Osql command to connect to a database with a parameter to run a .sql file and output parameter to give to output in .txt file. This is working fine if I simply run the .bat file on the server. its working fine no probes, but when I try the same from a .asp file running this .asp file from the same machine its giving me the Out of Memory Error.


Content of the .bat file is
@.cd
@.osql -U user -P Password -i c:\BatchUpdateTest\test.sql -o c:\BatchUpdateTest\test.txt
@.pause

Content of the .sql file is
SELECT * INTO ARC_TABLENAME TABLENAME
GO

DECLARE @.del_error int
DECLARE @.description VARCHAR(1000)

SELECT @.del_error= @.@.ERROR
SELECT @.description= description FROM MASTER..SYSMESSAGES WHERE error = @.del_error

IF @.del_error = 0
SELECT * FROM ARC_TABLENAME
ELSE
PRINT @.description+' ARC_TABLENAME'
GO


Content of the .asp file is
<%
var server_shell = Server.CreateObject("wscript.shell")
try{
server_shell.Run("c:\BatchUpdateTest\test.bat",1)
}catch(e){
Response.Write(e.description)
}
%>

Actualy when i run this code in the .bat file from .asp it did not give any error. So what i did is put a try catch block to trap the error which gives me this error Out of memory.

What should i do to solve this problem
Plz Help me out in this

Thanks in advance
Dinesh
You need to troubleshoot from ASP side. It is unlikely this has anything to do with SQL or the batch file itself.

Out Of Memory

Hi Guys,
What i'm trying here is to run a .bat file containing Osql Command's on the server using asp. Which is Generating Out Of Memory Error.

In Detail.

This .bat file is having a Osql command to connect to a database with a parameter to run a .sql file and output parameter to give to output in .txt file. This is working fine if I simply run the .bat file on the server. its working fine no probes, but when I try the same from a .asp file running this .asp file from the same machine its giving me the Out of Memory Error.


Content of the .bat file is
@.cd
@.osql -U user -P Password -i c:\BatchUpdateTest\test.sql -o c:\BatchUpdateTest\test.txt
@.pause


Content of the .sql file is
SELECT * INTO ARC_TABLENAME TABLENAME
GO

DECLARE @.del_error int
DECLARE @.description VARCHAR(1000)

SELECT @.del_error= @.@.ERROR
SELECT @.description= description FROM MASTER..SYSMESSAGES WHERE error = @.del_error

IF @.del_error = 0
SELECT * FROM ARC_TABLENAME
ELSE
PRINT @.description+' ARC_TABLENAME'
GO


Content of the .asp file is

<%
var server_shell = Server.CreateObject("wscript.shell")
try{
server_shell.Run("c:\BatchUpdateTest\test.bat",1)
}catch(e){
Response.Write(e.description)
}
%>



Actualy when i run this code in the .bat file from .asp it did not give any error. So what i did is put a try catch block to trap the error which gives me this error Out of memory.

What should i do to solve this problem
Plz Help me out in this

Thanks in advance
Dinesh

I can't tell exactly what is going on here, but it seems to be limited to the web access method, since it works correctly from the batch file. So I would limit my search to that area - you might want to try turning on garbage collection:

http://support.microsoft.com/kb/911716

Buck Woody

out of control T-Log? NEED HELP PLEASE...

Hello -
I have a problem with a T-Log file that just seems to keep growing no matter
what I do...
Here are the file sizes:
MDF 563,648 KB
LDF 3,244,544 KB !!!
I have done full backups on this database
I have done DBCC shrinkdatabase
I have done DBCC shrinkfile (<LDF filename>, TRUNCATEONLY) (where <LDF filen
ame> is the name of the logfile)
Nothing seems to affect the size of this file.
I even, in desperation, thought that perhaps there was an open transaction i
n the log file, so I ran DBCC OpenTran ('<DBNAME>') (where DBNAME is the na
me of the database) I got back no active open transactions.
There is just no way that I can see that this database (either MDF or LDF fi
le should be that big.
Does anyone have any advise ? Thanks in advance.
RandyvolFull backup doesn't empty the log backup. And shrink won't work either as
the haven't emptied the log file. Either do regular transaction log backups
or set the database to simple recovery model. As for shrinking of the log
files, there are a few useful links in below article:
http://www.karaszi.com/sqlserver/info_dont_shrink.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"randyvol" <randy.volters@.whaleyfoodservice.com> wrote in message
news:08ED6880-34CD-4A06-A18B-26DE8DA5AA27@.microsoft.com...
> Hello -
> I have a problem with a T-Log file that just seems to keep growing no
matter what I do...
> Here are the file sizes:
> MDF 563,648 KB
> LDF 3,244,544 KB !!!
> I have done full backups on this database
> I have done DBCC shrinkdatabase
> I have done DBCC shrinkfile (<LDF filename>, TRUNCATEONLY) (where <LDF
filename> is the name of the logfile)
> Nothing seems to affect the size of this file.
> I even, in desperation, thought that perhaps there was an open transaction
in the log file, so I ran DBCC OpenTran ('<DBNAME>') (where DBNAME is the
name of the database) I got back no active open transactions.
> There is just no way that I can see that this database (either MDF or LDF
file should be that big.
> Does anyone have any advise ? Thanks in advance.
> Randyvol|||first thing you can do is search for answers to this question. this questio
n is probably the most asked question in this newsgroup.
short and sweet answer is that you need to do transaction log backups.
randyvol wrote:

> Hello -
> I have a problem with a T-Log file that just seems to keep growing no matt
er what I do...
> Here are the file sizes:
> MDF 563,648 KB
> LDF 3,244,544 KB !!!
> I have done full backups on this database
> I have done DBCC shrinkdatabase
> I have done DBCC shrinkfile (<LDF filename>, TRUNCATEONLY) (where <LDF fil
ename> is the name of the logfile)
> Nothing seems to affect the size of this file.
> I even, in desperation, thought that perhaps there was an open transaction
in the log file, so I ran DBCC OpenTran ('<DBNAME>') (where DBNAME is the
name of the database) I got back no active open transactions.
> There is just no way that I can see that this database (either MDF or LDF
file should be that big.
> Does anyone have any advise ? Thanks in advance.
> Randyvol|||Sorry -
I neglected to state that I have also done T-log backups... at least I think
I have. Maybe you can tell me...
Here's the script for the particular DB in question...
<snip>
BACKUP LOG WHALEYAPPS TO
DISK = 'D:\EMSQLT_BKPS\WHALEYAPPS_LOG.trn'
WITH INIT, STATS = 25
<end snip>
-- Tibor Karaszi wrote: --
Full backup doesn't empty the log backup. And shrink won't work either as
the haven't emptied the log file. Either do regular transaction log backups
or set the database to simple recovery model. As for shrinking of the log
files, there are a few useful links in below article:
http://www.karaszi.com/sqlserver/info_dont_shrink.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"randyvol" <randy.volters@.whaleyfoodservice.com> wrote in message
news:08ED6880-34CD-4A06-A18B-26DE8DA5AA27@.microsoft.com...
> Hello -
matter what I do...
> MDF 563,648 KB
> LDF 3,244,544 KB !!!
> I have done DBCC shrinkdatabase
> I have done DBCC shrinkfile (<LDF filename>, TRUNCATEONLY) (where <LDF
filename> is the name of the logfile)
in the log file, so I ran DBCC OpenTran ('<DBNAME>') (where DBNAME is the
name of the database) I got back no active open transactions.
file should be that big.|||Yes, that is a log backup. Check out the links I have on the web page.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"randyvol" <anonymous@.discussions.microsoft.com> wrote in message
news:5769B966-0388-4C2E-A336-ADBF015123D2@.microsoft.com...
> Sorry -
> I neglected to state that I have also done T-log backups... at least I
think I have. Maybe you can tell me...
> Here's the script for the particular DB in question...
> <snip>
> BACKUP LOG WHALEYAPPS TO
> DISK = 'D:\EMSQLT_BKPS\WHALEYAPPS_LOG.trn'
> WITH INIT, STATS = 25
> <end snip>
>
> -- Tibor Karaszi wrote: --
> Full backup doesn't empty the log backup. And shrink won't work
either as
> the haven't emptied the log file. Either do regular transaction log
backups
> or set the database to simple recovery model. As for shrinking of the
log
> files, there are a few useful links in below article:
> http://www.karaszi.com/sqlserver/info_dont_shrink.asp
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
>
> "randyvol" <randy.volters@.whaleyfoodservice.com> wrote in message
> news:08ED6880-34CD-4A06-A18B-26DE8DA5AA27@.microsoft.com...
no
> matter what I do...
<LDF
> filename> is the name of the logfile)
transaction
> in the log file, so I ran DBCC OpenTran ('<DBNAME>') (where DBNAME
is the
> name of the database) I got back no active open transactions.
or LDF
> file should be that big.
>
>|||Hi Randy,
I am reviewing you post and since we have not heard from you for some time
in the newsgroup, I wonder if you still have some question about it besides
our community member and MVP's information. For any more question, please
post your message here and we are glad to help.
Thanks.
Best regards
Baisong Wei
Microsoft Online Support
----
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only. Thanks.

Out of control log file

To all:
I have a database that's about 2.5 GB in size, but the log file has grown to
over 55GB and has eaten up almost all of my drive space. How can I
remove/replace/compress that log file to recover my hard drive space back?
I've tried recreating the log file by running sp_detach_db, creating a new
log file, and then reattaching the db but it fails. Any suggestions are
greatly appreciated. Thanks in advance.
Steve
Steven Johnston wrote:
> To all:
> I have a database that's about 2.5 GB in size, but the log file has
> grown to over 55GB and has eaten up almost all of my drive space. How
> can I remove/replace/compress that log file to recover my hard drive
> space back? I've tried recreating the log file by running
> sp_detach_db, creating a new log file, and then reattaching the db
> but it fails. Any suggestions are greatly appreciated. Thanks in
> advance.
Read BOL about backup of your database. You can only shrink your tx log
if you do a backup (or do a log backup for truncation only). HTH
robert
|||Have a look here:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp Shrinking
considerations
http://www.nigelrivett.net/Transacti...leGrows_1.html Log File issues
http://www.support.microsoft.com/?id=317375 Log File Grows too big
http://www.support.microsoft.com/?id=110139 Log file filling up
http://www.support.microsoft.com/?id=315512 Considerations for Autogrow
and AutoShrink
http://www.support.microsoft.com/?id=272318 Shrinking Log in SQL Server
2000 with DBCC SHRINKFILE
http://www.support.microsoft.com/?id=873235 How to stop the log file from
growing
http://www.support.microsoft.com/?id=305635 Timeout while DB expanding
http://www.support.microsoft.com/?id=307487 Shrinking TempDB
Andrew J. Kelly SQL MVP
"Steven Johnston" <saj3@.jasper.he.net> wrote in message
news:%23BT4PoUOGHA.2472@.TK2MSFTNGP11.phx.gbl...
> To all:
> I have a database that's about 2.5 GB in size, but the log file has grown
> to over 55GB and has eaten up almost all of my drive space. How can I
> remove/replace/compress that log file to recover my hard drive space back?
> I've tried recreating the log file by running sp_detach_db, creating a new
> log file, and then reattaching the db but it fails. Any suggestions are
> greatly appreciated. Thanks in advance.
> Steve
>

Out of control log file

To all:
I have a database that's about 2.5 GB in size, but the log file has grown to
over 55GB and has eaten up almost all of my drive space. How can I
remove/replace/compress that log file to recover my hard drive space back?
I've tried recreating the log file by running sp_detach_db, creating a new
log file, and then reattaching the db but it fails. Any suggestions are
greatly appreciated. Thanks in advance.
SteveSteven Johnston wrote:
> To all:
> I have a database that's about 2.5 GB in size, but the log file has
> grown to over 55GB and has eaten up almost all of my drive space. How
> can I remove/replace/compress that log file to recover my hard drive
> space back? I've tried recreating the log file by running
> sp_detach_db, creating a new log file, and then reattaching the db
> but it fails. Any suggestions are greatly appreciated. Thanks in
> advance.
Read BOL about backup of your database. You can only shrink your tx log
if you do a backup (or do a log backup for truncation only). HTH
robert|||Have a look here:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp Shrinking
considerations
http://www.nigelrivett.net/Transact...ileGrows_1.html Log File issues
http://www.support.microsoft.com/?id=317375 Log File Grows too big
http://www.support.microsoft.com/?id=110139 Log file filling up
http://www.support.microsoft.com/?id=315512 Considerations for Autogrow
and AutoShrink
http://www.support.microsoft.com/?id=272318 Shrinking Log in SQL Server
2000 with DBCC SHRINKFILE
http://www.support.microsoft.com/?id=873235 How to stop the log file from
growing
http://www.support.microsoft.com/?id=305635 Timeout while DB expanding
http://www.support.microsoft.com/?id=307487 Shrinking TempDB
Andrew J. Kelly SQL MVP
"Steven Johnston" <saj3@.jasper.he.net> wrote in message
news:%23BT4PoUOGHA.2472@.TK2MSFTNGP11.phx.gbl...
> To all:
> I have a database that's about 2.5 GB in size, but the log file has grown
> to over 55GB and has eaten up almost all of my drive space. How can I
> remove/replace/compress that log file to recover my hard drive space back?
> I've tried recreating the log file by running sp_detach_db, creating a new
> log file, and then reattaching the db but it fails. Any suggestions are
> greatly appreciated. Thanks in advance.
> Steve
>

Out of control log file

To all:
I have a database that's about 2.5 GB in size, but the log file has grown to
over 55GB and has eaten up almost all of my drive space. How can I
remove/replace/compress that log file to recover my hard drive space back?
I've tried recreating the log file by running sp_detach_db, creating a new
log file, and then reattaching the db but it fails. Any suggestions are
greatly appreciated. Thanks in advance.
SteveSteven Johnston wrote:
> To all:
> I have a database that's about 2.5 GB in size, but the log file has
> grown to over 55GB and has eaten up almost all of my drive space. How
> can I remove/replace/compress that log file to recover my hard drive
> space back? I've tried recreating the log file by running
> sp_detach_db, creating a new log file, and then reattaching the db
> but it fails. Any suggestions are greatly appreciated. Thanks in
> advance.
Read BOL about backup of your database. You can only shrink your tx log
if you do a backup (or do a log backup for truncation only). HTH
robert|||Have a look here:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp Shrinking
considerations
http://www.nigelrivett.net/TransactionLogFileGrows_1.html Log File issues
http://www.support.microsoft.com/?id=317375 Log File Grows too big
http://www.support.microsoft.com/?id=110139 Log file filling up
http://www.support.microsoft.com/?id=315512 Considerations for Autogrow
and AutoShrink
http://www.support.microsoft.com/?id=272318 Shrinking Log in SQL Server
2000 with DBCC SHRINKFILE
http://www.support.microsoft.com/?id=873235 How to stop the log file from
growing
http://www.support.microsoft.com/?id=305635 Timeout while DB expanding
http://www.support.microsoft.com/?id=307487 Shrinking TempDB
--
Andrew J. Kelly SQL MVP
"Steven Johnston" <saj3@.jasper.he.net> wrote in message
news:%23BT4PoUOGHA.2472@.TK2MSFTNGP11.phx.gbl...
> To all:
> I have a database that's about 2.5 GB in size, but the log file has grown
> to over 55GB and has eaten up almost all of my drive space. How can I
> remove/replace/compress that log file to recover my hard drive space back?
> I've tried recreating the log file by running sp_detach_db, creating a new
> log file, and then reattaching the db but it fails. Any suggestions are
> greatly appreciated. Thanks in advance.
> Steve
>sql

Monday, March 12, 2012

osql with Unicode ?

Hi
How can I insert data in sql file(unicode - Thai chars) into sql server
using osql ?
regards
Dishan
Whe I run these files(inserts) using osql, enterprise manager shows
"?" as data
please help..
|||Sorry its my mistake.. I didnt put N( N'unidata' ) in my sql script

osql with script trouble...

I have a sql file that contains:
if EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name ='newShopcart')
DROP DATABASE [newShopcart];
CREATE DATABASE [newShopcart] ON (NAME ='newShopcart_dat', FILENAME ='C:\MSSQL7\DATA\newShopcart.mdf' , SIZE = 10, FILEGROWTH =
10%) LOG ON (NAME ='newShopcart_log', FILENAME ='C:\MSSQL7\DATA\newShopcart.ldf' , SIZE = 10, FILEGROWTH = 10%);
USE [newShopcart];
GO
And I call this using osql in this way:
osql -D TLC -U sa -P thepassword -i MakeDB.sql -o MakeDB.log -n
I get the following in the resulting log:
Msg 2812, Level 16, State 62, Line 1
Could not find stored procedure 'i'.
I've noticed that changing the first line to USE [master] changes the log to:
Msg 2812, Level 16, State 62, Line 1
Could not find stored procedure 'U'.
This leads me to believe that it sees the first character of the file as the name of a Stored Procedure.
Any idea how to get around this?
Thanks in advance.
Mandy wrote:
> I have a sql file that contains:
> if EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name
> ='newShopcart')
> DROP DATABASE [newShopcart];
> CREATE DATABASE [newShopcart] ON (NAME ='newShopcart_dat', FILENAME
> ='C:\MSSQL7\DATA\newShopcart.mdf' , SIZE = 10, FILEGROWTH = 10%) LOG
> ON (NAME ='newShopcart_log', FILENAME
> ='C:\MSSQL7\DATA\newShopcart.ldf' , SIZE = 10, FILEGROWTH = 10%);
> USE [newShopcart];
> GO
> And I call this using osql in this way:
> osql -D TLC -U sa -P thepassword -i MakeDB.sql -o MakeDB.log -n
> I get the following in the resulting log:
> Msg 2812, Level 16, State 62, Line 1
> Could not find stored procedure 'i'.
> I've noticed that changing the first line to USE [master] changes the
> log to:
> Msg 2812, Level 16, State 62, Line 1
> Could not find stored procedure 'U'.
> This leads me to believe that it sees the first character of the file
> as the name of a Stored Procedure.
> Any idea how to get around this?
> Thanks in advance.
Does this code work from Query Analyzer? I see on your last line you
are using a semi-colon and a go. Does OSQL understand "go"? What's the
"n" option for and do you need it?
David Gugick
Imceda Software
www.imceda.com
|||It does work under QA. -n removes line numbers from results.

> Does this code work from Query Analyzer? I see on your last line you
> are using a semi-colon and a go. Does OSQL understand "go"? What's the
> "n" option for and do you need it?
> --
> David Gugick
> Imceda Software
> www.imceda.com
>
|||Are you sure this is an odbc data source and not just a regular SQL Server
connection? What happens if you remove the -D option and value? You could
also try adding the option -e to echo the commands as they are read, for
troubleshooting.
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Mandy" <clafarge@.NOSPAMgraphiced.com> wrote in message
news:eAn4RG%232EHA.1192@.tk2msftngp13.phx.gbl...
>I have a sql file that contains:
> if EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name
> ='newShopcart')
> DROP DATABASE [newShopcart];
> CREATE DATABASE [newShopcart] ON (NAME ='newShopcart_dat', FILENAME
> ='C:\MSSQL7\DATA\newShopcart.mdf' , SIZE = 10, FILEGROWTH =
> 10%) LOG ON (NAME ='newShopcart_log', FILENAME
> ='C:\MSSQL7\DATA\newShopcart.ldf' , SIZE = 10, FILEGROWTH = 10%);
> USE [newShopcart];
> GO
> And I call this using osql in this way:
> osql -D TLC -U sa -P thepassword -i MakeDB.sql -o MakeDB.log -n
> I get the following in the resulting log:
> Msg 2812, Level 16, State 62, Line 1
> Could not find stored procedure 'i'.
> I've noticed that changing the first line to USE [master] changes the log
> to:
> Msg 2812, Level 16, State 62, Line 1
> Could not find stored procedure 'U'.
> This leads me to believe that it sees the first character of the file as
> the name of a Stored Procedure.
> Any idea how to get around this?
> Thanks in advance.
>
|||I changed to specifying -S and ip address. When I added -e, it shows only one line of output:
I
So it still appears to only see the first character of the file.
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message news:%23PyX8MA3EHA.1396@.tk2msftngp13.phx.gbl...
> Are you sure this is an odbc data source and not just a regular SQL Server
> connection? What happens if you remove the -D option and value? You could
> also try adding the option -e to echo the commands as they are read, for
> troubleshooting.
|||-S is usually followed by the server name.
What version of SQL Server? Are you running osql remotely or locally?
Can you verify the version of osql?
How did you create the .sql file?
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Mandy" <clafarge@.NOSPAMgraphiced.com> wrote in message
news:Ogr83FH3EHA.2312@.TK2MSFTNGP15.phx.gbl...
>I changed to specifying -S and ip address. When I added -e, it shows only
>one line of output:
> I
> So it still appears to only see the first character of the file.
>
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:%23PyX8MA3EHA.1396@.tk2msftngp13.phx.gbl...
>
|||I tried -S with ip and also server name.
MSSQL Version 7
osql on my machine, Server on network
osql version 2000.80.194.0
created script by Right-click on existing DB in Enterrprise and "Generate SQL Script", then changing names as needed for new
database.
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message news:u0bXMoH3EHA.1300@.TK2MSFTNGP14.phx.gbl...
> -S is usually followed by the server name.
> What version of SQL Server? Are you running osql remotely or locally?
> Can you verify the version of osql?
> How did you create the .sql file?
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "Mandy" <clafarge@.NOSPAMgraphiced.com> wrote in message
> news:Ogr83FH3EHA.2312@.TK2MSFTNGP15.phx.gbl...
>
|||Mandy wrote:
> I tried -S with ip and also server name.
> MSSQL Version 7
> osql on my machine, Server on network
> osql version 2000.80.194.0
> created script by Right-click on existing DB in Enterrprise and
> "Generate SQL Script", then changing names as needed for new database.
>
You really should patch your client tools. You are running the retail
release of OSQL.EXE from years ago. Apply the latest SQL Server SP3a
service pack to your client PC.
Also, try running a very simple script like "Select * from sysobjects"
from a script file and see if that works.
David Gugick
Imceda Software
www.imceda.com
|||Thanks for the pointer...
When I changed to a Select, I get:
Msg 2812, Level 16, State 62, Line 1
Could not find stored procedure 'S'.
Is there any reason why it would only see the first character?
"David Gugick" <davidg-nospam@.imceda.com> wrote in message news:uBnghHJ3EHA.524@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> Mandy wrote:
|||Mandy wrote:[vbcol=seagreen]
> Thanks for the pointer...
> When I changed to a Select, I get:
> Msg 2812, Level 16, State 62, Line 1
> Could not find stored procedure 'S'.
> Is there any reason why it would only see the first character?
>
> "David Gugick" <davidg-nospam@.imceda.com> wrote in message
> news:uBnghHJ3EHA.524@.TK2MSFTNGP09.phx.gbl...
What format are you saving the file in? Is it unicode? Maybe OSQL cannot
read unicode files and requires an ANSI formatted file.
David Gugick
Imceda Software
www.imceda.com

Friday, March 9, 2012

OSQL usage

Hi All,
Is it possible to create a database (databse.mdf file) at a specified
location using OSQL ?
Thanks in advance for any help,
Piyush
hi Piyush,
"Piyush" <anonymus@.hotmail.com> ha scritto nel messaggio
news:%23XlPdRfqEHA.3728@.TK2MSFTNGP09.phx.gbl
> Hi All,
> Is it possible to create a database (databse.mdf file) at a specified
> location using OSQL ?
> Thanks in advance for any help,
> Piyush
a good article about oSql can be found at
http://support.microsoft.com/default...EN-US;q325003, and, of
course, it is possible to define a specific database's files location, using
the standard CREATE DATABASE syntax
(http://msdn.microsoft.com/library/de...-us/tsqlref/ts
_create_1up1.asp)
for your convenience, you can download the SQL Server Books On Line at
http://www.microsoft.com/sql/techinf...000/books.asp, the on line
help for SQL Server, including all Transact-SQL reference
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.9.1 - DbaMgr ver 0.55.1
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Thanks Andrea,
The create Database scheme works fine for me.
regards,
Piyush
But is this possible using OSQL.
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote in message
news:2scla2F1ijfkfU1@.uni-berlin.de...
> hi Piyush,
> "Piyush" <anonymus@.hotmail.com> ha scritto nel messaggio
> news:%23XlPdRfqEHA.3728@.TK2MSFTNGP09.phx.gbl
> a good article about oSql can be found at
> http://support.microsoft.com/default...EN-US;q325003, and, of
> course, it is possible to define a specific database's files location,
using
> the standard CREATE DATABASE syntax
>
(http://msdn.microsoft.com/library/de...-us/tsqlref/ts
> _create_1up1.asp)
> for your convenience, you can download the SQL Server Books On Line at
> http://www.microsoft.com/sql/techinf...000/books.asp, the on
line
> help for SQL Server, including all Transact-SQL reference
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.9.1 - DbaMgr ver 0.55.1
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>