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

Database

 
Questionstored procedure for restore .bak file Pin
NarendraSinghJTV21-Dec-09 17:11
NarendraSinghJTV21-Dec-09 17:11 
AnswerRe: stored procedure for restore .bak file Pin
Vimalsoft(Pty) Ltd22-Dec-09 2:26
professionalVimalsoft(Pty) Ltd22-Dec-09 2:26 
QuestionHelp building Trigger for updating summary table [modified] Pin
MAW3021-Dec-09 11:29
MAW3021-Dec-09 11:29 
AnswerRe: Help building Trigger for updating summary table Pin
Mycroft Holmes21-Dec-09 23:56
professionalMycroft Holmes21-Dec-09 23:56 
Questiontransaction error Pin
ademsandeepreddy20-Dec-09 19:53
ademsandeepreddy20-Dec-09 19:53 
AnswerRe: transaction error Pin
Member 450194023-Dec-09 7:31
Member 450194023-Dec-09 7:31 
QuestionNeed help with creating dynamic SQL statement Pin
James Shao20-Dec-09 17:54
James Shao20-Dec-09 17:54 
AnswerRe: Need help with creating dynamic SQL statement Pin
Mycroft Holmes21-Dec-09 11:00
professionalMycroft Holmes21-Dec-09 11:00 
If it works then you can only improve the structure of the query otherwise it is an exercise in string concatenation.

If the where clause is the only dynamic piece and the elements are known you can use something like
Where (IsNull(@AttrID, -1) = -1 OR AttrID = @AttrID)


where the default value is null or -1. Caveat, too many of these (about 6 IIRC) MAY affect the query performance I believe. I use it all the time and have had up to 8 elements in the where clause and it worked fine. The only benefit is it is not dynamic, not a huge issue!

Never underestimate the power of human stupidity
RAH

QuestionNeed help with DATEDIFF function Pin
James Shao20-Dec-09 17:29
James Shao20-Dec-09 17:29 
AnswerRe: Need help with DATEDIFF function Pin
Ashfield21-Dec-09 0:27
Ashfield21-Dec-09 0:27 
GeneralRe: Need help with DATEDIFF function Pin
James Shao21-Dec-09 13:33
James Shao21-Dec-09 13:33 
Questioncannot excute script Pin
#Jet19-Dec-09 16:17
#Jet19-Dec-09 16:17 
AnswerRe: cannot excute script Pin
Eddy Vluggen20-Dec-09 0:08
professionalEddy Vluggen20-Dec-09 0:08 
GeneralRe: cannot excute script Pin
#Jet20-Dec-09 7:37
#Jet20-Dec-09 7:37 
GeneralRe: cannot excute script Pin
Mycroft Holmes20-Dec-09 12:14
professionalMycroft Holmes20-Dec-09 12:14 
GeneralRe: cannot excute script Pin
#Jet20-Dec-09 12:52
#Jet20-Dec-09 12:52 
QuestionDistributed DB Pin
piotr.zielinski19-Dec-09 7:55
piotr.zielinski19-Dec-09 7:55 
AnswerRe: Distributed DB Pin
Eddy Vluggen19-Dec-09 10:20
professionalEddy Vluggen19-Dec-09 10:20 
GeneralRe: Distributed DB Pin
piotr.zielinski19-Dec-09 10:24
piotr.zielinski19-Dec-09 10:24 
GeneralRe: Distributed DB Pin
Eddy Vluggen19-Dec-09 10:56
professionalEddy Vluggen19-Dec-09 10:56 
QuestionHow do I make a transaction an "atomic" operation? (SQL Server 2005) [modified] Pin
Xiangyang Liu 刘向阳18-Dec-09 2:28
Xiangyang Liu 刘向阳18-Dec-09 2:28 
AnswerRe: How do I make a transaction an "atomic" operation? (SQL Server 2005) Pin
Chris Meech18-Dec-09 2:46
Chris Meech18-Dec-09 2:46 
GeneralRe: How do I make a transaction an "atomic" operation? (SQL Server 2005) Pin
Xiangyang Liu 刘向阳18-Dec-09 3:04
Xiangyang Liu 刘向阳18-Dec-09 3:04 
QuestionRe: How do I make a transaction an "atomic" operation? (SQL Server 2005) Pin
Chris Meech18-Dec-09 3:26
Chris Meech18-Dec-09 3:26 
AnswerRe: How do I make a transaction an "atomic" operation? (SQL Server 2005) Pin
Xiangyang Liu 刘向阳18-Dec-09 3:30
Xiangyang Liu 刘向阳18-Dec-09 3:30 

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.