Click here to Skip to main content
15,884,981 members
Home / Discussions / Database
   

Database

 
QuestionDeploying MSDE Pin
steve_m_m10-Oct-05 0:27
steve_m_m10-Oct-05 0:27 
QuestionUn-natural sort order... Pin
ModuleKev10-Oct-05 0:20
ModuleKev10-Oct-05 0:20 
AnswerRe: Un-natural sort order... Pin
Colin Angus Mackay10-Oct-05 1:09
Colin Angus Mackay10-Oct-05 1:09 
GeneralRe: Un-natural sort order... Pin
Nic Rowan10-Oct-05 1:14
Nic Rowan10-Oct-05 1:14 
GeneralRe: Un-natural sort order... Pin
ModuleKev10-Oct-05 1:15
ModuleKev10-Oct-05 1:15 
AnswerRe: Un-natural sort order... Pin
Nic Rowan10-Oct-05 1:11
Nic Rowan10-Oct-05 1:11 
GeneralRe: Un-natural sort order... Pin
ModuleKev10-Oct-05 1:24
ModuleKev10-Oct-05 1:24 
GeneralRe: Un-natural sort order... Pin
Nic Rowan10-Oct-05 1:48
Nic Rowan10-Oct-05 1:48 
A table variable is sort of like a tempory table only it doesn't have as much overhead as a temp table.

Here's an example using Northwind:

DECLARE @vTable TABLE (TID Int, TDesc Varchar(255))

INSERT INTO @vTable 
SELECT 
	TerritoryID, 
	TerritoryDescription 
FROM 
	Territories 
WHERE 
	TerritoryDescription = 'Denver'
OR	TerritoryDescription = 'Edison'

INSERT INTO @vTable 
SELECT 
	TerritoryID, 
	TerritoryDescription 
FROM 
	Territories 
WHERE 
	TerritoryDescription <> 'Denver'
OR	TerritoryDescription <> 'Edison'
ORDER BY TerritoryDescription

SELECT * FROM @vTable


(Sorry about the formatting. I've never been able to get it right Smile | :) )

Personally I would use Colin's method unless there's no way you can add another column...



The man who smiles when things go wrong has thought of someone he can blame it on.

If you tell a man there are 300 billion stars in the universe, he'll believe you. But if you tell him a bench has just been painted, he'll have to touch it to be sure.





-- modified at 7:52 Monday 10th October, 2005
GeneralRe: Un-natural sort order... Pin
ModuleKev10-Oct-05 1:52
ModuleKev10-Oct-05 1:52 
AnswerRe: Un-natural sort order... Pin
miah alom10-Oct-05 5:01
miah alom10-Oct-05 5:01 
GeneralRe: Un-natural sort order... Pin
ModuleKev10-Oct-05 5:56
ModuleKev10-Oct-05 5:56 
GeneralRe: Un-natural sort order... Pin
miah alom10-Oct-05 6:31
miah alom10-Oct-05 6:31 
QuestionHow to find table in Access databse??? Pin
Rohan_bhat_319-Oct-05 21:42
Rohan_bhat_319-Oct-05 21:42 
AnswerRe: How to find table in Access databse??? Pin
S Douglas20-Oct-05 23:38
professionalS Douglas20-Oct-05 23:38 
GeneralRe: How to find table in Access databse??? Pin
Rohan_bhat_3121-Oct-05 0:03
Rohan_bhat_3121-Oct-05 0:03 
GeneralRe: How to find table in Access databse??? Pin
S Douglas21-Oct-05 0:19
professionalS Douglas21-Oct-05 0:19 
QuestionList of databases on mySQL server Pin
Golden Dragon9-Oct-05 14:08
Golden Dragon9-Oct-05 14:08 
QuestionMySQL - delete current row Pin
Junyor9-Oct-05 11:50
Junyor9-Oct-05 11:50 
Questionperformance? Pin
hassan azizi8-Oct-05 17:03
hassan azizi8-Oct-05 17:03 
QuestionSystem DB Pin
Ranoush7-Oct-05 21:55
Ranoush7-Oct-05 21:55 
AnswerRe: System DB Pin
S Douglas20-Oct-05 23:33
professionalS Douglas20-Oct-05 23:33 
QuestionGenerate Create Script will not show up in Database Project in VS.NET Pin
Pitchiah4u7-Oct-05 21:38
Pitchiah4u7-Oct-05 21:38 
Questioncheckbox in datagrid Pin
ahager7-Oct-05 7:07
ahager7-Oct-05 7:07 
QuestionManagment studio Pin
Bueto7-Oct-05 3:52
Bueto7-Oct-05 3:52 
AnswerRe: Managment studio Pin
Bueto9-Oct-05 22:54
Bueto9-Oct-05 22:54 

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.