Click here to Skip to main content
15,915,858 members
Home / Discussions / Database
   

Database

 
GeneralRe: Data Recovery - After Drop a table and creating the same table Pin
adnanrafiq13-Jun-07 2:20
adnanrafiq13-Jun-07 2:20 
GeneralRe: Data Recovery - After Drop a table and creating the same table Pin
Pete O'Hanlon13-Jun-07 3:40
mvePete O'Hanlon13-Jun-07 3:40 
GeneralRe: Data Recovery - After Drop a table and creating the same table Pin
adnanrafiq13-Jun-07 9:19
adnanrafiq13-Jun-07 9:19 
GeneralRe: Data Recovery - After Drop a table and creating the same table Pin
Krish - KP13-Jun-07 17:39
Krish - KP13-Jun-07 17:39 
GeneralRe: Data Recovery - After Drop a table and creating the same table Pin
Krish - KP13-Jun-07 17:31
Krish - KP13-Jun-07 17:31 
GeneralRe: Data Recovery - After Drop a table and creating the same table Pin
adnanrafiq13-Jun-07 22:04
adnanrafiq13-Jun-07 22:04 
QuestionProcedure for Column and Table variable Pin
Elena200612-Jun-07 21:54
Elena200612-Jun-07 21:54 
JokeRe: Procedure for Column and Table variable Pin
Harini N K12-Jun-07 22:25
Harini N K12-Jun-07 22:25 
Hi
Try this in Northwind database. Assume you are passing two parameters @OrderBycol and @viewname from the front end.

use northwind<br />
go<br />
<br />
DECLARE @sql nvarchar(4000)<br />
DECLARE @OrderByCol nvarchar(4000)<br />
DECLARE @viewname nvarchar(100) <br />
<br />
set @viewname  = 'Invoices' -- passed from front end <br />
set @OrderByCol = 'ShipName, ShipAddress' -- passed from front end <br />
<br />
SET @sql = 'SELECT ' +  @OrderByCol + ' FROM ' + @viewname<br />
<br />
print @sql<br />
<br />
EXECUTE (@sql)


and make sure that you have given one space after SELECT in 'SELECT ' and also before & after the keyword FROM clause.


Harini

GeneralRe: Procedure for Column and Table variable Pin
Elena200612-Jun-07 22:36
Elena200612-Jun-07 22:36 
GeneralRe: Procedure for Column and Table variable Pin
Harini N K12-Jun-07 22:43
Harini N K12-Jun-07 22:43 
QuestionPlease Solve this SQL Query Pin
Care Career12-Jun-07 18:01
Care Career12-Jun-07 18:01 
AnswerRe: Please Solve this SQL Query Pin
Krish - KP12-Jun-07 18:19
Krish - KP12-Jun-07 18:19 
QuestionSQL query returning zero row in MySQL 5 Pin
Guffa12-Jun-07 8:57
Guffa12-Jun-07 8:57 
AnswerRe: SQL query returning zero row in MySQL 5 Pin
Arun.Immanuel12-Jun-07 15:53
Arun.Immanuel12-Jun-07 15:53 
GeneralRe: SQL query returning zero row in MySQL 5 Pin
Guffa12-Jun-07 16:15
Guffa12-Jun-07 16:15 
AnswerSolved Pin
Guffa12-Jun-07 16:28
Guffa12-Jun-07 16:28 
QuestionReporting Services 2005 Express Pin
Jonathan Snyder12-Jun-07 3:08
Jonathan Snyder12-Jun-07 3:08 
QuestionHow to hide the SUM @ the Table Name Pin
MS Lee12-Jun-07 2:20
MS Lee12-Jun-07 2:20 
AnswerRe: How to hide the SUM @ the Table Name Pin
Revathij12-Jun-07 2:34
Revathij12-Jun-07 2:34 
GeneralRe: How to hide the SUM @ the Table Name Pin
MS Lee12-Jun-07 2:38
MS Lee12-Jun-07 2:38 
GeneralRe: How to hide the SUM @ the Table Name Pin
MS Lee13-Jun-07 18:29
MS Lee13-Jun-07 18:29 
QuestionSql joins Pin
Tauseef A12-Jun-07 1:56
Tauseef A12-Jun-07 1:56 
AnswerRe: Sql joins Pin
Krish - KP12-Jun-07 2:07
Krish - KP12-Jun-07 2:07 
QuestionNeed Sample Stored procedures Pin
Krishnaraj Barvathaya B12-Jun-07 1:48
Krishnaraj Barvathaya B12-Jun-07 1:48 
AnswerRe: Need Sample Stored procedures Pin
Sathesh Sakthivel12-Jun-07 2:09
Sathesh Sakthivel12-Jun-07 2:09 

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.