| Author |
Topic  |
|
Van
Constraint Violating Yak Guru
456 Posts |
Posted - 09/25/2007 : 14:03:38
|
| So if you run that to create your SP you are getting an error then? |
 |
|
|
tkizer
Almighty SQL Goddess
USA
35007 Posts |
Posted - 09/25/2007 : 14:05:24
|
You shouldn't have a GO in the middle of your code. Only put the GO at the very end of your stored procedure.
If you are planning to use a real temp table, then you need to specify #.
Tara Kizer Microsoft MVP for Windows Server System - SQL Server http://weblogs.sqlteam.com/tarad/ |
 |
|
|
Van
Constraint Violating Yak Guru
456 Posts |
Posted - 09/25/2007 : 14:06:05
|
| Good catch...didn't see the GO at first. |
 |
|
|
obezyanka
Starting Member
24 Posts |
Posted - 09/25/2007 : 14:12:46
|
Tara, this tiny GO made a world of the difference Thank you! I was planning to use a real temp table but I need data for longer than a session. |
 |
|
|
Kristen
Test
United Kingdom
22191 Posts |
Posted - 09/26/2007 : 05:50:16
|
I'm lost here.
Why do you want a Stored Procedure to physically copy virtual data from three views into a real table?
Can't you just query the Views when you need the data?
Kristen |
 |
|
|
obezyanka
Starting Member
24 Posts |
Posted - 09/26/2007 : 09:17:48
|
Kristen, because it was the best way I came up with for our project. I need to filter the data, strip the .rtf tags out (which I haven't done yet) and then give this data to our GIS department where they will actually try to find the locations using this data. The most convinient format for them is the table. If you know a better way to do, please, feel free to suggest it to me. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
Van
Constraint Violating Yak Guru
456 Posts |
Posted - 09/26/2007 : 09:28:23
|
| Why not have your SELECT statement(s) that is/are selecting from the view(s) do the removal of the rtf tags. I'm not sure exactly what an rtf tag is but if it can be dealt with by CHARINDEX or some other similar function, why not just have the SELECT do it? That way you don't need another table, don't need an SP...all you have to do is run a SELECT each time. |
 |
|
|
Kristen
Test
United Kingdom
22191 Posts |
Posted - 09/26/2007 : 09:41:13
|
"I need to filter the data, strip the .rtf tags out (which I haven't done yet) and then give this data to our GIS department where they will actually try to find the locations using this data"
Ok, got it. I thought this was just "copy data from view to table". If there is some preprocessing involved it makes sense.
I saw your other post about stripping RTF, and I don't reckon there is a "half decent" way to do that in SQL.
Something like Perl probably has an RTF module that will parse the RTF and allow easy access to the "text part", but RTF is not an easy thing to strip otherwise.
Kristen |
 |
|
|
Van
Constraint Violating Yak Guru
456 Posts |
Posted - 09/26/2007 : 09:44:05
|
| Ok, now I'm curious, what are rtf tags? |
 |
|
|
Kristen
Test
United Kingdom
22191 Posts |
|
|
obezyanka
Starting Member
24 Posts |
Posted - 09/26/2007 : 09:51:59
|
It's Rich Text Format. It's used when you need to do something special with a document (change font color, spell check, etc.). We use because we have spell check in our application. When the data with .rtf tags is saved in the database it looks like this:
'{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Tahoma;}}
{\colortbl ;\red0\green0\blue0;}
{\*\generator Riched20 5.50.99.2014;}\viewkind4\uc1\pard\cf1\f0\fs18\lang1033 ~200 LF streambank stabilization to provide structural protection\par
} |
 |
|
|
Van
Constraint Violating Yak Guru
456 Posts |
Posted - 09/26/2007 : 09:52:06
|
| I suspected that rtf stood for that but wasn't sure. I guess I just haven't dealt with it in SQL and don't understand exactly how an rtf tag makes it to a database row...I suppose one of the datatypes allows it. |
 |
|
|
Kristen
Test
United Kingdom
22191 Posts |
Posted - 09/26/2007 : 09:55:34
|
It doesn't, its a markup language for text, like postscript, and whatever the printing industry uses.
Word documents, for example, can be SavedAs RTF, which means that the content can then be displayed in non-Word document editors - presumably hopefully with "identical" formatting   
Kristen |
Edited by - Kristen on 09/26/2007 09:56:54 |
 |
|
Topic  |
|