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

Friday, March 30, 2012

Hide Fields on Export

When I export to a file, say excel, I want certain textboxes to not show up.
How can I hide them on export?
bradSorry, this is not possible. You can only hide based on e.g. report
parameters.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"bradtm" <bradtm@.discussions.microsoft.com> wrote in message
news:9145ACFB-54E5-4BFC-82B4-0368B7AFA0FE@.microsoft.com...
> When I export to a file, say excel, I want certain textboxes to not show
> up.
> How can I hide them on export?
> brad|||Don't forget, though, if you use your own "export" button through a
custom interface, setting the rs:FORMAT=PDF or similar, you can set a
report parameter that can be referenced to show or hide selected fields.

Wednesday, March 28, 2012

Hide Column Header in the Results

I have a stored procedure and I want to save the results in a file. I don't
want the column header to be in the file. I need to generate the file daily.
It has just one column. Example the results is showing:
Msg
{1:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D :111XXX@.MYE@.-}
{2:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D :111X@.MYE@.-}
I want the following results without the Header and extra line in the file.
How can I achive this. I have tried isql and isql/w but no success yet.
{1:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D :111XXX@.MYE@.-}
{2:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D :111X@.MYE@.-}
Use osql instead, with option -h -1.
Example:
C:\TEMP>osql -Spivotalr5 -E -Q"select top 5 orderid, orderdate from
northwind..o
rders" -h-1
AMB
"Fraz" wrote:

> I have a stored procedure and I want to save the results in a file. I don't
> want the column header to be in the file. I need to generate the file daily.
> It has just one column. Example the results is showing:
> Msg
> --
> {1:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D :111XXX@.MYE@.-}
> {2:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D :111X@.MYE@.-}
> I want the following results without the Header and extra line in the file.
> How can I achive this. I have tried isql and isql/w but no success yet.
> {1:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D :111XXX@.MYE@.-}
> {2:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D :111X@.MYE@.-}
>

Hide Column Header in the Results

I have a stored procedure and I want to save the results in a file. I don't
want the column header to be in the file. I need to generate the file daily.
It has just one column. Example the results is showing:
Msg
--
& #123;1:@.:20:040705@.:21B:XXXX@.:33A:040705
XXX00000,@.:55D:111XXX@.MYE@.-}
& #123;2:@.:20:040705@.:21B:XXXX@.:33A:040705
XXX00000,@.:55D:111X@.MYE@.-}
I want the following results without the Header and extra line in the file.
How can I achive this. I have tried isql and isql/w but no success yet.
& #123;1:@.:20:040705@.:21B:XXXX@.:33A:040705
XXX00000,@.:55D:111XXX@.MYE@.-}
& #123;2:@.:20:040705@.:21B:XXXX@.:33A:040705
XXX00000,@.:55D:111X@.MYE@.-}Use osql instead, with option -h -1.
Example:
C:\TEMP>osql -Spivotalr5 -E -Q"select top 5 orderid, orderdate from
northwind..o
rders" -h-1
AMB
"Fraz" wrote:

> I have a stored procedure and I want to save the results in a file. I don'
t
> want the column header to be in the file. I need to generate the file dail
y.
> It has just one column. Example the results is showing:
> Msg
> --
> & #123;1:@.:20:040705@.:21B:XXXX@.:33A:040705
XXX00000,@.:55D:111XXX@.MYE@.-}
> & #123;2:@.:20:040705@.:21B:XXXX@.:33A:040705
XXX00000,@.:55D:111X@.MYE@.-}
> I want the following results without the Header and extra line in the file
.
> How can I achive this. I have tried isql and isql/w but no success yet.
> & #123;1:@.:20:040705@.:21B:XXXX@.:33A:040705
XXX00000,@.:55D:111XXX@.MYE@.-}
> & #123;2:@.:20:040705@.:21B:XXXX@.:33A:040705
XXX00000,@.:55D:111X@.MYE@.-}
>

Hide Column Header in the Results

I have a stored procedure and I want to save the results in a file. I don't
want the column header to be in the file. I need to generate the file daily.
It has just one column. Example the results is showing:
Msg
--
{1:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D:111XXX@.MYE@.-}
{2:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D:111X@.MYE@.-}
I want the following results without the Header and extra line in the file.
How can I achive this. I have tried isql and isql/w but no success yet.
{1:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D:111XXX@.MYE@.-}
{2:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D:111X@.MYE@.-}Use osql instead, with option -h -1.
Example:
C:\TEMP>osql -Spivotalr5 -E -Q"select top 5 orderid, orderdate from
northwind..o
rders" -h-1
AMB
"Fraz" wrote:
> I have a stored procedure and I want to save the results in a file. I don't
> want the column header to be in the file. I need to generate the file daily.
> It has just one column. Example the results is showing:
> Msg
> --
> {1:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D:111XXX@.MYE@.-}
> {2:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D:111X@.MYE@.-}
> I want the following results without the Header and extra line in the file.
> How can I achive this. I have tried isql and isql/w but no success yet.
> {1:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D:111XXX@.MYE@.-}
> {2:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D:111X@.MYE@.-}
>sql

Monday, March 19, 2012

hi

how to run a vb script file in vb.netPlease, move your question to VB forum.

Hexadecimal format .mdf file

How to find the hexadecimal format of .mdf or .ldf file (sql database file)

Quote:

Originally Posted by Avishkaar

How to find the hexadecimal format of .mdf or .ldf file (sql database file)


I'm sorry, I don't understand your question, but this might be better suited in one of the SQL forums?

Friday, March 9, 2012

HELP--SSIS Dataflow Task

Need help regarding ssis dataflow task

I need to create a ssis package. I want to import the data from a flat file to a table.

Lets say, the table has 5 columns -- col1, col2, col3, col4 , col5.(Assume that all columns can be NULLABLE) The datafile contains the data related to only three columns say col1, col2, col3. So when I use dataflow task to import the data from the file to the table, I will only get three columns, col1, col2, col3. Columns col4, col5 will be NULL.
However, I want to populate columns col4, col5 with some values which are stored in the variable.

IS there any way to do this?

Any help would be appreciated.

Thanks

vjai wrote:

Need help regarding ssis dataflow task

I need to create a ssis package. I want to import the data from a flat file to a table.

Lets say, the table has 5 columns -- col1, col2, col3, col4 , col5.(Assume that all columns can be NULLABLE) The datafile contains the data related to only three columns say col1, col2, col3. So when I use dataflow task to import the data from the file to the table, I will only get three columns, col1, col2, col3. Columns col4, col5 will be NULL.
However, I want to populate columns col4, col5 with some values which are stored in the variable.

IS there any way to do this?

Any help would be appreciated.

Thanks

What variable?

-Jamie

|||

Nullable flat file columns is a bit of a strange one, how do you tell the difference between null and an empty string? Having no column is not a valid way to represent null, that is an invalid file format! I suspect what you are asking cannot be done, certainly not if the format of the file changes.

if the format is static, but sometimes values are empty then you could use a Derived Column transform to test for this and substitute a variable value in place.

|||

hi Vijai

You can do this!! and its very simple

Steps

I assume that u have a source with 3 cols.

Now add a drived column transformation task create two new columns and in expression give corresponding variable .

Now if ur output will have 5 columns, 3 from ur source and 2 new columns having values from the variables.Do the necessary mapping with destination.

Thanks and Regards

Rahul Kumar, Software Engineer, India

Wednesday, March 7, 2012

HELP: update a table from a text file

I have a field in a DB that I want to update with the contents of a
text file. I retrieved the contents of the text file FROM the entry
but now that I edited them, I want to put them back.
This text file has only a single entry in it. No row/column
delimeters needed.I tried using the Enterprise Manager import data
wizard but it doesn't do what I want.
I guess the sql statement would look something like this:
Update mytable
Set data = contents of textfile
WHERE data LIKE '%uniquething%'
HELP
JohnYou could set up a linked server to the text file and read the value in
TSQL. Pls have a look at the example "F. Using the Microsoft OLE DB Provider
for Jet to access a text file" at
http://msdn2.microsoft.com/en-us/library/ms190479.aspx for more info.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com

HELP: update a table from a text file

I have a field in a DB that I want to update with the contents of a
text file. I retrieved the contents of the text file FROM the entry
but now that I edited them, I want to put them back.
This text file has only a single entry in it. No row/column
delimeters needed.I tried using the Enterprise Manager import data
wizard but it doesn't do what I want.
I guess the sql statement would look something like this:
Update mytable
Set data = contents of textfile
WHERE data LIKE '%uniquething%'
HELP
John
You could set up a linked server to the text file and read the value in
TSQL. Pls have a look at the example "F. Using the Microsoft OLE DB Provider
for Jet to access a text file" at
http://msdn2.microsoft.com/en-us/library/ms190479.aspx for more info.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com

HELP: Text Field data type in SQL Server

I have a text field in a txt file.
It has multi-line.
Id like to copy / paste this text in a SQL Server table field.
I guess the field must be of a Text Data Type.
I tried it and it retains only the first line.
How can I paste that multimeline text from the SQL Server tools?
I tried from Management Studio but it does not work.
txs for your answer
In past I have used bulk insert to copy text file data into SQL server
text field. Are you specifying any delimiter or terminator for text
file?

HELP: Text Field data type in SQL Server

I have a text field in a txt file.
It has multi-line.
Id like to copy / paste this text in a SQL Server table field.
I guess the field must be of a Text Data Type.
I tried it and it retains only the first line.
How can I paste that multimeline text from the SQL Server tools?
I tried from Management Studio but it does not work.
txs for your answerIn past I have used bulk insert to copy text file data into SQL server
text field. Are you specifying any delimiter or terminator for text
file?

HELP: Text Field data type in SQL Server

I have a text field in a txt file.
It has multi-line.
Id like to copy / paste this text in a SQL Server table field.
I guess the field must be of a Text Data Type.
I tried it and it retains only the first line.
How can I paste that multimeline text from the SQL Server tools?
I tried from Management Studio but it does not work.
txs for your answerIn past I have used bulk insert to copy text file data into SQL server
text field. Are you specifying any delimiter or terminator for text
file?

Friday, February 24, 2012

HELP: How to avoid ridiculous system resource issues when connecting to a huge Excel file

Hi all,

I have a 400MB Excel file that I consume from another automated process (don't ask). I copy this file down locally to my server, and I am attempting to create an SSIS package that points to this file via a connection manager. My computer starts gobbling up massive amounts of memory (devenv.exe gets up to about 800MB or so, then drops back down to 100MB) even when I attempt to rename the connection in the connection managers tab.

I have set all BypassPrepare to TRUE and ValidateExternalMetadata properties to FALSE, and still it can take up to 3 to 6 minutes for BI Dev Studio to respond. My specs:

Intel Centrino Duo 2.00 GHz

2GB RAM

XP Pro SP2

There MUST be a way for me to work effectively on a file of this size. Please help! Thanks much for any assistance.

Sincerely,

Brian Pulliam

Ok, so it sounds like it wants to read the entire file, a nice feature, and probably unavoidable.

Personally I would be developing and testing against a smaller file that is easier to work with, and easier to manipulate for test cases. Then when the bulk of the dev is ready run a test with the real file.

You may think this is a big issue, and whilst it would be nicer if it behaved better, what if this was a SQL load, woud you expect to dev against a 100GB database? Whilst the metadata would be OK, the simple running of a test would be impractical, so I'd still go with smaller test data during development.

|||

Just one more idea to try...

If you are using "Excel Source" try to use "OLEDB Source" instead and specify Microsoft Jet 4.0 OLE DB Provider.

If you are using Excel 2007, you should use the new ACE provider.

Regards,

Yitzhak

|||

In case if you don't have MS Office 2007 installed on your machine,

here is the link to donwload the connectivity components:

2007 Office System Driver: Data Connectivity Components.

http://www.microsoft.com/downloads/details.aspx?FamilyID=7554F536-8C28-4598-9B72-EF94E038C891&displaylang=ja

Regards,

Yitzhak

|||

Thanks much for the reply Darren. I agree that a small subset of data would be great to test with. Actually I would dev against a 100GB database, although I would not pull all the data in my tests.

But your analogy to running a test on a 100GB DB is not very applicable. Firstly, I am not loading an entire DB. My Excel connection is pointing at one worksheet in an Excel 2003 file. And I have not even tried executing this package yet, I am nowhere near that far. Simply renaming the connection to the Excel file takes about 5 minutes before BI Developer Studio is responsive again. Also note that when connecting to a 100GB database, BI does not attempt to load the entire data set in that scenario. Maybe it has something to do with using an Excel file, that SSIS goes all paranoid and wants to look at the whole dang file.

Do you think if I set up a linked server to the Excel file in Management Studio that it might not have this problem? Maybe that would fake it into trusting the data source enough to not to the validation load. I attempted to do this on Friday but did not have much luck. Has anyone done this for an Excel 11.0 workbook?

Thanks again,

Brian

Sunday, February 19, 2012

HELP: Exporting for use in MySQL

Ok, anyone know anything about MySQL? The only way I see to use data within
tables for use in MySQL is to export as text file but I dont see a way to
import the data from the MySQL Console Manager.
Then my next consideration would be a query to create the tables and insert
it into te MySQL database.
Thoughts anyone?
"Matrix"
Vice President
Permian Basin Chapter
Bikers Against Child AbuseLots on MySQL here:
http://www.mysql.com/documentation/index.html
--
David Portas
--
Please reply only to the newsgroup
--
"Matrix" <matrix@.!nospam.visualsun.ws> wrote in message
news:vnjs143fb0q9a1@.corp.supernews.com...
> Ok, anyone know anything about MySQL? The only way I see to use data
within
> tables for use in MySQL is to export as text file but I dont see a way to
> import the data from the MySQL Console Manager.
> Then my next consideration would be a query to create the tables and
insert
> it into te MySQL database.
> Thoughts anyone?
> "Matrix"
> Vice President
> Permian Basin Chapter
> Bikers Against Child Abuse
>

HELP: Connecting to a secure file share using DTS

I have a dts package that works in connecting to a secure file share when I run it manually. When I schedule it to run on its own - it fails due to the lack of a log on. Is there something I can do to initiate the log in via the schedule rather than me manually doing it ?

Thank you!

When you run it manually, it's executing under your security context. When you schedule it, it will run under the security context of SQL Server Agent service account if the job is owned by a sysadmin. You need to grant the SQL Agent service account permissions to the share. The following article explains this issue:

INF: How to Run a DTS Package as a Scheduled Job

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

-Sue

Help: Can I restore a database only using the data file

Hi All,
Recenty, I met with a serious problem. For some unknown reason, the
log file of one of our database is missing, only the data file left.
Can I just use the data file of the database to restore the database?
Thanks.
Dobby
Ps: I use SQL Server 2000Try sp_attach_single_file_db. More information in BOL.
Dmitrij
"Dobby Cai" wrote:
> Hi All,
> Recenty, I met with a serious problem. For some unknown reason, the
> log file of one of our database is missing, only the data file left.
> Can I just use the data file of the database to restore the database?
> Thanks.
> Dobby
> Ps: I use SQL Server 2000
>|||Hi Dobby
Can you connect to the database? If so you can use sp_helpfile to see where
the log is.
If the database is not attached, then if this was SQL 2005 you could use
"FOR ATTACH_REBUILD_LOG" option of CREATE DATABASE but this is SQL 2000!
For SQL 2000 and SQL 2005 you can also use sp_attach_single_file_db
John
"Dobby Cai" wrote:
> Hi All,
> Recenty, I met with a serious problem. For some unknown reason, the
> log file of one of our database is missing, only the data file left.
> Can I just use the data file of the database to restore the database?
> Thanks.
> Dobby
> Ps: I use SQL Server 2000
>|||On Oct 4, 2:33 pm, Dmitrij Siemieniako
<DmitrijSiemieni...@.discussions.microsoft.com> wrote:
> Try sp_attach_single_file_db. More information in BOL.
> Dmitrij
> "Dobby Cai" wrote:
> > Hi All,
> > Recenty, I met with a serious problem. For some unknown reason, the
> > log file of one of our database is missing, only the data file left.
> > Can I just use the data file of the database to restore the database?
> > Thanks.
> > Dobby
> > Ps: I use SQL Server 2000
use sp_attach_single_file_db option to attach the datafile which will
automatically creates your log file.
EXEC sp_attach_single_file_db @.dbname = 'pubs',
@.physname = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data
\pubs.mdf'
Thanks
Vijayasekar|||On Oct 4, 7:40 pm, vijay <vjsek...@.gmail.com> wrote:
> On Oct 4, 2:33 pm, Dmitrij Siemieniako
> <DmitrijSiemieni...@.discussions.microsoft.com> wrote:
> > Try sp_attach_single_file_db. More information in BOL.
> > Dmitrij
> > "Dobby Cai" wrote:
> > > Hi All,
> > > Recenty, I met with a serious problem. For some unknown reason, the
> > > log file of one of our database is missing, only the data file left.
> > > Can I just use the data file of the database to restore the database?
> > > Thanks.
> > > Dobby
> > > Ps: I use SQL Server 2000
> use sp_attach_single_file_db option to attach the datafile which will
> automatically creates your log file.
> EXEC sp_attach_single_file_db @.dbname = 'pubs',
> @.physname = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data
> \pubs.mdf'
> Thanks
> Vijayasekar
Thanks you for all, I will try this method.

Help..Error connecting to SQL Server

Hi,

I am writing my first aspx file to connect to a standalone SQL Server which is separated from the IIS webserver. The code is

<HTML>
<HEAD>
<TITLE>Store Locator</TITLE>
<script runat="server">
Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs)
if Not IsPostBack Then
Dim DBConn as OleDbConnection
Dim DBCommand As OleDbDataAdapter
Dim DSPageData as New DataSet
DBConn = New OleDbConnection("Provider=sqloledb;" _
& "server=dailyplanet;" _
& "Initial Catalog=JAVSTORE;" _
& "User Id=javtrader;" _
& "Password=rage123;")
DBCommand = New OleDbDataAdapter _
("Select * " _
& "From JAVInventory " _
& "Where ID > ((Select COUNT(ID) " _
& "From JAVInventory ) - 100)" _
& "Order By ID DESC", DBConn)
DBCommand.Fill(DSPageData, _
"RecentJAVs")
' ddlZipCode.DataSource = _
' DSPageData.Tables("RecentJAVs").DefaultView
' ddlZipCode.DataBind()
End If
End Sub

I used Visual .Net and Web Matrix and was able to connect to the sql server with the Data Connection to view the tables. However, when I use IIS or the Visual .Net debugger to run the aspx file, it get the following error.. please help..

Server Error in '/javtrade' Application.
------------------------

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

Source Error:

Line 21: & "From JAVInventory ) - 100)" _
Line 22: & "Order By ID DESC", DBConn)
Line 23: DBCommand.Fill(DSPageData, _
Line 24: "RecentJAVs")
Line 25: ' ddlZipCode.DataSource = _

Source File: c:\inetpub\wwwroot\javtrade\management.aspx Line: 23

Stack Trace:

[OleDbException (0x80004005): [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
System.Data.OleDb.OleDbConnection.InitializeProvider()
System.Data.OleDb.OleDbConnection.Open()
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +36
ASP.management_aspx.Page_Load(Object Sender, EventArgs E) in c:\inetpub\wwwroot\javtrade\management.aspx:23
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731Two suggestions, one is to supply a 'server' name of localhost. The second is to make sure that the ASP.NET user has access to the SQL server.

Josh