asked on
EXEC sp_MSforeachdb 'IF ''?'' NOT IN (''tempDB'',''model'',''msdb'',''master'',''ReportServer'',''ReportServerTempDB'',''DB3'')
BEGIN
create table dbo.tblPhys
(
name VARCHAR(50),
physical_name VARCHAR(500),
state BIT,
size INT
)
END'
ASKER
Msg 2714, Level 16, State 6, Line 4
There is already an object named 'tblPhys' in the database.
ASKER
EXEC sp_MSforeachdb 'IF ''?'' NOT IN (''tempDB'',''model'',''msdb'',''master'',''ReportServer'',''ReportServerTempDB'',''Institute'',''TDATA'',''ClientsInfo'',''paymentnet'')
BEGIN
create table dbo.tblPhys
( name VARCHAR(50),
physical_name VARCHAR(500),
state BIT,
size INT )
END'
select (db_name() + 'A')
Msg 2714, Level 16, State 6, Line 3
There is already an object named 'tblPhys' in the database.
ASKER
EXEC sp_MSforeachdb 'IF ''?'' NOT IN (''tempDB'',''model'',''msdb'',''master'',''ReportServer'',''ReportServerTempDB'',''Institute'',''ReportServerTempDB'',''TSQLFundamentals2008'')
BEGIN
USE [?] --<<-- add this
create table tblPhys
(
name VARCHAR(50),
physical_name VARCHAR(500),
state BIT,
size INT
)
END'
Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.
TRUSTED BY