microsoft / microsoft/sql-server-samples

DeactivateTemporalTablesAfterDataLoad Fails to run

Open
#781 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
11.2k
Forks
9.1k
Avg merge
2d 7h
Merged PRs (30d)
14

Description

There seems to be a typo in the stored proc [DataLoadSimulation].[DeactivateTemporalTablesBeforeDataLoad] after loading it from the 2016+ database backup.

When running it I get a @Crlf is not declared error.
The relevant variable is declared on line 23:
DECLARE @<!-- -->CrLf nvarchar(2) = NCHAR(13) + NCHAR(10);
On line 145 you can find this line:
\+ @<!-- -->Indent + N'END;' + @<!-- -->Crlf + @<!-- -->CrLf
This happens 16 other places I think. Changing @Crlf -> @CrLf fixes it.

Unless I misunderstand how the stored procedure works I assume this is a typo.

Thanks

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the repository or the 2016+ database backup for [DataLoadSimulation].[DeactivateTemporalTablesBeforeDataLoad], then inspect the declarations around line 23 and the references around line 145. Check all reported occurrences for the casing typo and verify that the stored procedure loads and runs without the undeclared-variable error.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.