February 22, 2015 at 4:38 pm
Hi SQL gurus I am trying to track space of a table of Adventureworks and like to insert into a table into AAA database and run that thru SQL agent with date stamped.
Can someone help?
use AAA
go
create table A(
Rundate DATETIME NOT NULL DEFAULT(GETDATE())
,objname varchar(100)
,rows varchar (10)
,reserved varchar(10)
,data varchar(10)
,index_size varchar(10),
unused varchar(10))
Go
insert into aaa (
objname varchar(100)
,rows varchar (10)
,reserved varchar(10)
,data varchar(10)
,index_size varchar(10),
unused varchar(10))
(
exec '(sp_spaceused 'AdventureWorks.person.address')'
February 23, 2015 at 11:26 pm
Remove the parenthesis and the related single quotes from the EXEC.
--Jeff Moden
Change is inevitable... Change for the better is not.
February 25, 2015 at 6:36 am
did this: exec sp_spaceused 'AdventureWorks.person.address' still not working 🙁
February 25, 2015 at 6:43 am
If you provide the database name, it has to be that of the current database.
February 25, 2015 at 6:50 am
USE AAA
GO
create table A(
Rundate DATETIME NOT NULL DEFAULT(GETDATE())
,objname varchar(100)
,rows varchar (10)
,reserved varchar(10)
,data varchar(10)
,index_size varchar(10),
unused varchar(10))
Go
insert into A (
objname
,rows
,reserved
,data
,index_size
,unused)
exec AdventureWorks..sp_spaceused 'AdventureWorks.person.address'
February 25, 2015 at 4:37 pm
Dan121 (2/25/2015)
did this: exec sp_spaceused 'AdventureWorks.person.address' still not working 🙁
Heh... what does that mean? "Still not working". Are you getting an error? What are the symptoms?
--Jeff Moden
Change is inevitable... Change for the better is not.
February 26, 2015 at 7:11 am
Worked!!!!Thanks you millions Kutang and Jeff you guys are awesome:-)
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply