Hello all,
I have an interesting issue for you to think about.
I am developing a small-scale document management system that I am developing with Access and SQL server, and I'm trying to get round the following issue:
I have a 'Document' table with an ON CREATE trigger that creates tables in various other databases with the following code:
IF OBJECT_ID ('dbo.'+@docID, 'U') IS NULL
BEGIN
CREATE TABLE [dbo].[newDocumentType](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Pattern] [nvarchar](100) NOT NULL,
[Replacement] [nvarchar](100) NOT NULL,
[UseWildcards] [bit] NULL DEFAULT ((0)),
[CaseSensitive] [bit] NULL DEFAULT ((1)),
[Style] [nvarchar](20) NULL
) ON [PRIMARY]
EXEC sp_rename [newDocumentType], @docID
END
This works fine, although I get a warning "Caution: Changing any part of an object name could break scripts and stored procedures", which is normal.
The front end of the system, for legacy reasons, is in MS Access.
Everything is fine when I create a 'document' through Access.
But I figure if I am creating lots of these I want a batch-import function that runs a StoredProc with an INSERT on the 'Document' table. This StoredProc runs fine from Management Studio. The problem I have is that Access seems to be stopping after it gets this warning message and I can't get it to carry on.
I have tried the DoCmd, but that doesn't really seem to help.
When I use that, my code will run over the list of items I am trying to INSERT, but it won't finish running the StoredProc.
From what I have read, this is a level 10 error, so SQL Server treats it as a non-fatal error, hence why it works in Management Studio.
I would be grateful for any helpful insights into how to get this working, as I am really stuck!
Many thanks,
Ed
I have an interesting issue for you to think about.
I am developing a small-scale document management system that I am developing with Access and SQL server, and I'm trying to get round the following issue:
I have a 'Document' table with an ON CREATE trigger that creates tables in various other databases with the following code:
IF OBJECT_ID ('dbo.'+@docID, 'U') IS NULL
BEGIN
CREATE TABLE [dbo].[newDocumentType](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Pattern] [nvarchar](100) NOT NULL,
[Replacement] [nvarchar](100) NOT NULL,
[UseWildcards] [bit] NULL DEFAULT ((0)),
[CaseSensitive] [bit] NULL DEFAULT ((1)),
[Style] [nvarchar](20) NULL
) ON [PRIMARY]
EXEC sp_rename [newDocumentType], @docID
END
This works fine, although I get a warning "Caution: Changing any part of an object name could break scripts and stored procedures", which is normal.
The front end of the system, for legacy reasons, is in MS Access.
Everything is fine when I create a 'document' through Access.
But I figure if I am creating lots of these I want a batch-import function that runs a StoredProc with an INSERT on the 'Document' table. This StoredProc runs fine from Management Studio. The problem I have is that Access seems to be stopping after it gets this warning message and I can't get it to carry on.
I have tried the DoCmd, but that doesn't really seem to help.
When I use that, my code will run over the list of items I am trying to INSERT, but it won't finish running the StoredProc.
From what I have read, this is a level 10 error, so SQL Server treats it as a non-fatal error, hence why it works in Management Studio.
I would be grateful for any helpful insights into how to get this working, as I am really stuck!
Many thanks,
Ed