Comments
Sort by recent activity
Thanks! I'll try that. / comments
Thanks! I'll try that.
Our scenario is one in which we have hundreds of production databases of identical schema structure. It would be good to have a mechanism to collect this invalid object information periodically to help troubleshoot potential deployment issues in our environment. / comments
Our scenario is one in which we have hundreds of production databases of identical schema structure. It would be good to have a mechanism to collect this invalid object information periodically to...
I was able to work around this by replacing the specific named constraint drop blocks with a pattern like this, if anybody is interested.
DECLARE @ConstraintName NVARCHAR(200)
SELECT @ConstraintName = Name
FROM
SYS.DEFAULT_CONSTRAINTS
WHERE
PARENT_OBJECT_ID = OBJECT_ID(N'<tablename>')
AND PARENT_COLUMN_ID =
(
SELECT
column_id
FROM
sys.columns
WHERE
NAME = N'<columnname>'
AND object_id = OBJECT_ID(N'<tablename>')
)
IF @ConstraintName IS NOT NULL
BEGIN
EXEC('ALTER TABLE <tablename> DROP CONSTRAINT ' + @ConstraintName)
END / comments
I was able to work around this by replacing the specific named constraint drop blocks with a pattern like this, if anybody is interested.
DECLARE @ConstraintName NVARCHAR(200)
SELECT@ConstraintName...
Yes Eddie, clearing the Dependencies checkbox removed the deselected items. I figured it out after I logged the call. Was hesitant to do that since it is advised as recommended to keep it checked. / comments
Yes Eddie, clearing the Dependencies checkbox removed the deselected items. I figured it out after I logged the call. Was hesitant to do that since it is advised as recommended to keep it checked.
Here is a simplified version of what produces the doubled output. I tested it by removing the @FailMsg parameter and it is still doubled.
-- Tests the case of no rows returned from the dependent tables referenced by SELECT
-- For test case examples, see: http://tsqlt.org/user-guide/tsqlt-tutorial/
ALTER PROCEDURE [DependentTablesTests].[test no rows in SELECT]
AS
BEGIN
IF OBJECT_ID('expected') IS NOT NULL DROP TABLE expected
--Assemble
DECLARE @CID NVARCHAR(50)
SET @CID = '7000'
DECLARE @JID INT
SET @JID = 7000
EXEC tSQLt.FakeTable 'dbo', 'tblJC'
INSERT INTO dbo.tblJC
( JobID ,
ClientID ,
Cost
)
VALUES ( @JID , -- JobID - int @CID , -- ClientID - nvarchar(50)
0.0 -- Cost - float
)
SELECT
*
INTO expected
FROM
dbo.tblJC
--Act
EXEC dbo.Proc_TESTED_CODE @JID, @CID
--Assert
EXEC tSQLt.AssertEqualsTable @Expected = N'expected', -- nvarchar(max) @Actual = N'dbo.tblJC', -- nvarchar(max) @FailMsg = N'Table tblJC actual does not match expected' -- nvarchar(max)
END; / comments
Here is a simplified version of what produces the doubled output. I tested it by removing the @FailMsg parameter and it is still doubled.
-- Tests the case of no rows returned from the dependent ...
Sure, let me know how it works. / comments
Sure, let me know how it works.