https://www.robotics.org.za/index.php?route=product/product&product_id=182
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Find Type Here | |
--SELECT * FROM sys.Types | |
DECLARE @CurrentTypeName NVARCHAR(50) = 'float' | |
DECLARE @NewTypeName NVARCHAR(50) = 'decimal' | |
DECLARE @Nullable VARCHAR(8) = 'NOT NULL' | |
--Type specific Variables | |
DECLARE @DecimalPrecisionAndScale NVARCHAR(10) = '(18,2)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM sys.tables st | |
LEFT JOIN sys.key_constraints kc on kc.parent_object_id = st.object_id and kc.type = 'PK' | |
WHERE kc.name is null | |
order by st.name asc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM sys.tables st | |
INNER JOIN sys.columns sc on sc.object_id = st.object_id | |
WHERE | |
sc.name = '' and st.name = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE TOCURSOR CURSOR FOR | |
SELECT('SELECT * FROM ' + name + ';') | |
FROM sys.tables | |
UNION ALL | |
SELECT('SELECT * FROM ' + name + ';') | |
FROM sys.views | |
DECLARE @query NVARCHAR(MAX) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE TOCURSOR CURSOR FOR | |
SELECT('SELECT * FROM [' + name + '];') | |
FROM sys.tables | |
--FROM sys.views | |
ORDER BY name ASC | |
DECLARE @query NVARCHAR(MAX) | |
OPEN TOCURSOR | |
FETCH NEXT FROM TOCURSOR INTO |