Find Users in a Database
This script would help you find users, their logins, roles etc in a database.
2002-04-01
341 reads
This script would help you find users, their logins, roles etc in a database.
2002-04-01
341 reads
Under special circumstances, it could happen that database contains "orphan" records. Data in dependant table exists without it's "parent" record in a master table. It could be caused by a bulk insert operation without CHECK_CONSTRAINTS option, or by disabling foreign key for a while or adding a foreign key to a table that already contains […]
2002-03-27
207 reads
This article looks at the T-SQL CAST function and how it is used and preferred to CONVERT().
2002-03-18
16,799 reads
By using this script one can find number of rows for each and every table in a database. Just cut and past this script in your DB and excute. A stored procedure will be created as 'Get_rowcounts_for_eachtable'. If U excuted this stored procedure, U can get all tablenames and rowcounts for respected […]
2002-03-07
584 reads
list all user tables,stored procedures involving these tabels and the scrips of these procedures
2002-02-21
560 reads
I find phone numbers to be the messiest data that users enter. There are so many variations with brackets that I wrote this UDF to help clean up the data. Usage: SELECT Firstname , SURNAME , udfStripBracket(PHONENUMBER) AS BracketlessNumber FROM dbo.UserContact
2002-02-05
267 reads
Is a SP that imports a table to a file. You just put the table name, the path and the sa password and then you have it. It is important that it parse the table inserted (pubs.dbo.sales for example) and checks that the db, the table with the owner exists
2002-01-28
1,679 reads
Here in this T-sql tip I'am trying to compare the word "Hijacker" with two cases(line 3 and 4). Now they are in same when you compare the case (letter to letter), now you change the case of word "Hijacker" in either of the lines and run this SQL statements it will return different results. This […]
2002-01-05
672 reads
Generates a series of drop statements for all objects of the input type (e.g., 'U' for User Tables). Install in the master database.
2002-01-04
348 reads
Usually when we recreate or rename a table we need to give the appropriate access permissions to the SQL users...this is very common in database under development environment where frequently table structure changes and we have to recreate it....we can accomplish this with Enterprise Manager but what will you do if Enterprise Manager fails to […]
2001-12-18
831 reads
I thought I didn’t care about linting, and lately, I haven’t written a lot...
Want to blend your love of marketing with the power of data? Becoming a...
I live for questions and this was an interesting one. Can you see Table...
Comments posted to this topic are about the item Dynamic T-SQL Script Parameterization Using...
I am able to successfully create managed identity on Azure SQLMI & Azure...
Comments posted to this topic are about the item Lower Your Attack Surface Area
What is returned when I run this code in SQL Server 2022?
CREATE TABLE CatIndex ( indexval VARCHAR(20) ) GO INSERT dbo.CatIndex (indexval) VALUES ('1'), ('2'), ('3') GO SELECT CHOOSE(indexval, cast('2025-01-01' AS DATE), CAST('2025-02-01' AS DATE), CAST('2025-03-01' AS DATE)) FROM dbo.CatIndex AS ciSee possible answers