Comments (3)
That's odd, doesn't happen on my machine (I see the MERGE statement between line 10-12). Are you specifying any other params other than @table_name
/ @schema
?
from generate-sql-merge.
I apologize - that's a particularly horrible bug request, with nowhere near enough detail. Please close it and I'll request a re-open if I encounter the issue again.
To answer your question, though, my command would have been one of these two:
exec sp_generate_merge @table_name='Domains', @include_use_db=0, @nologo=1, @cols_to_include="'DomainID', 'ParentDomainID','DomainName','DomainDescription','AvailableToAutomation'"
or
exec sp_generate_merge @table_name='Systems', @include_use_db=0, @nologo=1
The first table's DDL:
CREATE TABLE [dbo].[Domains] ( [DomainID] INT IDENTITY (1, 1) NOT NULL, [ParentDomainID] INT NULL, [DomainName] VARCHAR (32) NOT NULL, [DomainDescription] VARCHAR (255) NULL, [AutomationHoldDate] DATETIME NULL, [AvailableToAutomation] BIT DEFAULT ((0)) NOT NULL, [TestingReleaseDate1] DATETIME NULL, [TestingReleaseDate2] DATETIME NULL, [TestingReleaseDate1Color] VARCHAR (16) NULL, [TestingReleaseDate2Color] VARCHAR (16) NULL, [AIOQCompleteDate] DATETIME NULL, [AIOQCompleteDateColor] VARCHAR (16) NULL, [TestingRelease1ScheduleLink] VARCHAR (32) NULL, [TestingRelease2ScheduleLink] VARCHAR (32) NULL, [AIOQCompleteScheduleLink] VARCHAR (32) NULL, [PQStartDate] DATETIME NULL, [PQStartDateColor] VARCHAR (16) NULL, [PQStartScheduleLink] VARCHAR (32) NULL, CONSTRAINT [pkc_Domains] PRIMARY KEY CLUSTERED ([DomainID] ASC), CONSTRAINT [fk_ParentDomainID@Domains] FOREIGN KEY ([ParentDomainID]) REFERENCES [dbo].[Domains] ([DomainID]), CONSTRAINT [uni_DomainName@Domains] UNIQUE NONCLUSTERED ([DomainName] ASC) );
Second table's DDL:
CREATE TABLE [dbo].[Systems] ( [SystemID] INT IDENTITY (1, 1) NOT NULL, [SystemName] VARCHAR (32) NOT NULL, [SystemDescription] VARCHAR (128) NOT NULL, [DomainID] INT NULL, CONSTRAINT [pkn_SystemID] PRIMARY KEY NONCLUSTERED ([SystemID] ASC), CONSTRAINT [fk_DomainID@Systems] FOREIGN KEY ([DomainID]) REFERENCES [dbo].[Domains] ([DomainID]), CONSTRAINT [uci_SystemName@Systems] UNIQUE CLUSTERED ([SystemName] ASC) );
My thought at this time is that it's an issue in SSMS. I say this because the names are probably very bad ideas (e.g. I've one named Tasks which screws up the SSMS diagramming tool).
In any event. I promise to be better at documenting next time.
from generate-sql-merge.
No worries at all David, appreciate the follow-up. Interestingly, I still can't reproduce the error with the code provided, so perhaps there is a client issue involved (e.g. SSMS configuration and/or SQL client-specific issue). Do let me know if it continues to be problematic, however.
from generate-sql-merge.
Related Issues (20)
- Ability to handle multiple tables
- define source by query HOT 1
- Creation error in Azure Sql server database HOT 2
- Column names and tabs HOT 2
- Enhancement Request : Create Merge statement with JSON parse (with an option) HOT 2
- Merge statement fails when used for processing bigger tables HOT 3
- @cols_to_exclude longer than 128 chars HOT 4
- sql_variant => invalid statements, basetype needs to be checked and used HOT 2
- Add reference to examples in readme.md? HOT 2
- Ambiguous column name when same column is in two tables HOT 2
- Issue with composite key and order in values HOT 2
- Using '@include_rowsaffected = 0' causes error "A MERGE statement must be terminated by a semi-colon (;)" HOT 1
- Support for Managed Instance - cant find sp_MS_marksystemobject HOT 1
- SQL Server v2019 issues HOT 3
- QUOTED_IDENTIFIER error HOT 1
- case sensitive update HOT 1
- Case mismatch object_id column name HOT 1
- Error Occurs When Verifying the Existence of the 'hashedvalue' Column HOT 1
- instruction(x)' contains an invalid XML identifier as required by FOR XML HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from generate-sql-merge.