Click here to Skip to main content
15,913,773 members
Home / Discussions / Database
   

Database

 
GeneralRe: How to Pass column names to query dynamically Pin
Rami Said Abd Alhalim30-Nov-07 22:27
Rami Said Abd Alhalim30-Nov-07 22:27 
GeneralRe: How to Pass column names to query dynamically Pin
IMQ30-Nov-07 22:37
IMQ30-Nov-07 22:37 
GeneralRe: How to Pass column names to query dynamically Pin
Rami Said Abd Alhalim30-Nov-07 22:51
Rami Said Abd Alhalim30-Nov-07 22:51 
GeneralRe: How to Pass column names to query dynamically Pin
IMQ30-Nov-07 23:12
IMQ30-Nov-07 23:12 
GeneralRe: How to Pass column names to query dynamically Pin
Rami Said Abd Alhalim30-Nov-07 23:19
Rami Said Abd Alhalim30-Nov-07 23:19 
QuestionNatural and Surrogate Keys Pin
Brady Kelly30-Nov-07 19:01
Brady Kelly30-Nov-07 19:01 
QuestionHow to store result of a query in a variable Pin
veereshIndia30-Nov-07 18:29
veereshIndia30-Nov-07 18:29 
AnswerRe: How to store result of a query in a variable Pin
IMQ30-Nov-07 19:07
IMQ30-Nov-07 19:07 
Hi,
you can store result of the query into a variable like this;


select @str1=AstId from UserTable where UserId=@UserId and Password=@Password

Here @str1 will store the AstID in it.

the complete procedure will liook like this:

alter procedure LogProc
(
@UserId varchar(500),
@Password varchar(500),
@str1 int output,
@str2 int output
)
as
Begin
declare @str3 varchar(500) /* why u hav declare this variable ???? */
select @str1=AstId from UserTable where UserId @UserId and Password = @Password
select @str2=RoleID from AstProf where AstId =@str1

select @str1,@str2
End

exec LogProc 'veeresh','veeresh'

you may use @str1 and @str2 in your code .

________________
Tehmina Qureshi
****************

GeneralRe: How to store result of a query in a variable Pin
veereshIndia30-Nov-07 19:17
veereshIndia30-Nov-07 19:17 
Questioncan SQL contains (saves) excel sheet? Pin
Knowledgestudent30-Nov-07 10:32
Knowledgestudent30-Nov-07 10:32 
AnswerRe: can SQL contains (saves) excel sheet? Pin
Pete O'Hanlon30-Nov-07 10:34
mvePete O'Hanlon30-Nov-07 10:34 
QuestionRe: can SQL contains (saves) excel sheet? Pin
Knowledgestudent30-Nov-07 10:43
Knowledgestudent30-Nov-07 10:43 
AnswerRe: can SQL contains (saves) excel sheet? Pin
Pete O'Hanlon30-Nov-07 10:53
mvePete O'Hanlon30-Nov-07 10:53 
QuestionRe: can SQL contains (saves) excel sheet? Pin
Knowledgestudent30-Nov-07 11:01
Knowledgestudent30-Nov-07 11:01 
AnswerRe: can SQL contains (saves) excel sheet? Pin
Paul Conrad30-Nov-07 12:54
professionalPaul Conrad30-Nov-07 12:54 
QuestionQuery + Variable problem Pin
archangel71730-Nov-07 9:25
archangel71730-Nov-07 9:25 
AnswerRe: Query + Variable problem Pin
andyharman30-Nov-07 9:38
professionalandyharman30-Nov-07 9:38 
AnswerRe: Query + Variable problem Pin
DoomedOne30-Nov-07 9:39
DoomedOne30-Nov-07 9:39 
GeneralRe: Query + Variable problem Pin
archangel71730-Nov-07 10:10
archangel71730-Nov-07 10:10 
GeneralRe: Query + Variable problem Pin
archangel71730-Nov-07 10:23
archangel71730-Nov-07 10:23 
GeneralRe: Query + Variable problem Pin
Pete O'Hanlon30-Nov-07 10:50
mvePete O'Hanlon30-Nov-07 10:50 
QuestionSelect .. Where x in (@param) ... convertion??? Pin
JoZ CaVaLLo30-Nov-07 5:03
JoZ CaVaLLo30-Nov-07 5:03 
AnswerRe: Select .. Where x in (@param) ... convertion??? Pin
Pete O'Hanlon30-Nov-07 10:02
mvePete O'Hanlon30-Nov-07 10:02 
QuestionProblem with Data Adapter and one PC [modified] Pin
dbrenth30-Nov-07 3:27
dbrenth30-Nov-07 3:27 
AnswerRe: Problem with Data Adapter and one PC Pin
Paul Conrad30-Nov-07 4:49
professionalPaul Conrad30-Nov-07 4:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.