Showing posts with label doc. Show all posts
Showing posts with label doc. Show all posts

Friday, March 30, 2012

Importing word doc into ms sql server2005 database

Could some1 pls help me, how do I import a word doc into a sql server database, and it mus t be displayed in a panel

I need to know how to do it, step by step

Thanx to all that helpWink

The best way that I know of is to export the Word document as HTML and load that into a VARCHAR(MAX) column.

Monday, March 26, 2012

importing sql2005 database diagram to word doc

Hi I have a large database diagram and am only displaying the table names and
relationships. When I copy the diagram to the clipboard and paste it to a
word doc the diagram is hard to read because the letering on each table
appears quite small. I tried changing the zoom within management studio
prior to the copy but it has no effect. Any ideas or is there a specific
method of exporting the image other than just copy to clipboard and paste?
thanks.
--
Paul G
Software engineer.If you take a big diagram and squeeze it into a small space, I don't
know how to avoid the text getting small. I know that when I wanted
to print a diagram to a single page the approach I took was to expand
it to 200%, copy it, then past it into Irfanview and print from there.
I could also save it from there as a jpeg. I suppose you could try
that, and then see if placing the jpeg into the Word document works
any better, but I would not hold out much hope.
Roy Harvey
Beacon Falls, CT
On Fri, 25 Apr 2008 09:46:00 -0700, Paul
<Paul@.discussions.microsoft.com> wrote:
>Hi I have a large database diagram and am only displaying the table names and
>relationships. When I copy the diagram to the clipboard and paste it to a
>word doc the diagram is hard to read because the letering on each table
>appears quite small. I tried changing the zoom within management studio
>prior to the copy but it has no effect. Any ideas or is there a specific
>method of exporting the image other than just copy to clipboard and paste?
>thanks.|||thanks for the information. I ended up just using the table names to gain
some space and was able to move the objects around (closer together) within
SQL Server Management Studio. Have not heard of Irfenview, might have to
check it out.!
--
Paul G
Software engineer.
"Roy Harvey (SQL Server MVP)" wrote:
> If you take a big diagram and squeeze it into a small space, I don't
> know how to avoid the text getting small. I know that when I wanted
> to print a diagram to a single page the approach I took was to expand
> it to 200%, copy it, then past it into Irfanview and print from there.
> I could also save it from there as a jpeg. I suppose you could try
> that, and then see if placing the jpeg into the Word document works
> any better, but I would not hold out much hope.
> Roy Harvey
> Beacon Falls, CT
> On Fri, 25 Apr 2008 09:46:00 -0700, Paul
> <Paul@.discussions.microsoft.com> wrote:
> >Hi I have a large database diagram and am only displaying the table names and
> >relationships. When I copy the diagram to the clipboard and paste it to a
> >word doc the diagram is hard to read because the letering on each table
> >appears quite small. I tried changing the zoom within management studio
> >prior to the copy but it has no effect. Any ideas or is there a specific
> >method of exporting the image other than just copy to clipboard and paste?
> >thanks.
>|||On Fri, 25 Apr 2008 14:00:00 -0700, Paul
<Paul@.discussions.microsoft.com> wrote:
>Have not heard of Irfenview, might have to
>check it out.!
Irfanview is a free utility for viewing image files, but it also has
some manipulation ability such as changing resolution. A great
utility, but nothing unique.
Roy Harvey
Beacon Falls, CT

Sunday, February 19, 2012

Importing a XML doc into relational tables.

HELP! This is driving me mad...
Greetings all.
I am trying to import XML into SQL.
I have the following ingredients:
1 X xml document with 2 levels. Parent > child
1 X xml source object
2 X tables in SQL.
The XML doc is quite simple. Parent element (PLU) and a child element
(DESC)
The SQL tables are PLU (PLU_Code) and PLU_Child (PLU_Code, DESC)
(PLU_Code is a FK.
When setting up the xml, it gives me two outputs (Auto created the xsd)
PLU and DESC.
PLU has PLU_Code and PLU_Id
DESC as PLU_Id and DESC.
As per MS, the _Id field is used to retain the relationship. Fine.
I can populate the main table (PLU) fine. I cannot populate the child
table because of the FK.
If MS provides the PLU_Id, how do I use it?
I do not want to use a lookup (Can't because on the child I do not
have a PLU_Code field).
Any guidance?
Cheers,
CrispinYou have to use the @.mp:id and @.mp:parentid meta-properties to JOIN the
results and get the Parent Key. The problem is you have to use temp tables
due to technological limitations. So it gives something like this:
SELECT * into #ParentTable
FROM OPENXML(@.hDOC, 'ParentNode', flag)
WITH (ParentKey, xmlID int '@.mp:id')
SELECT * into #ChildTable
FROM OPENXML(@.hDOC, 'ChildNode', flag)
WITH (someChildFields ..., xmlParentID int '@.mp:parentid')
Then JOIN the temp tables and INSERT:
INSERT INTO childTable (ParentKey, someChildFields)
SELECT ParentKey, someChildFields
FROM #ParentTable T1 INNER JOIN #ChildTable T2 ON
(T1.xmlID = T2.xmlParentID)
Have fun
"crispin.proctor@.gmail.com" wrote:

> HELP! This is driving me mad...
>
> Greetings all.
>
> I am trying to import XML into SQL.
> I have the following ingredients:
> 1 X xml document with 2 levels. Parent > child
> 1 X xml source object
> 2 X tables in SQL.
>
> The XML doc is quite simple. Parent element (PLU) and a child element
> (DESC)
> The SQL tables are PLU (PLU_Code) and PLU_Child (PLU_Code, DESC)
> (PLU_Code is a FK.
>
> When setting up the xml, it gives me two outputs (Auto created the xsd)
> PLU and DESC.
> PLU has PLU_Code and PLU_Id
> DESC as PLU_Id and DESC.
>
> As per MS, the _Id field is used to retain the relationship. Fine.
>
> I can populate the main table (PLU) fine. I cannot populate the child
> table because of the FK.
>
> If MS provides the PLU_Id, how do I use it?
>
> I do not want to use a lookup (Can't because on the child I do not
> have a PLU_Code field).
>
> Any guidance?
>
> Cheers,
> Crispin
>|||Fleo,
This is the way I could get around it but this method detracts from the
new SSIS pipeline method and would be rather slow.
I could have very large documents which I now have to do the following:
1) Load each level into temp tables.
2) Join the temp tables together using the ID's created.
3) Load them into their final resting place. (This cannot be done in
step two as the keys are not unique)
Within that process, I have to do many lookups etc and find all this
would be rather slow.
Could they not be loaded into datasets and manipulated from there on?
I am busy with that but keep getting an error saying "You cannot add an
output column to the output collection" ('?)
Cheers,
Crispin|||Hi,
Sorry I have no idea, I am fairly new to this. I am trying to do about the
same thing.
Anyone with ideas? Would .xsd schema with annotations help here?
"crispin.proctor@.gmail.com" wrote:

> Fleo,
> This is the way I could get around it but this method detracts from the
> new SSIS pipeline method and would be rather slow.
> I could have very large documents which I now have to do the following:
> 1) Load each level into temp tables.
> 2) Join the temp tables together using the ID's created.
> 3) Load them into their final resting place. (This cannot be done in
> step two as the keys are not unique)
> Within that process, I have to do many lookups etc and find all this
> would be rather slow.
> Could they not be loaded into datasets and manipulated from there on?
> I am busy with that but keep getting an error saying "You cannot add an
> output column to the output collection" ('?)
>
> Cheers,
> Crispin
>