Click here to Skip to main content
15,919,607 members
Home / Discussions / Database
   

Database

 
Questionhow used execute in function [modified] Pin
Rami Said Abd Alhalim30-Nov-07 21:35
Rami Said Abd Alhalim30-Nov-07 21:35 
GeneralRe: how used execute in function Pin
Paul Conrad8-Dec-07 5:21
professionalPaul Conrad8-Dec-07 5:21 
QuestionHow to Pass column names to query dynamically Pin
veereshIndia30-Nov-07 19:46
veereshIndia30-Nov-07 19:46 
AnswerRe: How to Pass column names to query dynamically Pin
IMQ30-Nov-07 20:45
IMQ30-Nov-07 20:45 
GeneralRe: How to Pass column names to query dynamically Pin
veereshIndia30-Nov-07 21:06
veereshIndia30-Nov-07 21:06 
GeneralRe: How to Pass column names to query dynamically Pin
IMQ30-Nov-07 21:16
IMQ30-Nov-07 21:16 
GeneralRe: How to Pass column names to query dynamically Pin
veereshIndia30-Nov-07 21:26
veereshIndia30-Nov-07 21:26 
GeneralRe: How to Pass column names to query dynamically Pin
IMQ30-Nov-07 21:38
IMQ30-Nov-07 21:38 
Veer,
you did not fully understood the concept of dynamic sql.
so 1st you have to understand what the dynamic sql is;
Dynamic SQL is actually the complete sql statement, including all the necessory clauses
required for executing the sql statemnt like as "select * from tablename"
so if u hav a variable declared for dynamic sql u must assign a complete statement in it.
here in ur sp u did wrong.
Example:Declaration of dynamic sql
Declare @DynamicSql varchar(2000)
set @DynamicSql = 'SELECT * FROM MyTable'

now you may execute the like this
exec(@DynamicSql) /* See ! Here in execute i've given the variable name nott any procedure */

You may do aything which you want to with Dynamic SQL.
I did not understand what you want to select in you stored procedure (as i dont hav enough time to understand the code coz im at my job. May be after few time i'll correct your code and post it back to u.)
If you have got an idea about Dynamic SQL you can do whatever you want.
Still hav problem? You are welcome to query.
Thanks

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

GeneralRe: How to Pass column names to query dynamically Pin
veereshIndia30-Nov-07 22:05
veereshIndia30-Nov-07 22:05 
GeneralRe: How to Pass column names to query dynamically Pin
Rami Said Abd Alhalim30-Nov-07 22:16
Rami Said Abd Alhalim30-Nov-07 22:16 
GeneralRe: How to Pass column names to query dynamically Pin
IMQ30-Nov-07 22:19
IMQ30-Nov-07 22:19 
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 
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 

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.