Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 7,2000
»
General
»
user defined functions & columns
user defined functions & columns
Rate Topic
Display Mode
Topic Options
Author
Message
newbie_sql
newbie_sql
Posted Wednesday, October 14, 2009 9:50 AM
SSC Rookie
Group: General Forum Members
Last Login: Tuesday, April 27, 2010 8:09 AM
Points: 28,
Visits: 35
I have created a user defined function that takes a string as input.
EG: Create function func_new(@str varchar(20))
returns varchar(20)
begin
......
.....
return @str1
end
@str is a table column
How do I call this function so that all columns in the table get manipulated by the function??
Post #802880
LutzM
LutzM
Posted Wednesday, October 14, 2009 12:20 PM
SSCertifiable
Group: General Forum Members
Last Login: Wednesday, April 24, 2013 3:17 PM
Points: 6,731,
Visits: 12,131
Please provide more information on what you're trying to do.
It's hard for us to translate
"......
.....
"
into something that "manipulates all columns in the table"
We don't even know what table you're talking about nor what kind of "manipulation" you're trying to do.
Please follow the first link in my signature on how to post sample data and I'm sure you'll get fast response that actually will answer your question.
Keep in mind that we don't see what you see since we can't look over your shoulder.
Lutz
A pessimist is an optimist with experience.
How to get fast answers to your question
How to post performance related questions
Links for
Tally Table
,
Cross Tabs
and
Dynamic Cross Tabs
,
Delimited Split Function
Post #803011
newbie_sql
newbie_sql
Posted Thursday, October 15, 2009 2:04 AM
SSC Rookie
Group: General Forum Members
Last Login: Tuesday, April 27, 2010 8:09 AM
Points: 28,
Visits: 35
Create FUNCTION [dbo].[fnRemoveBadCharacter]
(
@BadString nvarchar(40)
)
RETURNS nvarchar(40)
AS
BEGIN
DECLARE @nPos INTEGER
SELECT @nPos = PATINDEX('%[^a-zA-Z0-9_]%', @BadString)
WHILE @nPos > 0
BEGIN
SELECT @BadString = STUFF(@BadString, @nPos, 1, '')
SELECT @nPos = PATINDEX('%[^a-zA-Z0-9_]%', @BadString)
END
This is the function I have created to remove bad characters.
How do I call this function to update col1(nvarchar(40)) of tbl1 to remove bad characters?
Post #803275
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.