Sql-server – Can you separate schemas and objects with spaces and line feeds in T-SQL

sql servert-sql

When writing a query, can you separate schemas and objects with spaces and line feeds?

Best Answer

Yes, this is valid T-SQL:

SELECT
*
FROM
sys
.
databases
d
WHERE
d
.
name
=
'tempdb';

As is this:

SELECT * FROM sys . databases d WHERE d . name = 'tempdb';
GO

And they both work fine.

enter image description here