T-SQL

External Article

Simple SQL: Handling Location Datatypes

  • Article

How do you record locations in SQL? Most relational database systems support spatial and geographical data, generally using the round-earth system based on the SQL specification of the Open Geospatial Consortium (OGC). However, this is not the only approach, as Joe Celko explains.

2017-11-29

2,871 reads

External Article

Simple SQL: Random Thoughts

  • Article

How does one get a truly random sample of data of a certain size from a SQL Server database table. Well, there are simple non-portable tricks one can use, such as the NewID() function, but then refining those can be tricky. Take the Rand() function for a start. Can it really provide you with a truly random number? Why doesn't the TABLESAMPLE clause give you a set number of rows? Joe Celko scratches his head a bit, explains some of the issues and invites some suggestions and tricks from readers.

2017-10-19

3,623 reads

Blogs

The Book of Redgate: What Our Customers Say

By

This is from 2010, but I loved that people felt this way about Redgate...

Export a Power BI Report that cannot be Downloaded

By

Yes, you’re reading that right, we’re going to download a report that cannot be...

Query Intelligence in SQL Server 2025: What Developers Need to Know

By

When Microsoft announced SQL Server 2025, I was curious about what would truly change...

Read the latest Blogs

Forums

Poor Name Choice

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Poor Name Choice

Getting the Indexed Columns

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Getting the Indexed Columns

T-SQL in SQL Server 2025: Substring Changes

By Steve Jones - SSC Editor

Comments posted to this topic are about the item T-SQL in SQL Server 2025:...

Visit the forum

Question of the Day

Getting the Indexed Columns

I run this code on SQL Server 2022 to get a list of all the indexes and their key columns. What is returned?

SELECT   
    INDEX_COL (N'AdventureWorks2017.Sales.SalesOrderDetail')

See possible answers