T-SQL

SQLServerCentral Article

Nesting Stored Procedures

  • Article

We're pleased to announce that Robert will be writing for us each month - generally on stored procedures, but occasionally on a different topic. This article discusses how nesting stored procedures works and how to use @@NextLevel. Good reading! If there is a stored procedure topic you'd like to see covered, add a comment to the article or email us at articles@sqlservercentral.com

3.5 (2)

You rated this post out of 5. Change rating

2007-10-02 (first published: )

52,040 reads

Technical Article

How to retrieve roles from a Database

  • Script

If you have environment where you restrict access to database objects based on user roles and if you have a lot of databases on different servers in the same domain.  The following script can generate roles from a given database in a format that can be used to create roles on different servers where the […]

You rated this post out of 5. Change rating

2003-05-14

182 reads

Technical Article

How to get Foreign keys

  • Script

If you ever have been put in a situation where your database has a lot of objects and some of those do not have primary keys, trying to find feels like needle in the haystack.  I have modified the script contributed by Mr.Tandrei and Mr.Rahul sharma.  The following script gives all the tables that do […]

You rated this post out of 5. Change rating

2003-04-17

140 reads

Technical Article

Copy Permissions for a database

  • Script

Copies the permissions from an existing database user to a new database user.Usage:exec copy_permissions_for_database 'From_User', 'To_User'* From_User must exist in the database.* To_User must not exist in the database.* To_User must exist as a login on the server.I used http://www.sqlservercentral.com/columnists/awarren/sqlpermissionspublicrole_2.asp as a starting point.

5 (1)

You rated this post out of 5. Change rating

2003-04-14

1,858 reads

Technical Article

Dynamically Generating HTML Tags from T-SQL

  • Script

Here's a real-life challenge I was faced with at work: my company (a talent agency) needed me to create a report listing all of our actors that we represent - and for each actor, a comma-delimited string of each production that they've starred in.  Simple enough, right......except that, within the comma-delimited list of productions, they […]

You rated this post out of 5. Change rating

2003-04-11

744 reads

Technical Article

Date Only

  • Script

This is a follow-on to info's script to strip the time portion of a datetime or smalldatetime, leaving only the date.  I found info's script interesting!  When I had to do this I converted the date to varchar and back again instead of to float.  Seems to work fine for me.

You rated this post out of 5. Change rating

2003-04-03

116 reads

SQLServerCentral Article

Gathering Random Data

  • Article

Brian Knight recently had the basic need to retrieve a record from the database at random. What seemed to be an easy task quickly became a complex one. This case showed an interesting quirk with T-SQL that was resolved in an equally quirky way. This quick article shows you a method to retrieve random data or randomize the display of data.

5 (1)

You rated this post out of 5. Change rating

2003-03-26

9,340 reads

Technical Article

Weekly Reports Made Easy

  • Script

Each week you are required to run various reports based on table entries made during the week preceding latest Sunday. Use this SQL7/2000 procedure (can be a UDF in SQL2K) to retrieve the latest midnight of a specified day of the week as illustrated below: Declare @StartDate datetime, @EndDate datetime Exec DBAservice.dbo.uspGetLatestWkDayMidnight @pDate = '1998-05-06', […]

You rated this post out of 5. Change rating

2003-03-13

306 reads

Blogs

A New Word: Incidental Contact High

By

incidental contact high – n. an innocuous touch by someone just doing their job...

Azure PostgreSQL Flexible Server and Entra Groups

By

My company is moving from an Azure PostgreSQL single server to a flexible server....

Take the 2025 State of Database Landscape Survey

By

The survey is out now and you can share your experiences for a chance...

Read the latest Blogs

Forums

GIT Configuration and Automated Release for Azure Data Factory

By Sucharita Das

Comments posted to this topic are about the item GIT Configuration and Automated Release...

How to Add a New Shared Disk to a WSFC as a SQL Resource

By muhkam

Comments posted to this topic are about the item How to Add a New...

Knowing What You Don't Know

By Louis Davidson (@drsql)

Comments posted to this topic are about the item Knowing What You Don't Know

Visit the forum

Question of the Day

Am I on Synapse?

How can I tell from T-SQL if I'm connected to SQL Server or Synapse Analyics?

See possible answers