两个问题1.if object_id('#t') is not null drop table #t;select * into #t from Northwind.dbo.Orders总是报 #t 已经存在
2.select * from Northwind.dbo.Orders where orderId like '%_%' 为什么总是把全部查询出来,查询条件没有作用,
2.select * from Northwind.dbo.Orders where orderId like '%_%' 为什么总是把全部查询出来,查询条件没有作用,
if object_id('#t') is not null drop table #t
go select * into #t from Northwind.dbo.Orders
select * from Northwind.dbo.Orders where orderId like '_%'
if object_id('#t') is not null drop table #t; go ---加go,表示批处理结束
select * into #t from Northwind.dbo.Orders 总是报 #t 已经存在
2. select * from Northwind.dbo.Orders where orderId like '%!_%' escape '!'
go --加个go
select * into #t from Northwind.dbo.Orders select * from Northwind.dbo.Orders where orderId like '%[_]%'
go --加个go
select * into #t from Northwind.dbo.Orders
go --加个go
select * into #t from Northwind.dbo.Orders
if object_id('tempdb..#t') is not null drop table #t;
go
GO
drop table #t; select * into #t from Northwind.dbo.Orders
这是因为_也是通配符