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

Database

 
AnswerRe: Join query Pin
dan!sh 19-Jan-10 18:51
professional dan!sh 19-Jan-10 18:51 
AnswerRe: Join query Pin
Pranay Rana19-Jan-10 19:41
professionalPranay Rana19-Jan-10 19:41 
QuestionInstalling a database using MSVS 2010 Pin
JaeBeam19-Jan-10 11:34
JaeBeam19-Jan-10 11:34 
AnswerRe: Installing a database using MSVS 2010 Pin
Bassam Saoud20-Jan-10 8:37
Bassam Saoud20-Jan-10 8:37 
QuestionSQL Query : Multiple joins [modified] Pin
DotNetXenon19-Jan-10 11:11
DotNetXenon19-Jan-10 11:11 
AnswerRe: SQL Query : Multiple joins Pin
SeMartens19-Jan-10 20:18
SeMartens19-Jan-10 20:18 
QuestionT-SQL: How to force rows insertion ignoring transactions? Pin
Yuval Naveh19-Jan-10 8:36
Yuval Naveh19-Jan-10 8:36 
AnswerRe: T-SQL: How to force rows insertion ignoring transactions? [modified] Pin
Eddy Vluggen19-Jan-10 10:20
professionalEddy Vluggen19-Jan-10 10:20 
Yuval Naveh wrote:
I would like to have the log entry (i.e. row) to be inserted and persisted regardless of what the outer (nested) transactions are doing. The log entry should never roll back

Could someone point me to a solution using T-SQL?


You could use a raiserror[^] to write your message to the sys.messages view. You'd have to predefine the errormessages using sp_addmessage though.

Alternatively, if it's from a stored procedure then you might choose to add them to a variable, as opposed to logging them immediately. Next, RETURN that variable when exiting the sproc, and write insert it's contents to the logfile loggingtable.

If you have the option to drop the TSQL-requirement, then go for extended procedures, like xp_cmdshell (executing isql.exe to execute an SQL statement).

I hope someone else comes up with something better Smile | :)

I are Troll Suspicious | :suss:

modified on Tuesday, January 19, 2010 7:31 PM

GeneralRe: T-SQL: How to force rows insertion ignoring transactions? Pin
Yuval Naveh20-Jan-10 2:58
Yuval Naveh20-Jan-10 2:58 
AnswerRe: T-SQL: How to force rows insertion ignoring transactions? Pin
debrah.h4819-Jan-10 19:00
debrah.h4819-Jan-10 19:00 
GeneralRe: T-SQL: How to force rows insertion ignoring transactions? Pin
Yuval Naveh20-Jan-10 2:59
Yuval Naveh20-Jan-10 2:59 
QuestionCentralized Query Optimization Pin
AmbiguousName19-Jan-10 6:34
AmbiguousName19-Jan-10 6:34 
AnswerRe: Centralized Query Optimization Pin
Eddy Vluggen19-Jan-10 9:43
professionalEddy Vluggen19-Jan-10 9:43 
GeneralRe: Centralized Query Optimization Pin
AmbiguousName19-Jan-10 21:14
AmbiguousName19-Jan-10 21:14 
GeneralRe: Centralized Query Optimization Pin
Eddy Vluggen20-Jan-10 0:15
professionalEddy Vluggen20-Jan-10 0:15 
QuestionBULK INSERT problem with SQL Server 2008 DATE format Pin
Gawiz19-Jan-10 6:16
professionalGawiz19-Jan-10 6:16 
AnswerRe: BULK INSERT problem with SQL Server 2008 DATE format Pin
Eddy Vluggen19-Jan-10 11:04
professionalEddy Vluggen19-Jan-10 11:04 
QuestionOpening A Database Connection [SOLVED] Pin
#realJSOP19-Jan-10 4:24
professional#realJSOP19-Jan-10 4:24 
AnswerRe: Opening A Database Connection Pin
loyal ginger19-Jan-10 4:34
loyal ginger19-Jan-10 4:34 
GeneralRe: Opening A Database Connection [modified] Pin
#realJSOP19-Jan-10 4:57
professional#realJSOP19-Jan-10 4:57 
GeneralRe: Opening A Database Connection Pin
Eddy Vluggen19-Jan-10 5:08
professionalEddy Vluggen19-Jan-10 5:08 
GeneralRe: Opening A Database Connection Pin
#realJSOP19-Jan-10 5:26
professional#realJSOP19-Jan-10 5:26 
AnswerRe: Opening A Database Connection Pin
Luc Pattyn19-Jan-10 5:52
sitebuilderLuc Pattyn19-Jan-10 5:52 
GeneralRe: Opening A Database Connection Pin
#realJSOP19-Jan-10 6:18
professional#realJSOP19-Jan-10 6:18 
GeneralRe: Opening A Database Connection Pin
#realJSOP19-Jan-10 7:15
professional#realJSOP19-Jan-10 7:15 

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.