Table count for non-system dbs
This script returns the table count for all non-system dbs on the server it is run against.
2002-10-09
300 reads
This script returns the table count for all non-system dbs on the server it is run against.
2002-10-09
300 reads
This Procedure generates 3 triggers (for Insert, Update & delete). The purpose of these triggers is to keep a SIMPLE audit trail. Create the table and the procedure in the database to which you want to have the auditing facility. To include a table for auditing run the procedure with Table Name as the parameter.
2002-10-09
1,208 reads
My stored procedure, sp_dbsettings, allows you to view, in a cross-tabular format, all the common options and their values for all the databases on your server. Optionally, you can pass a database name as an argument if you just want to view the settings for one database (i.e., EXEC sp_dbsettings 'Northwind'). Otherwise it shows info […]
2002-10-09
660 reads
I submit this script as an example of how one might go about generating 'Alter Table' statements that find and replace specific column constraints. In my case I had to find all occurrences in a production db of suser_name() as a column constraint and replace it with suser_sname(). This script is only an example and […]
2002-10-08
277 reads
Get All the Table Details in a Database in a Second By Running sp_table_info. This procedure will give the No. of row , reserved space , data space , index space and Unused space. Compile the Procedure in Master Database and access it from any other database. We can use it for a single table […]
2002-10-08
510 reads
After going through development and test cycles it can be laborious to have to go and reset identity properties on tables (Yawn!!) So I wrote a script to do it. It has two parameters database name and identity start value. It basically checks the identity value with the number of rows in the table. if […]
2002-10-06
342 reads
The usual practice, when we need some test data, is to employ the pseudo-random built-in function RAND(). We usually use it to produce a random value in some range and it produces these values with the same probabilities. Sometimes we need more "realistic" data when some values are more probable than others are. In this […]
2002-10-04
290 reads
Pivot a table from vertical rows to horizontal results with a single select statement; no cursor.
2002-10-04
2,424 reads
Ever needed to pause in a SQL script? Or wanted to simulate a long running process for testing? This stored procedure accepts an integer and pauses for that many seconds.
2002-10-04
1,251 reads
I use this script on some (not all) databases to backup the Logs when they reach a certain level of being full. For example, when the log is 60% full the log will be backed up.Change the ????? values and this script is ready to go.
2002-10-03
579 reads
By Steve Jones
gnossienne– n. the awareness that someone you’ve known for years still has a private...
How I used AI for this postChatGPT to generate images based on info specifically...
By Brian Kelley
A few months ago I started using Deepstash. Deepstash breaks books into the key...
Comments posted to this topic are about the item Understanding Temp Tables and Table...
Comments posted to this topic are about the item The Data API Builder MCP...
Comments posted to this topic are about the item Collecting Data Is Hard
The Data API Builder MCP Server, v2.x, includes a number of tools. What actions can these tools perform in your database?
See possible answers