Activity overview
Latest activity by bootieday
Thanks! I'll try that. / comments
Thanks! I'll try that.
SpyProcedure not logging
I have SpyProcedure calls in my unit tests but do not see the corresponding tables being created in my unit test database. Why? How to troubleshoot this issue?
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...
Invalid object detection - multiple databases
Is there any way possible to perform the "Find invalid objects" feature on multiple databases within a script?
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...
How to handle SQL system generated names
Here is the scenario I have to solve. I'm trying to create a rollback script using SQL Compare that can be applied generically to any database on a specified product version. The tool works great...
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.
Deployment wizard includes deselected objects
I ran a test scenario to create a deployment script that specifically excluded 4 objects. The script got created correctly and ran without a problem. I restored my original database, and tried to...
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 ...
Why do SQL Test Messages appear doubled?
When a unit test fails, I see output like this (for AssertEqualsTable test with my own Failure msg). Why does the mismatched data appear twice in the SQL Test Messages window?
Test Class: foo
Test...