Comments
Sort by recent activity
(I'm only a FoRG, not a Redgate employee.) The Error handling system in a SQL Compare script is there to prevent the script from carrying on after an error. Generally, you really shouldn't want it to carry on. The option removes this system in the scripts that catches those errors that do not otherwise automatically stop the batch or the entire script from being executed. The idea is to ensure that even an apparently trivial error rolls the script back. Unfortunately, some SQL Server errors can't be caught this way. The only way to prevent more serious errors, up to level 20 stopping the script is to use a try...catch block for every block or batch, but even then, you won't catch all errors, and I doubt whether it would have caught the one you had. . An object name resolution error is not caught by the TRY...CATCH construct. / comments
(I'm only a FoRG, not a Redgate employee.) The Error handling system in a SQL Compare script is there to prevent the script from carrying on after an error. Generally, you really shouldn't want it ...
I'll answer my own question about how to get a group. There is another Cmdlet called Get-SQLMonitorMainGroups that seems to do what I want. One then gets subgroups using Get-SqlMonitorSubGroups. I'm still mystified about what Get-SQLMonitorGroup does. / comments
I'll answer my own question about how to get a group. There is another Cmdlet called Get-SQLMonitorMainGroups that seems to do what I want. One then gets subgroups using Get-SqlMonitorSubGroups. I'...
This should do it. Sorry about the quotename stuff. I hardly ever seem to use columns with illegal characters in them. I meant to add something clever that added the quotes only when necessary but never got around to it. This should work nicely
/**
Summary: >
This is a temporary batch for creating such things as table variable,
temporary tables or anything else that needs a column list
Author: Phil Factor
**/
Declare @TheExpressionNVARCHAR(MAX)=
N'$SELECTEDTEXT$'
SELECT 'DECLARE @$NameOfVariable$ table ('+
Stuff ((SELECT ',
'+QuoteName(Coalesce(DetectDuplicateNames.name+'_'+Convert(VARCHAR(5),f.column_ordinal),f.name))
+ ' '+ System_type_name + CASE WHEN is_nullable = 0 THEN ' NOT' ELSE ''END+' NULL'
--+ CASE WHEN collation_name IS NULL THEN '' ELSE ' COLLATE '+collation_name END
AS ThePath
FROM sys.dm_exec_describe_first_result_set
(@TheExpression, NULL, 1)AS f
-- use sys.sp_describe_first_result_set for a batch
LEFT OUTER JOIN
(SELECT name AS name FROM sys.dm_exec_describe_first_result_set
(@TheExpression, NULL, 0) WHERE is_hidden=0
GROUP BY name HAVING Count(*)>1) AS DetectDuplicateNames
ON DetectDuplicateNames.name=f.name
WHERE f.is_hidden=0
ORDER BY column_ordinal
FOR XML PATH (''), TYPE).value('.', 'varchar(max)'),1,1,'')+')' / comments
This should do it. Sorry about the quotename stuff. I hardly ever seem to use columns with illegal characters in them. I meant to add something clever that added the quotes only when necessary but...
Yes, it is certainly good to cater for those application developers who are more comfortable with a migrations approach, and Flyway is a popular system. I hope that Redgate continues to ensure that SCA offers give first-class features and support for the 'static' approach to database deployment, which is more popular with database developers / comments
Yes, it is certainly good to cater for those application developers who are more comfortable with a migrations approach, and Flyway is a popular system. I hope that Redgate continues to ensure that...