Viewing 15 posts - 2,461 through 2,475 (of 5,394 total)
You code sample doesn't make sense to me. Begin try / end try are not always matched.
Try indenting your code, so that it flows naturally even from a "visual" standpoint.
BEGIN...
October 12, 2011 at 2:26 pm
SQL_By_Chance (10/12/2011)
Gianluca Sartori (9/23/2011)
You can use my stored procedure code template[/url] if you like it.It should do what you ask for.
Regards
Gianluca
Gina, Can you please post me a Template for...
October 12, 2011 at 1:48 pm
I know it's not exactly what you asked for, but I guess you are trying to do something that this stored procedure[/url] could solve quite easily.
October 12, 2011 at 1:46 pm
C'mon guys, get back from the Summit!
The Thread is abnormally quiet without you.
October 12, 2011 at 10:18 am
SQL_By_Chance (10/12/2011)
Thanks Gianluca,Does this mean : [tempdb.sp_executsql @sql ] would get executed in Temp DB ?
Yep.
October 12, 2011 at 10:17 am
You don't need the USE statement:
CREATE PROC xyz
AS
BEGIN
DECLARE @sql NVARCHAR (100) = 'select db_name()'
DECLARE @dbname VARCHAR (100) = 'tempdb'
DECLARE @finalsql NVARCHAR(MAX) = @dbname + N'.dbo.sp_executesql @sql'
EXEC sp_executesql @finalsql,N'@sql...
October 12, 2011 at 10:00 am
Probably because you didn't set up database mail correctly and the trigger fails to execute.
October 12, 2011 at 8:40 am
HOW TO RETURN AN ERRORLEVEL CODE from SQL SERVER to the calling batch program. I thought it was simply by using RETRUN and then the error code.
Short answer: it can't...
October 12, 2011 at 7:22 am
What I posted is a DDL trigger, which is a trigger that captures DDL changes instead of data changes.
Whenever a new database is created, the trigger will fire and run...
October 12, 2011 at 6:59 am
Darn! I don't know why, but I checked "has a different value on each row".
Nice question, Tom.
October 12, 2011 at 6:35 am
You could create a DDL trigger for CREATE_DATABASE events and send a db mail with code similar to this:
CREATE TRIGGER databaseCreated
ON ALL SERVER
FOR CREATE_DATABASE
AS
BEGIN
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'profile',
@recipients...
October 12, 2011 at 6:30 am
When posting a question you should provide:
A) Table definition
B) Sample data
C) Expected output based on sample data
You (sort-of) provided A and B: now we need C to be able to...
October 12, 2011 at 6:22 am
Duplicate post. Replies here please: http://www.sqlservercentral.com/Forums/FindPost1189017.aspx
October 12, 2011 at 6:18 am
Not exactly what you're asking for, but could be a starting point: http://sqlbackupandftp.com/
October 12, 2011 at 6:17 am
You can use my stored procedure code template from here[/url] and add the insert statements where you find "insert code here".
Given that you have a linked server in place for...
October 12, 2011 at 6:15 am
Viewing 15 posts - 2,461 through 2,475 (of 5,394 total)