Anonymous Test User


Technical Article

Retrieve column attributes

Given database, owner, table, and column names, this procedure returns one from among several column attributes such as type definition, defaults, and other types of constraints.  E.g., to retrieve the type definition of the 'pubs' database's 'author.address':DECLARE @attrib VARCHAR (500)      , @msg    VARCHAR (8000)EXEC p_get_column_attribute 'TYPEDEF'              […]

5 (1)

You rated this post out of 5. Change rating

2002-07-24

121 reads

Technical Article

Count # occurrences of one string inside another

Scalar function 'f_contains' counts the number of times the first argument occurs within the second argument.Given:  @arg1, @arg2 (both VARCHAR), @cnt INTSELECT @cnt = dbo.f_contains (@f_search_for = @arg1                            , @f_container  = @arg2)

1 (1)

You rated this post out of 5. Change rating

2002-07-22

370 reads

Technical Article

Slice out string from within specified delimiters

Scalar function 'f_delimited' slices out of a passed-in string, from a specified position inside the string, that segment of it which is delimited on one or both sides by a specified delimiter.Example:  Print out a segment of a 'syscomments.text' column for a stored procedure 'p_proc', representing a line of code (i.e., the segment of 'syscomments.text' […]

You rated this post out of 5. Change rating

2002-07-22

102 reads

Technical Article

String-search on objects in a specified database

Procedure 'p_find_string' allows users to specify any database on a server in searching for a specified character string.  Supported for string-searching:  table columns, view columns, trigger, function, and procedure code.  Produces a report showing: object type, owner, object name, column id (for tables and views) or what line number (for triggers, functions, and procedures), and […]

You rated this post out of 5. Change rating

2002-07-22

119 reads

Technical Article

Scalar Function to Determine Age at a Given Date

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,009 reads

Blogs

How Redgate Flyway Can Boost Your DevOps Journey

By

A brief introduction to the tool and its advantages for database migrations DevOps is...

Building a Docker image with Docker Build Cloud

By

In a previous blog post we went through how to build a Docker container...

Top 8 Courses to Learn SQL for Data Science in 2024 & Beyond

By

Businesses are drowning in data, but starving for insights. That's where SQL experts swoop...

Read the latest Blogs

Forums

How to compare data in customer table with other customers to find related cust

By Zond Sita

select Custno, Addr1, City, Res_Phone, Bus_Phone, Fax_Phone, Marine_Phone, Pager_Phone, Other_Phone, email1, email2 from customer...

process records in loop

By Bruin

I'm only processing 50,000 records not everything from the Table where there are 250,00...

The Marked Transaction

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Marked Transaction

Visit the forum

Question of the Day

The Marked Transaction

I want to mark a transaction in the log as a recovery point. How do I do this in my code if I use the transaction, myTran?

See possible answers