Miscellaneous

Technical Article

fnCharPad

  • Script

This function allows the user to pass in a string / character value and it     will padd the value according to given parameters. The parameters are as follows:@ValueToPad = Value to be padded by function.@PadCharacter = Character used to pad a given value.@Justification = Justification format bit 0 - Value will be RIGHT justified […]

You rated this post out of 5. Change rating

2002-09-06

264 reads

Technical Article

Recompile all Udf's associated with a Table

  • Script

When altering the structure of tables it is good practice to run SP_RECOMPILE against the table to force triggers and stored procedures to recompile. However this does not incude Udf's which also rely on the table, and this means the Udf's may fail when they are called. Run this script and supply the table name […]

You rated this post out of 5. Change rating

2002-09-05

353 reads

Technical Article

Show valuable info from sysindexes

  • Script

This sp (sp_sysindexes) captures important columns from the table sysindexes and translates the numeric values into text. It shows the owner.object, the filegroup which it belongs to, the type of index, the total number of pages for tables/clustered indexes and non clustered indexes. It also shows the status, the indid and the type of object.You […]

3.5 (2)

You rated this post out of 5. Change rating

2002-09-01

3,709 reads

Technical Article

Compare the data of 2 Tables (Updated)

  • Script

The SP compares the data in 2 tables and reports the different data. Tables could be from different servers, different databases or different schemas. This accepts 7 parameters 1, 2: Name of the 2 tables 3 : List only the differences 4. : Compare only the structure 5. : Check timestamp fields too 6. : […]

5 (1)

You rated this post out of 5. Change rating

2002-08-17

1,381 reads

Technical Article

Using a MEMORY table as an array

  • Script

I liked the script of using a table as an array. But Didn't liked the cursor in it so I rewrote the script so that it uses a memory table.I tested it in the Query analyzer and this one is indeed faster. So all the people out there yelling that a memory table is faster […]

You rated this post out of 5. Change rating

2002-08-07

1,227 reads

Technical Article

Comparing Contents of 2 tables in T-SQL

  • Script

How can you compare two tables -- say, table A and table B  and determine if their content is the same? Assuming that A and B have same structure, here's how:First, from set theory, recall that: If ((|A| = |B|) && |A U B| = |A|)) ====>>>  A = B |A| = NUMBER of rows […]

You rated this post out of 5. Change rating

2002-08-07

1,472 reads

Technical Article

Retrieve every n values

  • Script

this scripts presents the way to retrieve from a given result set the values given n where n determines that the Nth value,2N th values , 3Nth value will be returnedin the example n = 3 the returning rows are 22,32,42the given set is 20,21,22,30,31,32,40,41,42

You rated this post out of 5. Change rating

2002-08-01

435 reads

Blogs

The Book of Redgate: Customer Quotes

By

Many organizations list customer testimonials and quotes on their websites or literature. It makes...

Using Cron in Postgres Flex

By

pg_cron is a simple cron-based job scheduler for PostgreSQL that runs inside the database...

Can I Change a Primary Key Value? #SQLNewBlogger

By

I heard someone say recently that you can’t change a primary key value in...

Read the latest Blogs

Forums

Life Moves Pretty Fast

By Grant Fritchey

Comments posted to this topic are about the item Life Moves Pretty Fast

Parse XML data from SQL table using temp tables and variables

By Lord Slaagh

Hello SSC, Happy Friday! I have to optimize a process that uses dynamic SQL...

50 Years of Microsoft

By Steve Jones - SSC Editor

Comments posted to this topic are about the item 50 Years of Microsoft

Visit the forum

Question of the Day

Multiple Collations

Can I have a collation expression like this in SQL Server 2022?

...
WHERE ColumnA = ( 'abc' COLLATE French_CI_AS) COLLATE French_CS_AS
...

See possible answers