473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help for this pls stored procedure

In my stored procedure i have :
EXECUTE ('select ' + @TotalRecords + ' = count(*) from clients')

It doesn't work!
and i don't know how i can ?

Apr 17 '06 #1
1 1140

No this doesn`t work :-)

as with a execute statement you are now creating the following string to
execute 'select = count(*) from clients'
so it will result in an error

if it is so that the stored procedure itself should return this value then

SELECT COUNT(*) FROM clients should do the trick

if it is your intention that the variabel @TotalRecords should hold the
value then

SELECT @TotalRecords=COUNT(*) FROM clients

wil do what you want

you may also perform anny select query and then read the @@ROWCOUNT value

HTH

Michel Posseth [MCP]

"sebastien1101" <se***********@hotmail.fr> schreef in bericht
news:11**********************@v46g2000cwv.googlegr oups.com...
In my stored procedure i have :
EXECUTE ('select ' + @TotalRecords + ' = count(*) from clients')

It doesn't work!
and i don't know how i can ?

Apr 17 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: berthelot samuel | last post by:
Hi everyone, I am currently trying to write a report based on a View of SQL Server. Basically, I have 3 tables : Hardware, SoftwareInstalled and Software with SoftwareInstalled that keeps track of...
1
by: Ken | last post by:
Hello, I have a webform that gets a record from SQL Server by using a stored procedure. The stored procedure uses 3 parameters in which after the record is found, stored procedure #2 runs to...
2
by: Caro | last post by:
I have a stored procedure spGetAccessLogDynamic and when I try to call it I get the following error: Server: Msg 2812, Level 16, State 62, Line 1 Could not find stored procedure 'S'. I dont...
1
by: Kumar | last post by:
Hi I am trying to recreate a database under the following environments : From: Solaris with DB2UDB version 7.2 with FP 9 To: Linux with DB2UDB version 7.2 with FP 9 It will be of really a...
0
by: Ken | last post by:
Hello, I have a webform that gets a record from SQL Server by using a stored procedure. The stored procedure uses 3 parameters in which after the record is found, stored procedure #2 runs to...
2
by: I am Sam | last post by:
Ok I set up a button column to delete an individual record. Nothing happens when I test it. Someone please help understand why. Below is the associated coding: DataGrid control: ...
2
by: Ken | last post by:
Hello, I have a webform that gets a record from SQL Server by using a stored procedure. The stored procedure uses 3 parameters in which after the record is found, stored procedure #2 runs to...
3
by: Darth Ferret | last post by:
This thing is about to drive me crazy. I have about 50 queries in the AS400 that I need to put on a menu. Once I conquer this I have a bunch more rpg reports that I need to pass a date to. In the...
17
by: Riaaaa | last post by:
Pls check my code for the stored procedure which i created for the companydetails including companyid P.K. Not Null int(4), companyname Not Null varchar (20), address varchar(30) where...
0
by: SOI_0152 | last post by:
Hi all! Happy New Year 2008. Il hope it will bring you love and happyness I'm new on this forum. I wrote a stored procedure on mainframe using DB2 7.1.1 and IBM language c. Everything works...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.