Click here to Skip to main content
15,905,612 members
Home / Discussions / Database
   

Database

 
AnswerRe: How do i access different databases Pin
Mike Dimmick11-Aug-03 3:59
Mike Dimmick11-Aug-03 3:59 
GeneralDeleted RowState and the XmlDataDocument... Pin
b33rdy11-Aug-03 0:31
b33rdy11-Aug-03 0:31 
Generalautonumbering index Pin
Jerome Conus10-Aug-03 19:44
Jerome Conus10-Aug-03 19:44 
GeneralRe: autonumbering index Pin
ZoogieZork10-Aug-03 19:54
ZoogieZork10-Aug-03 19:54 
GeneralRe: autonumbering index Pin
Jerome Conus10-Aug-03 19:56
Jerome Conus10-Aug-03 19:56 
GeneralRe: autonumbering index Pin
ZoogieZork10-Aug-03 20:15
ZoogieZork10-Aug-03 20:15 
GeneralSQL SPs With Conditionals Based on Parameters Pin
kcs9-Aug-03 17:44
professionalkcs9-Aug-03 17:44 
GeneralRe: SQL SPs With Conditionals Based on Parameters Pin
Mike Dimmick11-Aug-03 4:52
Mike Dimmick11-Aug-03 4:52 
The first can be done in a rather roundabout way:
SELECT SUM(Amount) 
FROM Sales
WHERE 
   StoreID > 0 AND 
   StoreID = 
      CASE
         WHEN @StoreID > 0 THEN @StoreID
         ELSE StoreID
      END
This basically works by comparing the StoreID in the table against itself when the variable @StoreID is not greater than 0 (always TRUE, unless you've got any NULLs in your data), as an extra filter clause. It's sometimes possible to exploit these conditions, but you should check the impact on the execution plan in Query Analyzer (it might cause an index to be rejected, leading SQL Server to read every row, killing your performance Big Grin | :-D ).

For the second one, I refer you to http://www.algonet.se/~sommar/arrays-in-sql.html[^] (link found from http://sqljunkies.com/weblog/[^]).
GeneralRe: SQL SPs With Conditionals Based on Parameters Pin
kcs12-Aug-03 9:02
professionalkcs12-Aug-03 9:02 
GeneralSQL SUM() Pin
Anonymous9-Aug-03 8:42
Anonymous9-Aug-03 8:42 
GeneralRe: SQL SUM() Pin
Not Active9-Aug-03 13:28
mentorNot Active9-Aug-03 13:28 
GeneralRe: SQL SUM() Pin
Arjan Einbu10-Aug-03 10:10
Arjan Einbu10-Aug-03 10:10 
GeneralDataView Pin
Jubal7-Aug-03 8:13
Jubal7-Aug-03 8:13 
GeneralLinking One Server To Another Pin
qmuffs7-Aug-03 7:02
qmuffs7-Aug-03 7:02 
GeneralRe: Linking One Server To Another Pin
Alexander Kojevnikov7-Aug-03 23:58
Alexander Kojevnikov7-Aug-03 23:58 
GeneralRe: Linking One Server To Another Pin
qmuffs8-Aug-03 8:46
qmuffs8-Aug-03 8:46 
GeneralNeed help with "order by", "group by" Pin
lnong7-Aug-03 1:44
lnong7-Aug-03 1:44 
GeneralRe: Need help with "order by", "group by" Pin
Arjan Einbu7-Aug-03 8:11
Arjan Einbu7-Aug-03 8:11 
GeneralRe: Need help with "order by", "group by" Pin
lnong7-Aug-03 8:41
lnong7-Aug-03 8:41 
GeneralRe: Need help with "order by", "group by" Pin
Arjan Einbu7-Aug-03 9:29
Arjan Einbu7-Aug-03 9:29 
GeneralPerl script to sql server2000 conversion Pin
puneet trehan6-Aug-03 22:15
puneet trehan6-Aug-03 22:15 
GeneralJoining tables Pin
totig6-Aug-03 12:32
totig6-Aug-03 12:32 
GeneralRe: Joining tables Pin
Rein Hillmann6-Aug-03 21:55
Rein Hillmann6-Aug-03 21:55 
GeneralHowto:? obtain all unique values in a column from a .net datatable Pin
pg82906-Aug-03 10:50
pg82906-Aug-03 10:50 
GeneralRe: Howto:? obtain all unique values in a column from a .net datatable Pin
Rocky Moore6-Aug-03 23:27
Rocky Moore6-Aug-03 23:27 

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.