Miscellaneous

Technical Article

Retrieve default value for parameter in procedure

  • Script

This procedure will return DEFAULT value for the parameter in the stored procedure. Usage: Use pubs go declare @Value varchar(30) exec _GetParamDefault 'random_password','@password_type',@value OUTPUT SELECT @VALUE Also accepts different versions, by default, if not specified, first version info retrieved. exec _GetParamDefault 'random_password;2','@password_type',@value

You rated this post out of 5. Change rating

2002-05-10

327 reads

Technical Article

Scalar Function to Determine Age at a Given Date

  • Script

This function was written to supplant cumbersome age-at calculations.  To execute, simply set a local INT variable equal to the output of the function.  For example, the following, given my birthdate, computes my own age:    DECLARE @age_at INT    SET @age_at = dbo.f_age_at ('2/16/1954', GETDATE ())

You rated this post out of 5. Change rating

2002-05-09

1,036 reads

Technical Article

Update existing user accounts default language.

  • Script

When changing the default language of a server it is neccessary to run sp_defaultlangauge against any existing logins. The reason is default language only effects any new accounts created after this change is made. This script is designed to help you quickly make the adjustment for all existing accounts. Note: this has been tested under […]

You rated this post out of 5. Change rating

2002-05-09

122 reads

Technical Article

User defined function to parse delimited strings

  • Script

This UDF parses a comma delimited string and returns a table with the parse strings as rows. Usage:  select * from fn+PareseString('12,13,14,67')Will return a table with the following rows12131467Can be modified to have an additional parameter for the type of delimiter.

You rated this post out of 5. Change rating

2002-05-07

893 reads

Technical Article

Cursorless Cursor

  • Script

Here is as sample of implementing cursor.In some cases my tests showed that this approach performs better than native cursors in SQL Server.All you have to do is move the dataset into a temp table with a new Identity column and then use a simple loop to extract the data as you would do normally […]

4.5 (2)

You rated this post out of 5. Change rating

2002-05-06

1,966 reads

Blogs

Have a Plan for Your Personal Downtime

By

Most of us know that spending a lot of time on social media and...

Monday Monitor Tips: Lots of Postgres Options

By

Redgate Monitor is growing to include more than just Microsoft SQL Server monitoring. We...

Advice I Like: Experience and Aptitude

By

Experience is overrated. Most breakthrough accomplishments were done by people doing them for the...

Read the latest Blogs

Forums

why no suggested indexes in estimated exec plan?

By stan

hi im looking at a query for a friend that has to be lacking...

Table Index Size

By Sandir

Comments posted to this topic are about the item Table Index Size

Issues with SQL Server 2022 Server

By alisonwheeler

Hello, At my work place I recently migrated our test environment to SQL Server...

Visit the forum

Question of the Day

Data API Builder APIs

What formats of API endpoints can the Data API Builder present to clients when exposing the database?

See possible answers