Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

INSERT INTO OPENROWSET Expand / Collapse
Author
Message
Posted Wednesday, November 26, 2008 1:42 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Friday, December 12, 2014 12:44 AM
Points: 1,696, Visits: 2,139
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
Post #608895
Posted Thursday, December 11, 2008 1:26 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Friday, December 12, 2014 12:44 AM
Points: 1,696, Visits: 2,139
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
Post #617661
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse