Return Column as List of Comma Seperated Values
Need a comma seperated list of a particular column in a table. This will do the trick.
2003-11-03
615 reads
Need a comma seperated list of a particular column in a table. This will do the trick.
2003-11-03
615 reads
Not my script, but this script will transfer the logins to a new server or help you restore the in a DR situation with their correct passwords (encrypted).
2003-11-03
1,165 reads
This script Notifies the user(s) whenever there is an Error logged in the Error message. It excludes the Error messages 15457 and 1073759806. These 2 Errors can be ignored. (I know we like to keep our Elogs clean but for some time you need to yield to them J ). You’ll see the first error […]
2003-10-30
1,244 reads
This script will join a single selected column from a select statement into a varchar variable. This works similarly to the javascript join function with a few additional features. By default the values will be joined with commas unless an alternate delimiter is supplied. The user can specify if the delimited values should quoted. To […]
2003-10-30
549 reads
MSSQLServer has got sp_depends system sp to display the dependencies for a stored procedure, table and view. sp_depends does not support to display the User-defined data type dependencies. For custom database, we will create user defined data types (UDDT) and add this UDDT to a column/variable in a table/stored procedure. This sp (UDTDepends) will help […]
2003-10-30
463 reads
This sp is used to update index in a database. This sp has got three optional varchar parameters. First parameter will take the tablename. Second parameter will take the indexname. Third parameter will take the fillfactor. The following option we can execute the sp in a user database.1. exec StabilizeIndexIt will update all index in […]
2003-10-29
293 reads
This script allows for testing if rows will cause a primary key violations prior to inserting the data. Offending rows are stored in a table so they can be used in subsequent queries or used to debug bad data issues. This updated version adds a timestamp to the duplicates table so that identifying when the […]
2003-10-28
1,858 reads
Stored procedure that return range of data from any table without using temp table or cursors. You don't even need to use the IDENTITY field in your target table. Check out and comments are welcomed
2003-10-27
303 reads
Provides a method to regularly recycle the sql server error logs based on a given file size. If the current log file is larger than that size, then the current log is closed and a new log created.This proc takes one parameter, @MaxFileSize, which is the target file size. This parameter defaults to 10 MB. […]
2003-10-27
937 reads
It creates documentation for all user tables in a specific database. A server name/ database name was added on the top of the HTML file also a column datatype field was added to the HTML file. Now the @strHTML can have 8000 chars, before only 4000 - still for tables with a lot of columns […]
2003-10-27
687 reads
When I put together the invitation for T-SQL Tuesday #202, I wasn't sure what...
By Steve Jones
My life has some crazy travel stretches for sure. Between speaking, office visits, customer...
In Part 1, we saw how ‘Vamana’ represents vectors as nodes, connects them with...
Comments posted to this topic are about the item Implementing Type 4 Slowly Changing...
Comments posted to this topic are about the item Server-Level Table sizes
I run this code on SQL Server 2022.
CREATE TABLE Drink
(
drinkid INT NOT NULL
CONSTRAINT DrinkPK PRIMARY KEY CLUSTERED,
drinkname VARCHAR(20),
rating NUMERIC(2, 1)
)
GO
INSERT INTO Drink
(
drinkid,
drinkname,
rating
)
VALUES
(1, 'Margarita', 4.5),
(2, 'Mojito', 4.3),
(3, 'Old Fashioned', 4.7),
(4, 'Martini', 4.4),
(5, 'Cosmopolitan', 4.2)
GO
ALTER INDEX drinkpk ON dbo.drink DISABLE
GO
SELECT * FROM dbo.Drink
GO
What is the result? See possible answers