Showing posts with label pulling. Show all posts
Showing posts with label pulling. Show all posts

Friday, March 9, 2012

Expression Unique ID lookup

I've got a report that is pulling timesheet information for specific teams.
The team name is OC_NAME and the unique ID is CODE_UID. The timesheet table
just has an entry for the team's Unique ID which I'm returning in a dataset.
Can I do a lookup in Reporting Services Expression to change the CODE_UID
field to the OC_NAME data?
CREATE TABLE [dbo].[MSP_OUTLINE_CODES](
[CODE_UID] [int] NULL,
[OC_NAME] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULLHello Colin,
No, you could not use the Expression to lookup it. You need to join the
table in the dataset.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi ,
How is everything going? Please feel free to let me know if you need any
assistance.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.

Friday, February 24, 2012

Exporting XML using bcp

I am exporting XML query results from a stored procedure using bcp. The query is pulling data from several tables and create XML using FOR XML EXPLICIT.

The following is the bcp command used to export the result:

bcp "exec sprocname" queryout output.xml -w -T

The resulting output file appears to limit the number of charcters per line to 2033 characters and cut the data into the next row regardless whether the 2033th character is in the middle of an xml tag. As a result the resulting xml output become unreadable.

Any suggestions would be much appreciated.

I hope you are using SQL2005. If so, just add ,TYPE at the end of your FOR XML query as

SELECT ...

FOR EXPLICIT, TYPE

Exporting XML using bcp

I am exporting XML query results from a stored procedure using bcp. The query is pulling data from several tables and create XML using FOR XML EXPLICIT.

The following is the bcp command used to export the result:

bcp "exec sprocname" queryout output.xml -w -T

The resulting output file appears to limit the number of charcters per line to 2033 characters and cut the data into the next row regardless whether the 2033th character is in the middle of an xml tag. As a result the resulting xml output become unreadable.

Any suggestions would be much appreciated.

I hope you are using SQL2005. If so, just add ,TYPE at the end of your FOR XML query as

SELECT ...

FOR EXPLICIT, TYPE