473,406 Members | 2,371 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,406 software developers and data experts.

Why is SQL Server procedure not executing properly?

29
i'm trying to execute a procedure that should return a property that are available in a state within a price range(between x and y)

i have written a procedure but not able 2 execute it properly
Jul 22 '08 #1
6 1286
ck9663
2,878 Expert 2GB
More details please.

Sample data of your source table and the value/format of your desired output.

-- CK
Jul 22 '08 #2
rahulae
29
Given a valid character state and price range( between x and y) the system should be able to report all the properties that are available in that state with in that range with their asking price.

Table:Attributes(property_id,property_name,asking_ price,status,total_size,address,city,state)
Jul 22 '08 #3
Delerna
1,134 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1. SELECT Property_ID,Property_Name,Asking_Price,Status,
  2.        Total_Size,Address,City,State
  3. FROM Attributes
  4. WHERE State=@State 
  5.   AND Asking_Price BETWEEN @X AND @Y
  6.  
Jul 22 '08 #4
rahulae
29
i have to write a procedure for that and also tell me how to execute the procedure since we have to use a between operator
Jul 23 '08 #5
Delerna
1,134 Expert 1GB
The stored proc will look something like
Expand|Select|Wrap|Line Numbers
  1. create proc GetAttributeRange 
  2.          @State varchar(20),
  3.          @X decimal(18,2),
  4.          @Y decimal(18,2)
  5. as
  6. SELECT Property_ID,Property_Name,Asking_Price,Status,
  7.        Total_Size,Address,City,State
  8. FROM Attributes
  9. WHERE State=@State 
  10.   AND Asking_Price BETWEEN @X AND @Y
  11. Go
  12.  
and you will call it something like this
Expand|Select|Wrap|Line Numbers
  1. exec GetAttributeRange 'NSW',1.42,100.30
  2.  
Jul 23 '08 #6
rahulae
29
Its working fine for me

Thank You.
Jul 23 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Yves Touze | last post by:
Hi All, I'm trying to migrate from SQL Server 7.0 to SQL Server 2000. I've got some ASP page which call VB components that retrieve shaped recordsets from SQL Server using the MSDATASHAPE...
5
by: Matt | last post by:
Hello I am running a SP from the SQL Server Agent, the job has one step that looks like this. exec q_spr_inlevextsystem This job fails with the following message Job 'AutoInlev' : Step...
6
by: Raquel | last post by:
This is the first simple SQL PL stored procedure that I tried on UDB (UDB PE on XP): CREATE PROCEDURE SQLSP1 ( IN PEMPNO CHAR(6) , IN PRAISEPCT DEC(6,2) ) LANGUAGE SQL UPDATE...
1
by: Ville Huovinen | last post by:
Platform: Windows 2003 Server (MS SQL Server 2003 SP3) Language: C# Problem: My stored procedures times out randomly, some proces works fine when using them from C#, and some generate...
4
by: Stuart Ferguson | last post by:
I am currently writing code to execute SQL Server 2000 Stored procedured using the ODBC.NET SQL Server Driver. The particular stored procedure I am using has multiple paramaters which I have...
3
by: Nils Magnus Englund | last post by:
Hi, I've made a HttpModule which deals with user authentication. On the first request in a users session, it fetches data from a SQL Server using the following code: using (SqlConnection...
1
by: chloe.crowder | last post by:
Hi We're trying to use call a stored procedure to update information in a remote Ingres database. We've linked the server, and can read information using SELECT * FROM OPENQUERY (..........),...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.