Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


INSERT INTO OPENROWSET


INSERT INTO OPENROWSET

Author
Message
Ian_McCann
Ian_McCann
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1872 Visits: 2282
I am running the following

INSERT INTO OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\cm_mssql_2005_profiling\Reports\Template.xls;',
'SELECT TSQLString, Duration,Reads,Writes,CPU ,RowCounts,StartTime,EndTime,ServerName
FROM [Top_10_by_Reads$]')
select top 10 TSQLString, duration/1000 as Duration, reads, writes, cpu, rowcounts, starttime, endtime,servername
from cm_mssql_2005_TRC
where textdata is not null
order by Reads desc
GO

and relieving the following error

Msg 8152, Level 16, State 10, Line 1
String or binary data would be truncated.
The statement has been terminated.

The offending column is TSQLString - VARCHAR(max)

The data does fit, I can cut & paste it.
( I'm using SQL 2005, SSIS & export wizards are not options available to me)

Thanks in Advance
Ian
Ian_McCann
Ian_McCann
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1872 Visits: 2282
Well it is not the most elegant solution I have ever come up with but it is working.

As I said I can cut and paste the data to the cell in excel, and that is what I have done.
By placing a record into row 2, setting the row properties to hidden and placing it above the frozen pane my report readers can not see the record

and the above TSQL works providing me with the body of my report.

If you know how this should be done, please share it with me.

Thanks
Ian
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search