Script to list object names on a given Filegroup
This script is useful when want find out the list of the object on a given filegroup.
2003-07-01
250 reads
This script is useful when want find out the list of the object on a given filegroup.
2003-07-01
250 reads
This function is based on a script by Tim Dietrich (tim@timdietrich.us) named format_height.sql. His function took what he called a decimal representation of a measurement and formatted it as feet and inches. In reality the input value was just a measurement formatted to look like a decimal number but it was not a true decimal […]
2003-06-27
100 reads
While we are exploring the possibility to build data-driven application whose GUI are all dynamically generated according to database objects' extended property, we find the system provided procedures: sp_addextendedproperty, sp_dropextendedproperty,sp_updateextendedproperty can add extended property to only one object each time, while fn_listextendedproperty can not let you search objects to display their extended property. […]
2003-06-27
502 reads
A proc which gets a list of all databases (Exluding "excluded" ones) and backs them up.The backup files are stored in the directory \DatabaseName\DatabaseName.bakUNC names are supported provided SQL Server has write access to the location.It deletes backups older than x (Current 3) days.This can be changed.Add a job to execute the script of proc […]
2003-06-26
719 reads
Sometimes you have to deal with denormalized database.And specially when links to another table are stored in oneof the fields as comma delimited list of IDs.This script shows how to make a single SELECT statement to fetch linked records
2003-06-23
321 reads
This script generates seril numbers (0, 1, 2, 3.4,,,)In this example I use 0 - 9999
2003-06-19
186 reads
This script will resize the data file of a passed in database name and filename by 10%. It can run in 3 modes.Resize, INFO, HELP. RESIZE is passed into parameter @Mode when we know the database name and file we wish to resize. INFO is passed in when we only know the database name and […]
2003-06-19
679 reads
This function takes a decimal representation of a height value and returns a properly formatted string value. For example, a height of 5 feet 9 inches, which would be passed in as the decimal 5.90, would be returned as 5'9". Similarly, a height of 4 […]
2003-06-18
1,758 reads
This script kills all the user sessions except its own.This T-SQL block can be converted into a stored procedure by adding following lines in the begining of the script - Create Proc Kill_Sessions As
2003-06-18
2,782 reads
Ever wanted to look at some ini setting from a stored procedure? I tried several forums and found that none of them has a script to read ini files from stored procedures.So here is my script, works in SQL2000. For SQL7, replace table variables with temporary tables.
2003-06-17
1,899 reads
A RAG pipeline that answers questions in the demo is not the same thing...
By Steve Jones
“A multitude of bad ideas is necessary for one good idea” – from Excellent...
Yesterday I gave a talk for MSSQLTips called “Building a DBA Agent for Your...
I've got a web application for my side business. I've added a SQL Server...
Comments posted to this topic are about the item Looking for New Blood
Comments posted to this topic are about the item Server-Level Row Counts for Tables...
Which number will the COUNT() return after executing the following statements:
DROP TABLE IF EXISTS #test; CREATE TABLE #test (id INT) INSERT INTO #test (id) SELECT * FROM GENERATE_SERIES(1, 3) AS gs ; ALTER TABLE #test ADD flag BIT CONSTRAINT DF_#test_flag DEFAULT 0; go UPDATE #test SET flag = 0 WHERE id = 1 UPDATE #test SET flag = 1 WHERE id = 2 INSERT INTO #test (id) VALUES (4) SELECT COUNT(*) FROM #test AS t WHERE flag = 0See possible answers