Viewing 15 posts - 541 through 555 (of 717 total)
Nice question thanks!
Now if I would just pay more attention and read carefully. (I read it as greater than...)
I should have known better because I think the last question was...
August 31, 2010 at 12:27 pm
I want to make it as simple to call as possible, and it seems like a lot of extra work to pass the DB name. Since this will be for...
August 30, 2010 at 12:03 pm
Lowell (8/30/2010)
a parameter cannot be assigned inside the calling statement; just break it up into two lines:
You mean three lines... (You have to declare the variable.) But that doesn't really...
August 30, 2010 at 10:49 am
Brian O'Leary (8/30/2010)
TryEXEC DB2.dbo.Test @DB = CAST(SELECT DB_NAME() AS SYSNAME);
Nope, that doesn't work.
USE DB1;
GO
CREATE PROC test (@DB sysname) AS
SELECT @DB;
GO
USE DB2
EXEC DB1.dbo.test @DB = CAST(SELECT DB_NAME() AS SYSNAME);
Results in two...
August 30, 2010 at 10:00 am
You should be able to use the copy database wizard, but you can't backup/restore, or detach/copy/attach to an older version of SQL Server.
August 29, 2010 at 9:14 pm
Brian O'Leary (8/29/2010)
You could add a parameter to the sproc and pass the db name into it. This would of course need to be recorded somewhere.
Yeah, that is what I...
August 29, 2010 at 7:32 pm
Dave Mason (5/26/2010)
Still, after reading the documentation on MSDN, I'm confused as to why any of this matters when the tables are truncated first...
It's been a while, but in case...
August 29, 2010 at 3:46 pm
Adiga (8/29/2010)
Not sure if I understood your requirement correctly. SELECT DB_NAME() gives the current database name. You may use this to determine if the current database in DB1.
But if you...
August 29, 2010 at 12:24 pm
As a note I did find that if I put the SP in the master DB, and name it starting with sp_ that I can do what I want to,...
August 29, 2010 at 12:25 am
Thanks for the question, it is always great to learn something new...
August 25, 2010 at 10:00 pm
Thanks for the question, I had to puzzle it out for a while, but got it right.
August 25, 2010 at 9:57 pm
Thanks for the question! (Actually for the series of questions, I like the idea of going through lots of different uses of the same function.)
August 25, 2010 at 6:01 pm
Viewing 15 posts - 541 through 555 (of 717 total)