Showing posts with label text. Show all posts
Showing posts with label text. Show all posts

Thursday, March 29, 2012

Extract data in "Insert Into..." statement format

Is there a way in SQL Server 2000 to extract data from a table, such that
the result is a text file in the format of "Insert Into..." statements, i.e.
if the table has 5 rows, the result would be 5 lines of :

insert into Table ([field1], [field2], ... VALUES a,b,c)
insert into Table ([field1], [field2], ... VALUES d, e, f)
insert into Table ([field1], [field2], ... VALUES g, h, i)
insert into Table ([field1], [field2], ... VALUES j, k, l)
insert into Table ([field1], [field2], ... VALUES m, n, o)

Thanks in advanceVyas has just what you need:
http://vyaskn.tripod.com/code.htm#inserts

--
David Portas
SQL Server MVP
--|||INSERT INTO TABLE1(FIELD1,FIELD2)
SELECT ABC, XYZ from TABLE2 where bla bla

or

INSERT INTO TABLE1(A,B,C)
SELECT X,Y, 'some static text' FROM TABLE2

the number of columns must tally

Chad Richardson wrote:
> Is there a way in SQL Server 2000 to extract data from a table, such
that
> the result is a text file in the format of "Insert Into..."
statements, i.e.
> if the table has 5 rows, the result would be 5 lines of :
> insert into Table ([field1], [field2], ... VALUES a,b,c)
> insert into Table ([field1], [field2], ... VALUES d, e, f)
> insert into Table ([field1], [field2], ... VALUES g, h, i)
> insert into Table ([field1], [field2], ... VALUES j, k, l)
> insert into Table ([field1], [field2], ... VALUES m, n, o)
> Thanks in advance|||You can by creating a calculated column that does the insert format:

select 'insert into table (id, name, phone) values (' +
cast(id as varchar(10)) + ',' +
quotename(name,'''') + ',' +
quotename(phone,'''') + ')'
from namelist

results:
insert into table (id, name, phone) values (1, 'James', 'Smith')
insert into table (id, name, phone) values (2, 'John', 'O''Kieth')

--
David Rowland
For a good User and Performance monitor, try DBMonitor
http://dbmonitor.tripod.com|||You can by creating a calculated column that does the insert format:

select 'insert into table (id, name, phone) values (' +
cast(id as varchar(10)) + ',' +
quotename(name,'''') + ',' +
quotename(phone,'''') + ')'
from namelist

results:
insert into table (id, name, phone) values (1, 'James', 'Smith')
insert into table (id, name, phone) values (2, 'John', 'O''Kieth')

--
David Rowland
For a good User and Performance monitor, try DBMonitor
http://dbmonitor.tripod.com|||Thanks all for the responses!

"Chad Richardson" <chad@.NIXSPAM_chadrichardson.com> wrote in message
news:1102ir7m0udi5cc@.corp.supernews.com...
> Is there a way in SQL Server 2000 to extract data from a table, such that
> the result is a text file in the format of "Insert Into..." statements,
> i.e. if the table has 5 rows, the result would be 5 lines of :
> insert into Table ([field1], [field2], ... VALUES a,b,c)
> insert into Table ([field1], [field2], ... VALUES d, e, f)
> insert into Table ([field1], [field2], ... VALUES g, h, i)
> insert into Table ([field1], [field2], ... VALUES j, k, l)
> insert into Table ([field1], [field2], ... VALUES m, n, o)
> Thanks in advance

Extract color formatted text from code editor?

Is it possible to get the text from the code editor into another app like MS
Word while retaining the font color coding?
txThis is what happens when you select code from Management Studio's query
editor and paste into Word. I don't think there is any magic for doing this
from Query Analyzer (the color coding is not part of what is transfered to
the clipboard).
"Tadwick" <Tadwick@.discussions.microsoft.com> wrote in message
news:A8A6DC13-2258-4995-A493-F49F151F88D9@.microsoft.com...
> Is it possible to get the text from the code editor into another app like
> MS
> Word while retaining the font color coding?
> tx|||Thanks, Aaron. It's kind of brute force. I have been using ADO and catalog
views to extract meta data and then try to mimic the default color coding in
MS Word but it is a challenge of a different kind.
"Aaron Bertrand [SQL Server MVP]" wrote:

> This is what happens when you select code from Management Studio's query
> editor and paste into Word. I don't think there is any magic for doing th
is
> from Query Analyzer (the color coding is not part of what is transfered to
> the clipboard).
>
>
>
> "Tadwick" <Tadwick@.discussions.microsoft.com> wrote in message
> news:A8A6DC13-2258-4995-A493-F49F151F88D9@.microsoft.com...
>
>sql

Extract color formatted text from code editor?

Is it possible to get the text from the code editor into another app like MS
Word while retaining the font color coding?
tx
This is what happens when you select code from Management Studio's query
editor and paste into Word. I don't think there is any magic for doing this
from Query Analyzer (the color coding is not part of what is transfered to
the clipboard).
"Tadwick" <Tadwick@.discussions.microsoft.com> wrote in message
news:A8A6DC13-2258-4995-A493-F49F151F88D9@.microsoft.com...
> Is it possible to get the text from the code editor into another app like
> MS
> Word while retaining the font color coding?
> tx
|||Thanks, Aaron. It's kind of brute force. I have been using ADO and catalog
views to extract meta data and then try to mimic the default color coding in
MS Word but it is a challenge of a different kind.
"Aaron Bertrand [SQL Server MVP]" wrote:

> This is what happens when you select code from Management Studio's query
> editor and paste into Word. I don't think there is any magic for doing this
> from Query Analyzer (the color coding is not part of what is transfered to
> the clipboard).
>
>
>
> "Tadwick" <Tadwick@.discussions.microsoft.com> wrote in message
> news:A8A6DC13-2258-4995-A493-F49F151F88D9@.microsoft.com...
>
>

Extract a character string from a text field

I need to extract a character string from a text field. The string I'm
looking for will always start with the first four characters of "ABC-" and
then will end with three numbers (0-9) in varying combinations, ex.
"ABC-508". The problem is that the position of the string in the text field
is different in each record and the last three characters of the string will
vary as described above. Any help is greatly appreciated
--
Finn GirlOne method:
SELECT
CASE
WHEN PATINDEX('%ABC-[0-9][0-9][0-9]%', MyTextCol) = 0 THEN
NULL
ELSE
SUBSTRING(MyTextCol, PATINDEX('%ABC-[0-9][0-9][0-9]%',
MyTextCol), 7)
END AS ExtractedValue
FROM dbo.MyTable
You can encapsulate the code in a proc or function for reusability.
Hope this helps.
Dan Guzman
SQL Server MVP
"FinnGirl" <FinnGirl@.discussions.microsoft.com> wrote in message
news:576F175D-855C-424F-A8D7-80E4A5B110CE@.microsoft.com...
>I need to extract a character string from a text field. The string I'm
> looking for will always start with the first four characters of "ABC-" and
> then will end with three numbers (0-9) in varying combinations, ex.
> "ABC-508". The problem is that the position of the string in the text
> field
> is different in each record and the last three characters of the string
> will
> vary as described above. Any help is greatly appreciated
> --
> Finn Girl|||create table #foo (SomeColumn varchar(50))
insert into #foo values ('test ABC-508')
insert into #foo values ('testing ABC-509')
insert into #foo values ('ABC-123')
insert into #foo values ('FinnGirlABC-524')
insert into #foo values ('abcABC-456')
select * from #foo
--this shows you the charindex
SELECT CHARINDEX('ABC-', SomeColumn) FROM #foo
--this gets the desired information:
SELECT SUBSTRING(SomeColumn, (CHARINDEX('ABC-', SomeColumn)), 7) FROM #foo
drop table #foo
Keith Kratochvil
"FinnGirl" <FinnGirl@.discussions.microsoft.com> wrote in message
news:576F175D-855C-424F-A8D7-80E4A5B110CE@.microsoft.com...
>I need to extract a character string from a text field. The string I'm
> looking for will always start with the first four characters of "ABC-" and
> then will end with three numbers (0-9) in varying combinations, ex.
> "ABC-508". The problem is that the position of the string in the text
> field
> is different in each record and the last three characters of the string
> will
> vary as described above. Any help is greatly appreciated
> --
> Finn Girl

Tuesday, March 27, 2012

Extra Blank Page at end of Report

I have a crystal report and it is printing an extra blank page at the end. I have the detail ruler coming right up to the end of the text and I have surpressed the report header and footer. Any idea?In the section expert window, check if the 'New page after' options is checked for any of the sections.

If so, try this:
click on the X+2 button to the right of it and enter the following formula
Not OnLastRecord|||Thanks! In the Page Footer Section Expert, it is checked, but is greyed out so I can't uncheck it or alter it (see attached shot). Do you know how to un-grey it out?

Thanks,
Michael|||:) No, this is not the case...

Sorry, I didn't mention but I meant Detail, GH, GF sections, for which you would be able to uncheck the 'New Page after' option.
How about the 'New Page before' for the RF section? Is it checked?|||Yes...but it is greyed out like the page footer :(|||...'New Page Before' for the RF ?

Check this, may be you will find it useful:

http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=http--supportbusinessobjectscom-communityCS-TechnicalPapersNoNav-crremoveblankspdfasp&sliceId=&dialogID=4246102&stateId=1%200%204244224

Actually, your situation is strange for me: you have no groups in the report just Details...

Monday, March 26, 2012

External scripts / imports / updates

Looking for suggestions on this one. What I want to do have have a text file that may have any number of rows and cols (with a predefined format) that a user can update or insert into a table. The definition of the row/cols and data mapping etc, has been done, it is the mechanics of actually doing the below I would appreciate help and advice on.

As the user is an 'end-user' (and has no SQL knowledge at all) the text file to import from will be placed in a predefined location and then a small script will be executed from their PC (as it happens, it's a Mac that runs an app that can exec an SQL command on the currently open database) that will in turn run a stored proc which is then reads in (imports or updates) the appropriate tables witht he contents of the external text file.

Sorry the explanation is a bit long winded but if anyone had any practical suggestions and examples, it would be greatly appreciated.

FYI, they are running SQL 2000 on both XP Pro and W2K3 server.

Thanks
StarbYou can take help of DTS package and schedule to run or give rights to the user to execute in order to import/export the data required.

Also can achieve with ISQL/OSQL utility, refer to books online for more information.|||You can take help of DTS package and schedule to run or give rights to the user to execute in order to import/export the data required.

Also can achieve with ISQL/OSQL utility, refer to books online for more information.
Thanks. Dont want to use a third party tool (OSQL etc) and can't use such as DTS and Exec as it is the 'End User' that will use the funtion. It must be run via a simple script from the Mac app.

Cheers
Starbsql

Friday, March 23, 2012

Extending the CSV Export to add Text Padding etc.

Hi All,
I am looking at using are report to generate an export file that is similar
to the CSV export...
I need to be able to the text length of the columns and remove the ","
between columns eg:
CSV
Angus,Logan,Data#3
REQUIRED EXPORT
Angus Logan Data#3
text+pad to 10 (add 5 spaces) text+pad to 10 (add 5 spaces) text+pad to 10
(add 4 spaces)
I am thinking about programatically downloading the CSV (or Xml) and parsing
them into the right format but thought there may be an easier solution...
Any Ideas?
Regards
Angus Logan
MCDBA / MCADYou can use the PadRight() method to add the spaces and then use the CSV
renderering extension and set the deviceInfo named FieldDelimiter to
emptystring. You will have to use URL Access or the SOAP API.
--
Brian Welcker
Group Program Manager
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Angus Logan" <angus_logan@.data3.com.au> wrote in message
news:ePRIhZnYEHA.556@.tk2msftngp13.phx.gbl...
> Hi All,
> I am looking at using are report to generate an export file that is
> similar
> to the CSV export...
> I need to be able to the text length of the columns and remove the ","
> between columns eg:
> CSV
> Angus,Logan,Data#3
> REQUIRED EXPORT
> Angus Logan Data#3
> text+pad to 10 (add 5 spaces) text+pad to 10 (add 5 spaces) text+pad to
> 10
> (add 4 spaces)
> I am thinking about programatically downloading the CSV (or Xml) and
> parsing
> them into the right format but thought there may be an easier solution...
> Any Ideas?
> Regards
> Angus Logan
> MCDBA / MCAD
>

Monday, March 19, 2012

Extended Stored Procedure

Good morning,
We are porting a legacy VB6 user interface application that stores data in
binary text files to SQL Server 2000 and C#.
The VB6 user interface hooks into backend C/C++ dll's to pass VB6 "Type"
data into the C code that writes to the binary files.
We have to preserve this strategy of writing data to binary files because a
massive C dll library uses them to analyze the data.
What I would like to do is store the data in a normalized SQL database and
then use Extended Stored Procedures (ESP) to hook into the C functions that
write the binary files.
This would require selecting a row of data from a SQL table and then passing
it to the ESP C function in a way that mimics the VB6 Type datatype. Really
the C is looking for a pointer to the beginning of the Type data.
Any thoughts/advice greatly appreciated!
Thank you
jmattSQL Server is not an application development tool. Processing data one row
at a time and calling C functions would be best implemented on the
application side rather than from the database.
"jmatt" <jmatt@.discussions.microsoft.com> wrote in message
news:8E82603C-AA1F-462A-AEA4-7EDC103E5F45@.microsoft.com...
> Good morning,
> We are porting a legacy VB6 user interface application that stores data in
> binary text files to SQL Server 2000 and C#.
> The VB6 user interface hooks into backend C/C++ dll's to pass VB6 "Type"
> data into the C code that writes to the binary files.
> We have to preserve this strategy of writing data to binary files because
> a
> massive C dll library uses them to analyze the data.
> What I would like to do is store the data in a normalized SQL database and
> then use Extended Stored Procedures (ESP) to hook into the C functions
> that
> write the binary files.
> This would require selecting a row of data from a SQL table and then
> passing
> it to the ESP C function in a way that mimics the VB6 Type datatype.
> Really
> the C is looking for a pointer to the beginning of the Type data.
> Any thoughts/advice greatly appreciated!
>
> Thank you
> jmatt|||I understand your point. It just seems so direct and efficient to go from
table to file.
Thanks!
jmatt
"JT" wrote:

> SQL Server is not an application development tool. Processing data one row
> at a time and calling C functions would be best implemented on the
> application side rather than from the database.
> "jmatt" <jmatt@.discussions.microsoft.com> wrote in message
> news:8E82603C-AA1F-462A-AEA4-7EDC103E5F45@.microsoft.com...
>
>|||> SQL Server is not an application development tool.
Not sure I totally agree with that. SQL2005 is great application server
environment. The lines are not dark any more, they are shades of grey.
This kind of thing would be ~easy to do in sql2005 clr.
William|||William,
Any ideas on how I would pass data to the C function as a parameter in ESP
so that it would mimic VB6 Type data? Would the result of a simple SELECT b
e
a start?
jmatt
"William Stacey [MVP]" wrote:

> Not sure I totally agree with that. SQL2005 is great application server
> environment. The lines are not dark any more, they are shades of grey.
> This kind of thing would be ~easy to do in sql2005 clr.
> --
> William
>
>|||You have SQL2005? If not, then I can't help.
If so, I would rewrite the function in C# and just call from a SqlUDF then
you can use the power of .Net and IO classes.
You could probably also call c dll from SqlUDF like you would call a win32
function, by defining it first.
William Stacey [MVP]
"jmatt" <jmatt@.discussions.microsoft.com> wrote in message
news:371399B9-B337-4F6F-AECD-89CFBB626DA0@.microsoft.com...
> William,
> Any ideas on how I would pass data to the C function as a parameter in ESP
> so that it would mimic VB6 Type data? Would the result of a simple SELECT
> be
> a start?
> jmatt
> "William Stacey [MVP]" wrote:
>

Monday, March 12, 2012

Extended Procedure

Does anyone know any undocumented extended procedures that can red SQL
scripts from a text file and execute it. The SQL scripts contain multiple
batches (contain key word 'GO', which will not be recognized by the regular
EXECUTE statement).
Thanks,
LijunHave a look at oSql in BooksOnLine.
Andrew J. Kelly SQL MVP
"Lijun Zhang" <nospam@.nospam.nospam> wrote in message
news:OHF8MBgYFHA.3040@.TK2MSFTNGP14.phx.gbl...
> Does anyone know any undocumented extended procedures that can red SQL
> scripts from a text file and execute it. The SQL scripts contain multiple
> batches (contain key word 'GO', which will not be recognized by the
> regular
> EXECUTE statement).
> Thanks,
> Lijun
>

Extended Procedure

Does anyone know any undocumented extended procedures that can red SQL
scripts from a text file and execute it. The SQL scripts contain multiple
batches (contain key word 'GO', which will not be recognized by the regular
EXECUTE statement).
Thanks,
Lijun
Have a look at oSql in BooksOnLine.
Andrew J. Kelly SQL MVP
"Lijun Zhang" <nospam@.nospam.nospam> wrote in message
news:OHF8MBgYFHA.3040@.TK2MSFTNGP14.phx.gbl...
> Does anyone know any undocumented extended procedures that can red SQL
> scripts from a text file and execute it. The SQL scripts contain multiple
> batches (contain key word 'GO', which will not be recognized by the
> regular
> EXECUTE statement).
> Thanks,
> Lijun
>

Extended Procedure

Does anyone know any undocumented extended procedures that can red SQL
scripts from a text file and execute it. The SQL scripts contain multiple
batches (contain key word 'GO', which will not be recognized by the regular
EXECUTE statement).
Thanks,
LijunHave a look at oSql in BooksOnLine.
--
Andrew J. Kelly SQL MVP
"Lijun Zhang" <nospam@.nospam.nospam> wrote in message
news:OHF8MBgYFHA.3040@.TK2MSFTNGP14.phx.gbl...
> Does anyone know any undocumented extended procedures that can red SQL
> scripts from a text file and execute it. The SQL scripts contain multiple
> batches (contain key word 'GO', which will not be recognized by the
> regular
> EXECUTE statement).
> Thanks,
> Lijun
>

Expressions not evaluating values?

Hi,

I use an expression in a column text box to dynamically compute the column title.

The problem must have something linked to the way expressions generally works. I do not understand it clearly.

In this example, I use a SWITCH function to test the numerical value of a 1 row 1 column dataset.

The problem is that I can test the number only if it is lower or equal to the number in the dataset. if I test a number greater than the number in the dataset, I get an error.

How can I get this test to work if the value tested is greater than the value in the dataset?

Thanks

Philippe

Bellow is the code.

-

=switch(

First(Fields!HeaderCount.Value, "HeadersCount") < 2

, nothing

, First(Fields!HeaderCount.Value, "HeadersCount") = 2

, Right(Parameters!Headers.Value, Len(Parameters!Headers.Value) - Parameters!Headers.Value.IndexOf(",2,")-3)

, First(Fields!HeaderCount.Value, "HeadersCount") > 2

, Parameters!Headers.Value.Substring(

Parameters!Headers.Value.IndexOf(",2,")+3

, Parameters!Headers.Value.IndexOf(",3,")-Parameters!Headers.Value.IndexOf(",2,")-3

)

)

Philippe wrote:

is that I can test the number only if it is lower or equal to the number in the dataset. if I test a number greater than the number in the dataset, I get an error.

Note, If the dataset contains 2, the expression will return an error because I try to test >2 in the last case.
if the dataset contains 3 or greater, it works fine.

it is clearly the test which fails because if I replace the action by a fixed string it still return an error.

|||

You are using the switch() function. Since it is a function, all arguments are evaluated before the switch functionality is executed.

I recommend to write a custom code function that uses the VB switch statement and call the custom code function from the expression.

-- Robert

|||

Hi,

I have made some research on the Custom Code however I could not find documentation nor examples that show how to use parameters or dataset values within the custom code. If I create a function like this How can I access the report items?

Public Function Headers(ByVal Column as Integer) As String
Return CStr(Microsoft.VisualBasic.Switch( _
First(Fields!HeaderCount.Value, "HeadersCount") < Column _
, nothing _
, First(Fields!HeaderCount.Value, "HeadersCount") = Column _
, Right(Parameters!Headers.Value, Len(Parameters!Headers.Value) - Parameters!Headers.Value.IndexOf(",Column,")-3) _
, First(Fields!HeaderCount.Value, "HeadersCount") > Column _
, Parameters!Headers.Value.Substring( _
Parameters!Headers.Value.IndexOf(",Column,")+3 _
, Parameters!Headers.Value.IndexOf(",Column + 1,")-Parameters!Headers.Value.IndexOf(",Column,")-3 _
) _
) _
)
End Function

I did find a much simpler solution though.

The string I use contains a variable number of names separated by indexes, i.e.

,1,Charles,2,Tom,3,Laura,4,Rick

I have a report with a fixed number of columns, i.e 50 columns and I populate the columns title by pulling from the string, i.e. Column 3 title will be Laura.

I have converted the string so each name will have trailing spaces. Since now each item has the same lenght, I do not need anymore the switch, I can do simply this in each column with just another index number. Then I use an expression to control the visibility of the column.

Title

=Parameters!Headers.Value.Substring(Parameters!Headers.Value.IndexOf(",3,")+3, 85)

Visibility

=iif(First(Fields!HeaderCount.Value, "HeadersCount")<3,True,False)

If I spend the time to build this instead of using the Matrix report, it is because the Matrix report has 2 majors issues for me.

1) You cannot have column titles for your categories

2) You cannot have the categories values repeated

Because of the strict format requirement I have, I am obliged to use the PIVOT SQL operator and the dynamic column population. My users want a pivoted flat file they can put in Excel and build a pivot table with it. You cannot do that with a matrix report, too bad. That would be so much easy.

Philippe

Friday, March 9, 2012

Expression to Parameter

I would like my header text not to be hard coded

I took a very big table which include texts i need from my DB to DS

How can i pick a single row with single data in it to be bind

to my Paramter ?

Could you explain this in more detail ?

HTH, jens Suessmeyer.

http://www.sqlserver2005.de

Wednesday, March 7, 2012

Expression editor (sort of) bug

I've noticed in the expression editor that pasting rich text (like copied
from a web page) preserves the formatting. This makes stuff look really
screwed up in the expression editor. I noticed this copying stuff from this
newsgroup and pasting it into the expression editor.I believe the formatting goes away after you commit it. But be careful
about extra carriage returns/line feeds. They can mess up the code.
--
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"Stefan Wrobel" <StefanWrobel@.discussions.microsoft.com> wrote in message
news:8C6BE014-DC4D-400B-9CA6-CBDDFC99B16E@.microsoft.com...
> I've noticed in the expression editor that pasting rich text (like copied
> from a web page) preserves the formatting. This makes stuff look really
> screwed up in the expression editor. I noticed this copying stuff from
> this
> newsgroup and pasting it into the expression editor.

Sunday, February 19, 2012

Exporting to Plain Text

Has anyone found a way to export a report to plain text? I need to be able to
do this automatically when the report is run via a schedule on the server.
Help!
RickYou need to have a custom rendering solution. This link is quite interesting
about custom rendering.
http://msdn.microsoft.com/msdnmag/issues/05/02/CustomRenderers/
Amarnath
"RLS" wrote:
> Has anyone found a way to export a report to plain text? I need to be able to
> do this automatically when the report is run via a schedule on the server.
> Help!
> Rick

Friday, February 17, 2012

exporting to CSV

I have a need to run an export of fields from a table into a CSV text file located on my e:\exports. Is there a simple way to do this?

Hi jim,

Why cant you use DTS service to transfer the tables datas into CSV file ?

|||

use the following query...

master..xp_cmdshell 'bcp "select * from master..sysobjects" queryout e:\exports\exported.csv -SMYSERVER -UMyUserName -pMyPassword -c -t "," -r "\n"'

|||thanks I will do!

Exporting text files

Hi,
Is there any way to export .rpt files as text files. I am using crystal reports 9.0 and .Net framework..
I want to export them dynamically in the code.
I could able to export to pdf,doc and html..But not to text.
Thanks,
RameshYou have to include the right dlls in order for the export to work. I use Crystal Reports Version 8.5 and there's a list of the required files in a file called runtime.hlp. (The file may be called something different with other versions of Crystal)

There are 2 types of dlls to include when you want to export: Export Destinations (Application, Disk, MAPI, Lotus Domino, etc... ) and Export Formats (HTML, pdf, doc, text, etc... ). In order to be able to export to text, I had to include U2FTEXT.DLL (from the Export Formats, this dll exports to text format) and U2DDISK.DLL (from the Export Destinations, this dll exports to disk instead of application). I couldn't get it to work if I just included the file to output to application.

Just remember that this is for CR 8.5 and VB 6, so you may or may not be able to use it, but I hope it helps anyway!|||I want to export multiple crystal reports in one file.. i.e. only one text file / pdf file or any other format... in short i want to merge the reports.
can anyone help me in that.. ?|||Hi! i too face the same prob but the differance if i want to export multipal subreport with main report in one pdf file.
Any one who can help me out plz plz do reply its urgent.
Thanks in advance|||aj_patil: When you export the main report, the subreports will be exported with it. No need to do anything else.

dhmshah: Perhaps you can set each of your reports as subreports in one main report. Other than that, I'm not sure if multiple reports can be exported into 1 file.

Also, if you have a new question, you should post it in a new thread instead of onto an old thread. That way, other people who have the same question as you can find the answer easier.|||aj_patil: When you export the main report, the subreports will be exported with it. No need to do anything else.

dhmshah: Perhaps you can set each of your reports as subreports in one main report. Other than that, I'm not sure if multiple reports can be exported into 1 file.

Also, if you have a new question, you should post it in a new thread instead of onto an old thread. That way, other people who have the same question as you can find the answer easier.

Thanks for the advice but i hv tried, any way if u get any link hear after do write to me.|||I want to export multiple crystal reports in one file.. i.e. only one text file / pdf file or any other format... in short i want to merge the reports.
can anyone help me in that.. ?

thanks for the advice. but if u get any infomation related do write- aj

Exporting text file and populate it as table using SQL

Hi,
I have a problem, I have some text files in the server. I have to export that file and read it line by line and then cut it into fields and populate it as a table in SQl with SQL commnads.

Could you anybody help mw with some hints, any relevent readings etc..
How can i use sql framework for thisIf you have control over how the text files can look like, I would recommend using the FOR XML and XML Shredding mechanisms (OpenXML, nodes() method).

Otherwise in SQL 2005, I would look into CLR user-defined functions to write the parsing code in your fav .Net language.

In SQL 2000, you would have to do it in TSQL or the mid-tier.

Also, if the data is not yet in the database but in a file, you can look into OpenRowset(BULK) in SQL Server 2005. Otherwise you need to read it in the mid-tier...

Exporting TEXT Field into CSV file

I have a record set I have to export on a weekly basis into a CSV file for a customer/client. One of the fields being included in the export is a TEXT field. When I export this field, the CSV file is truncating the record significantly.

Is there a way I can get the export to pass all the data in the TEXT field, or is this a limitation on the data transformation, or is it a limitation on the CSV file (because of the size/nature of the TEXT field).After taking a break, I tinkered around some more and got this to work with the DTS. Apparently a different result occurs if I use the DTS to save the TEXT field, as opposed to using the Query Analyzer and saving the results (which I was using for testing).

Wednesday, February 15, 2012

exporting SQL tables

Hello:
I am familiar with SQL 2000's Export wizard in terms of exporting data to a
csv or a text file.
Is there any way to export more than one table at a time, though, other than
through something like BCP?
Let's say that you were to use BCP, to export more than one table at a time.
In SQL 2000, when you use BCP to export one or more tables, how would you
get the column headers to show in the exported file?
childofthe1980sHi
If you just want the data then you would not need column headers!
See if http://www.sqldts.com/299.aspx does what you want!
John
"childofthe1980s" wrote:

> Hello:
> I am familiar with SQL 2000's Export wizard in terms of exporting data to
a
> csv or a text file.
> Is there any way to export more than one table at a time, though, other th
an
> through something like BCP?
> Let's say that you were to use BCP, to export more than one table at a tim
e.
> In SQL 2000, when you use BCP to export one or more tables, how would you
> get the column headers to show in the exported file?
> childofthe1980s