Script to get tables which have primary key
There isn't a convenient sp or tool in sql server to find out all the tables in a database which have primary keys. This script can help you to list all the tables with primary keys.
2002-10-21
466 reads
There isn't a convenient sp or tool in sql server to find out all the tables in a database which have primary keys. This script can help you to list all the tables with primary keys.
2002-10-21
466 reads
I got this script from this site and it works fantastic. I would just like to give an update to this script. All credit should go to the person that published this script on this site not me. I would just like to point out a few things. If you want to schedule this as […]
2002-10-18
445 reads
Have seen existing scripts to work out number of days in month. They tend to work out the month, and then whether it's a leap year.Another approach is to take the date passed in, find the first day of the next month, and then use Datadd to take off one day, ie: last day of […]
2002-10-17
458 reads
How many times have you seen @@version return a number but failed to interpret what service pack it is? Although SQL 2000 gives a gift (SERVERPROPERTY) of querying a readable value, my script will remedy the puzzle and show more parameters such as CPU speed, memory, windows version, and installation date. The limitations are:1. MSDE […]
2002-10-16
469 reads
This SP will only work on SQL Server 2000 and can be placed in your master database. sp_CreateAndExecTableScript is designed to script one table and create an identical table. I designed it to use with DTS packages so that I can create an identical table with a different name, pump data into the table and […]
2002-10-15
2,563 reads
Fixed user protion of the script. Sorry had the test script mixed with prod. I was asked to create a report listing all of our SQL Servers, and the databases on them. I was also asked to list everyone that has access to each database and whether it was a standard, windows or windows group […]
2002-10-15
1,069 reads
The script allows you to prepare an xml document as you would use the sp_xml_preparedocument but by specifying a SQL statement. i.esp_xml_preparedocumentfromcolumn @iDoc OUTPUT, 'SELECT TOP 1 documentColumn From myTable'
2002-10-12
587 reads
A user defined function to return a table af tokens from a delimited string.Uses text variable so string can be of unlimited length, performs better than a list of xml elements. Now supports returning of tokens by position
2002-10-12
818 reads
This script will create a standard format file for a specified table for use with bcp or Bulk Insert.
2002-10-09
1,408 reads
I wanted to be able to prepare a script of User Roles and permissions for objects in a database so I can be prepared for backup and disaster recovery scenarios. I also wanted to be able to audit the permissions for each role.I wrote this stored procedure to do this. The usage is:Use NorthwindgoDECLARE @RC […]
2002-10-09
969 reads
One of my favourite features of SQL Server 2022 was the T-SQL Snapshot Backups....
By Steve Jones
I have said and written this many times: Redgate Software is the type of...
By SQLPals
How to Check TDE Progress and Elapsed Time in SQL Server ...
Comments posted to this topic are about the item Squared Values
Comments posted to this topic are about the item I Don't Want To Do...
Comments posted to this topic are about the item Managing Feature Flags with GET_BIT()...
What happens when I run this code in SQL Server 2022?
SELECT SQUARE('12') See possible answers