Help. I need to send the output of sp_who2 to a temp table.
In order to create the temp table, I need the data types of the columns returned by sp_who2. I'm looking at the underlying code to find the tables/columns.
My table definition:
CREATE TABLE ##activespids(
SPID smallint,
Status varchar(255),
Login varchar(255),
Hostname varchar(255),
BlkBy smallint,
DBName varchar(255),
Command varchar(255),
CPUTime smallint,
DiskIO bigint,
LastBatch datetime,
ProgramName varchar(255),
SPID2 smallint
)
I keep getting this error when trying to insert output of sp_who2 to the table:
Server: Msg 245, Level 16, State 1, Line 4
Syntax error converting the char value ' . ' to a column of data type int.
In order to create the temp table, I need the data types of the columns returned by sp_who2. I'm looking at the underlying code to find the tables/columns.
My table definition:
CREATE TABLE ##activespids(
SPID smallint,
Status varchar(255),
Login varchar(255),
Hostname varchar(255),
BlkBy smallint,
DBName varchar(255),
Command varchar(255),
CPUTime smallint,
DiskIO bigint,
LastBatch datetime,
ProgramName varchar(255),
SPID2 smallint
)
I keep getting this error when trying to insert output of sp_who2 to the table:
Server: Msg 245, Level 16, State 1, Line 4
Syntax error converting the char value ' . ' to a column of data type int.