March 29, 2013 at 10:00 pm
Hi All,
I am trying to copy All data from sp_helpdb to some other table. I am not finding any solution that how to do this.
Can someone help on this.
March 30, 2013 at 12:40 am
The information you see in sp_helpdb can be found in the system dmv's. Start with looking at sys.databases and go from there. Be sure to check out each dmv in Books Online as it will lead you to other views and more information.
March 30, 2013 at 1:30 am
To save stored procedure values you can do something as follows:
CREATE TABLE #MYTEST(xNAME sysname, xDB_SIZE nvarchar(13), xOWNER SYSNAME, xDBID smallint, xCREATED nvarchar(11), xStatus nvarchar(600), xCOMPATIBILITY_LEVEL TINYINT)
INSERT INTO #MYTEST(xNAME, xDB_SIZE, xOWNER, xDBID, xCREATED, xStatus, xCOMPATIBILITY_LEVEL)
EXEC sp_helpdb;
SELECT * FROM #MYTEST
HTH 🙂
March 30, 2013 at 4:09 am
Sp_help returns multiple data sets with different numbers of columnz. It also returns different results depending on the parameters and the object you are testint... a table returns diilfferent results than proca or views.
You can sp_kelptext sp_help and reshape the results into something more easily squabs shed into a single resultset by making a new procedure.
Lowell
March 30, 2013 at 10:00 am
Lowell (3/30/2013)
Sp_help returns multiple data sets with different numbers of columnz. It also returns different results depending on the parameters and the object you are testint... a table returns diilfferent results than proca or views.You can sp_kelptext sp_help and reshape the results into something more easily squabs shed into a single resultset by making a new procedure.
eh? what? I wouldn't use sql server to squab a shed.
spellchecker my son.
:-):-D;-)
---------------------------------------------------------------------
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply