Looping info into an SQL function


Hi

I need to get a list of numbers from an sql satement
i.e
SELECT name_ctr FROM actNamePropertyAddressView

then I need to do a loop inserting the name_ctr value
in the procedure below

select dbo.funnucNamePostAddress(name_ctr), 'pr', 0, GETDATE())

then I need to output the results

I would appreciate any feedback on this


Posted On: Tuesday 20th of November 2012 02:59:11 AM Total Views:  132
View Complete with Replies

RELATED TOPICS OF Microsoft SQL Server PROGRAMMING LANGUAGE




Using the count function with TOP

, Can anyone help me out of my misery This statement does not work and i don't know how to fix it: "Select top 50 SID, count(Criteria) as A from ScoreResults where Criteria = -1 and ScoreResults.ID in (Select ID from Player Where FirstName Like '" & strFirstName & "' and LastName Like '" & strLastName & "')order by SID" I am parsing this string through to mssql via VB and get an error and I do not know why. M.
VIEWS ON THIS POST

254

Posted on:

Tuesday 20th November 2012
View Replies!

help extracting user info

please can anyone help me i have a ipb forum some how i accidently delete my post i have a old backup from 3 week ago how can i extract the post from the backup NOTE: the only post that was deleted was post made by me none of the other member post was deleted i did not want to restore the entire post table beacause i would loose post in the past 3 weeks can anyone help me with a script or anything i can used to extract post of the post table where the poster id is 1 here is a sample INSERT INTO `ibf_posts` VALUES (2, 0, NULL, 1, 'albertldee', 1, 1, '12.8.34.199' INSERT INTO `ibf_posts` VALUES (3, 0, NULL, 4, '\t\t-\t', 1, 1, '207.44.154.35 INSERT INTO `ibf_posts` VALUES (4, 0, NULL, 6, 'demarcus', 1, 1, '69.142.131.149 INSERT INTO `ibf_posts` VALUES (5, 0, NULL, 7, 'gottasteu', 1, 1, '65.12.169.41 the post table has about 122000 line like above i just want to extract all the line that has albertldee like line number 1
VIEWS ON THIS POST

213

Posted on:

Tuesday 20th November 2012
View Replies!

MS SQL Convert function not working

I have just converted an Access database to a SQLServer one and now have the joy(!!) of changing all the SQL statements to make then compatible. In Access I had a Format function around a date, so now I am using a convert function which takes the form of convert(datetime,TABLE_NAME.COLUMN_NAME,n). No matter what the number n is, the resultant date always comes out the same in m/d/yyyy format. This appears to go against everything I've read so far and cannot for the life of me work out what is going on. Can anyone help
VIEWS ON THIS POST

98

Posted on:

Tuesday 20th November 2012
View Replies!

Calling User defined functions

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 ...... //whatever code ..... return @str1 end @str is a table column(col1) How do I call this function so that all columns in the table get manipulated by the function\t Do i have to write a stored proc to call this function or something else has to be done
VIEWS ON THIS POST

167

Posted on:

Monday 26th November 2012
View Replies!

Stored Procedure - declaring a function not a variable?

Can anyone explain to me how I go about getting a function working within a stored procedure for example standard variables I know you declare like so:- Code: @sPID int, @sAID int But how would I go about decalring a function within the stored procedure. Code: oConn.Execute = ("UPDATE tblAdministration SET adminLogged=" & Session("Logged") +1 & ", adminLastLogged=" & myDateFunction & "" &_ "WHERE adminID=" & cInt(oRS("adminID"))) myDateFunction is my function like you did'nt know . So how do I go about adding my query into a stored procedure, I have no problems, but I would not know how to declare a function in the sotred procedure.
VIEWS ON THIS POST

123

Posted on:

Monday 26th November 2012
View Replies!

Know of any SQL function that would chop-off the hyphen from the zipcode??

Anyone know what's the MS-SQL function that look at the zipcode like "30296-6912" and chop off the "-6912" suffix by just looking at the hyphen part
VIEWS ON THIS POST

89

Posted on:

Monday 26th November 2012
View Replies!

SQL Server info

Hi... I'm looking for some information on how SQL Server and MySQL work when using ASP.NET (VB.NET). I've only used access but now need to learn this technology... If anyone could post a link to some information or tell me themselves then this would be appreciated ...
VIEWS ON THIS POST

166

Posted on:

Monday 26th November 2012
View Replies!

SQL Server built in functions?

Which built in fucntion is required in SQL Server if i have a value of -1 and i would like to convert the value to 1, by removing the - (first character from the string) The ASP Code for acheiving this is as follows Mid(rsCheckForAvailableStock.Fields.Item("Availabl eStock").Value, 2, 100) With rsCheckForAvailableStock.Fields.Item("AvailableSto ck") being the -1 Can anyone help
VIEWS ON THIS POST

119

Posted on:

Monday 26th November 2012
View Replies!

SQL Aggregate function that combines like CONCAT

all, I'm trying to find a way to query a database, using several GROUP BY's, but I need the IDENTITYCOL to be put in an aggregate function that will give me a string representation of each IDENTITYCOL value. Something in between a SUM and a CONCAT. So basically if I have records with IDENTITYCOL's 1, 3, 4 and 5, I'd like to be able to call THISFUNCTION(IDENTITYCOL) AS Expr1 and get Expr1 to be "1,3,4,5". Is there anything remotely like this
VIEWS ON THIS POST

159

Posted on:

Monday 26th November 2012
View Replies!