Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
inbs
Aged Yak Warrior
860 Posts |
Posted - 2009-10-01 : 04:50:53
|
hi i want to insert table result from procedure this is my query:CREATE TABLE #drives (ServerName varchar(15),drive char(1) PRIMARY KEY,FreeSpace int NULL,FreePercent int NULL,TotalSize int NULL,FreespaceTimestamp DATETIME NULL)INSERT INTO #drives EXEC dbo.sp_diskspaceif i run EXEC dbo.sp_diskspace i getServerName drive Total(MB) Free(MB) Free(%) FreespaceTimestampSER01 C 90000 35000 42 2009-10-01 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-10-01 : 04:53:38
|
quote: Originally posted by inbs hi i want to insert table result from procedure this is my query:CREATE TABLE #drives (ServerName varchar(15),drive char(1) PRIMARY KEY,FreeSpace int NULL,FreePercent int NULL,TotalSize int NULL,FreespaceTimestamp DATETIME NULL)INSERT INTO #drives EXEC dbo.sp_diskspaceif i run EXEC dbo.sp_diskspace i getServerName drive Total(MB) Free(MB) Free(%) FreespaceTimestampSER01 C 90000 35000 42 2009-10-01
Did you get any error?MadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-10-01 : 04:54:42
|
quote: Originally posted by inbs hi i want to insert table result from procedure this is my query:CREATE TABLE #drives (ServerName varchar(15),drive char(1) PRIMARY KEY,FreeSpace int NULL,FreePercent int NULL,TotalSize int NULL,FreespaceTimestamp DATETIME NULL)INSERT INTO #drives EXEC dbo.sp_diskspaceif i run EXEC dbo.sp_diskspace i getServerName drive Total(MB) Free(MB) Free(%) FreespaceTimestampSER01 C 90000 35000 42 2009-10-01
it looks fine. did you get any error |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-10-01 : 04:54:59
|
|
 |
|
|
cipriani1984
Constraint Violating Yak Guru
304 Posts |
Posted - 2009-10-01 : 05:08:41
|
isnt #tablename a temporary table? will that get stored?quote: Originally posted by visakh16
quote: Originally posted by inbs hi i want to insert table result from procedure this is my query:CREATE TABLE #drives (ServerName varchar(15),drive char(1) PRIMARY KEY,FreeSpace int NULL,FreePercent int NULL,TotalSize int NULL,FreespaceTimestamp DATETIME NULL)INSERT INTO #drives EXEC dbo.sp_diskspaceif i run EXEC dbo.sp_diskspace i getServerName drive Total(MB) Free(MB) Free(%) FreespaceTimestampSER01 C 90000 35000 42 2009-10-01
it looks fine. did you get any error
|
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-10-01 : 05:12:13
|
| yup it will. it will have its scope until the current connection terminates |
 |
|
|
|
|
|
|
|