Scripts

Technical Article

Last Sunday

Needed to return the week ending date as Sunday for daily transactions multiple times, for several aggregate reports. This function returns the last Sunday for past or future weeks.

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(1)

You rated this post out of 5. Change rating

2009-05-11 (first published: )

691 reads

Blogs

T-SQL Tuesday #204 – Are blogs still relevant? (Roundup)

By

I did not expect 27 responses to my T-SQL Tuesday #204 invitation, but it...

Build vs Buy AI: When to adopt, partner, build or buy

By

Should you adopt an off-the-shelf AI tool, partner with a specialist, build in-house, or...

What's New in SQL Server for the Developer: SQL Server 2012

By

Part 1 of my What's New in SQL Server for the Developer series. IIF,...

Read the latest Blogs

Forums

Alamat Telp BCA KCU SCBD Hub/Wa. 0817-819-444

By layanan 24jam BCA

Equity Tower, Ground Floor, Unit D & Lantai 8, Unit E, Jl. Jenderal Sudirman...

Alamat Telp BCA KCP Talavera Hub/Wa. 0817-819-444

By Halo_BCA

Talavera Office Park, Jl. TB Simatupang No.Kav. 26, RT.1/RW.1, Cilandak Bar., Kec. Cilandak, Kota...

Switching Schema II

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Switching Schema II

Visit the forum

Question of the Day

Switching Schema II

I run this query:

SELECT 
 s.name AS schemaname
 , o.name AS objectname
 FROM sys.objects o
 INNER JOIN sys.schemas s ON s.schema_id = o.schema_id
 WHERE o.name = 'Beer'
I get two rows back for the objects, named dbo.beer and etl.beer. Both the tables have identical schemas and are not partitioned. There are 25 rows in dbo.beer and 0 rows in etl.beer. I run this code:
ALTER TABLE dbo.beer switch TO etl.beer
What happens?

See possible answers