SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Stored procedure from the view
 New Topic  Reply to Topic
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

Van
Constraint Violating Yak Guru

458 Posts

Posted - 09/25/2007 :  14:03:38  Show Profile  Reply with Quote
So if you run that to create your SP you are getting an error then?
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
37303 Posts

Posted - 09/25/2007 :  14:05:24  Show Profile  Visit tkizer's Homepage  Reply with Quote
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/
Go to Top of Page

Van
Constraint Violating Yak Guru

458 Posts

Posted - 09/25/2007 :  14:06:05  Show Profile  Reply with Quote
Good catch...didn't see the GO at first.
Go to Top of Page

obezyanka
Starting Member

24 Posts

Posted - 09/25/2007 :  14:12:46  Show Profile  Reply with Quote
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.
Go to Top of Page

Kristen
Test

United Kingdom
22431 Posts

Posted - 09/26/2007 :  05:50:16  Show Profile  Reply with Quote
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
Go to Top of Page

obezyanka
Starting Member

24 Posts

Posted - 09/26/2007 :  09:17:48  Show Profile  Reply with Quote
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.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 09/26/2007 :  09:20:33  Show Profile  Reply with Quote
I'm not paid enough



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

Van
Constraint Violating Yak Guru

458 Posts

Posted - 09/26/2007 :  09:28:23  Show Profile  Reply with Quote
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.
Go to Top of Page

Kristen
Test

United Kingdom
22431 Posts

Posted - 09/26/2007 :  09:41:13  Show Profile  Reply with Quote
"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
Go to Top of Page

Van
Constraint Violating Yak Guru

458 Posts

Posted - 09/26/2007 :  09:44:05  Show Profile  Reply with Quote
Ok, now I'm curious, what are rtf tags?
Go to Top of Page

Kristen
Test

United Kingdom
22431 Posts

Posted - 09/26/2007 :  09:49:56  Show Profile  Reply with Quote
Rich Text Format

See: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=89973
Go to Top of Page

obezyanka
Starting Member

24 Posts

Posted - 09/26/2007 :  09:51:59  Show Profile  Reply with Quote
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

}
Go to Top of Page

Van
Constraint Violating Yak Guru

458 Posts

Posted - 09/26/2007 :  09:52:06  Show Profile  Reply with Quote
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.
Go to Top of Page

Kristen
Test

United Kingdom
22431 Posts

Posted - 09/26/2007 :  09:55:34  Show Profile  Reply with Quote
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
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000