Miscellaneous

Technical Article

Change the User Defined Data type

  • Script

User Defined Data Types (UDF) is one of the useful concepts in SQL Server. However UDF can't be modified after they are being used. You would have to remove your User Defined Data Type from each table before you can change it. This will be a big job under certain circumstances.This procedure changes all tables […]

You rated this post out of 5. Change rating

2002-04-19

1,008 reads

Technical Article

Write Reports from SQL to Disk (Even HTML!)

  • Script

Ever need to write reports out to a folder? I have found that creating output files are SA-WEET! (and easy too) The sample script uses BCP to create an HTML file.This process works well for reports that need to be generated nightly and take too long to run in real time.  Use an SMTP mail […]

You rated this post out of 5. Change rating

2002-04-18

4,380 reads

Technical Article

Truncating and deleting all tables in a database

  • Script

Sometimes, during test stage, you may need to truncate or delete all your tables in a database, without droping constraints, truncating and recreating constraints (DRI). You can use the TRUNCATE TABLE statement to removes all rows from a table without logging the individual row deletes, but tables referenced by a FOREIGN KEY constraint can not […]

4.67 (3)

You rated this post out of 5. Change rating

2002-04-17

1,563 reads

Technical Article

Decimal to Binary Conversion for event scheduling

  • Script

This procedure was written to create an event schedule     where the schedule may have non-consecutive days.    The input for the procedure is START DATE, END DATE, and DAYMAP    The DAYMAP input parameter is a decimal number whose binary representation    describes the schedule days over potentially a 4 week period (read from right to left).    […]

You rated this post out of 5. Change rating

2002-04-17

298 reads

Technical Article

Get users permissions with mapping thru role.

  • Script

This procedure is similar to sp_helpprotect except to extends a bit on the concept with roles involved. If for instance a user has right on a TableX but they are not mapped directly to the user but instead to a role then sp_helpprotect does not tell you this. This will tell you how the user […]

You rated this post out of 5. Change rating

2002-04-16

1,708 reads

Technical Article

List of triggers in a database

  • Script

Give the following information, about triggers in the database.Parent_Name      Parent_Type Name                         Type               Insert Update Delete IsFirstInsertTrigger IsFirstUpdateTrigger IsFirstDeleteTrigger IsLastInsertTrigger IsLastUpdateTrigger IsLastDeleteTrigger

4.5 (2)

You rated this post out of 5. Change rating

2002-04-16

829 reads

Technical Article

Preventing accidental overwrites with update SPs

  • Script

Say you wanted to create an SP for updating records in a database.  How would you do this in such a way as to allow your users to edit only a subset of fields in the record, without overwriting the other fields, and without requiring verbose IF blocks and CASE statements in your code?Simple.  Use […]

You rated this post out of 5. Change rating

2002-04-16

202 reads

Blogs

Automated SQL Server Benchmarking with HammerDB and Docker: A Complete Testing Framework

By

I’m excited to announce the release of a new open-source project that fully automates...

Automated SQL Server Benchmarking with HammerDB and Docker: A Complete Testing Framework

By

I’m excited to announce the release of a new open-source project that fully automates...

Advice I Like: Praise

By

Don’t reserve your kindest praise for a person until their eulogy. Tell them while...

Read the latest Blogs

Forums

Is there a way to have dynamic table headers?

By water490

Hi everyone I have a SP which compares two tables and outputs mismatching entries:...

Learning a New Language

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Learning a New Language

is there a way to "detect" schema like changes on a server?

By stan

Hi, we have a few people who like to experiment on our prod sql...

Visit the forum

Question of the Day

Copying Production Schema

If I use DBCC CLONEDATABASE, can I remove some of the information from the copy?

See possible answers