Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
android.sm
Starting Member
36 Posts |
Posted - 2010-05-11 : 19:09:51
|
| my database has two tables. Category(CategoryId, Category), Quote(Id, CategoryId, Quote) these two tables are related via FK (CategoryId).i need help with my sp. it should return me a quote when i pass an ID to it. SP code:CREATE PROCEDURE GetQuote (@CategoryId VARCHAR(2)ASSELECT Quotes.QuoteFROM Quotes, CategoryWHERE Quotes.CategoryId = @CategoryId |
|
|
ms65g
Constraint Violating Yak Guru
497 Posts |
Posted - 2010-05-11 : 19:18:20
|
| [code]CREATE PROCEDURE GetQuote (@CategoryId VARCHAR(2))ASSELECT DISTINCT Quotes.QuoteFROM QuotesWHERE Quotes.CategoryId = @CategoryId[/code] |
 |
|
|
android.sm
Starting Member
36 Posts |
Posted - 2010-05-14 : 20:06:29
|
| hey thanks for that. it now works :) |
 |
|
|
ms65g
Constraint Violating Yak Guru
497 Posts |
Posted - 2010-05-14 : 22:38:00
|
quote: Originally posted by android.sm hey thanks for that. it now works :)
Good______________________Mayazar Mori Ke Dane Keshast |
 |
|
|
|
|
|