Most of the time, I get an 'Invalid Object Name' error displayed in my web grid when I try to save changes to a date column.
I turned on sql tracing and depending on which SELECT statement Alpha decides to use after updating the record, it either codes the table name as [dbo.rgRateGroup] or dbo.rgRateGroup
SQL Server2008 R2 SP1, accepts brackets like this: [dbo].[rgRateGroup], not [dbo.rgRateGroup], or no [] if reserved words and spaces are not used.
How can I get A5 to either properly use [] or to not use them at all? Or how can I get SQL to understand A5's syntax?
Alpha Five Version 10.5 Build 4369, System AddIns Build 3712
-Rich Fulham
p.s. The bad statement that A5 is sending to SQL is:
The good statement that A5 sometimes sends after the update is:
My table is defined like this:
/****** Object: Table [dbo].[RateGroup] Script Date: 10/20/2011 12:24:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[RateGroup](
[rgRateGroup_SysID] [int] IDENTITY(1,1) NOT NULL,
[rgDataset_GUID] [uniqueidentifier] NOT NULL,
[rgRateGroup_RecordStatus] [char](1) NOT NULL,
[rgRateGroup_Description] [varchar](20) NOT NULL,
[rgRecAdd_Person_SysID] [int] NOT NULL,
[rgRecAdd_Date] [datetime] NULL,
[rgRecChg_Person_SysID] [int] NOT NULL,
[rgRecChg_Date] [datetime] NULL,
CONSTRAINT [PK_RateGroup] PRIMARY KEY CLUSTERED
(
[rgRateGroup_SysID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A=Available; R=Reserved (currently not used); U=Unavailable' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'RateGroup', @level2type=N'COLUMN',@level2name=N'rgRateGroup_RecordStatus'
GO
ALTER TABLE [dbo].[RateGroup] ADD CONSTRAINT [DF_RateGroup_RateGroup_RecordStatus] DEFAULT ('A') FOR [rgRateGroup_RecordStatus]
GO
ALTER TABLE [dbo].[RateGroup] ADD CONSTRAINT [DF_RateGroup_RecAddID] DEFAULT ((0)) FOR [rgRecAdd_Person_SysID]
GO
ALTER TABLE [dbo].[RateGroup] ADD CONSTRAINT [DF_RateGroup_RecChgID] DEFAULT ((0)) FOR [rgRecChg_Person_SysID]
GO
I turned on sql tracing and depending on which SELECT statement Alpha decides to use after updating the record, it either codes the table name as [dbo.rgRateGroup] or dbo.rgRateGroup
SQL Server2008 R2 SP1, accepts brackets like this: [dbo].[rgRateGroup], not [dbo.rgRateGroup], or no [] if reserved words and spaces are not used.
How can I get A5 to either properly use [] or to not use them at all? Or how can I get SQL to understand A5's syntax?
Alpha Five Version 10.5 Build 4369, System AddIns Build 3712
-Rich Fulham
p.s. The bad statement that A5 is sending to SQL is:
declare @p1 int
set @p1=NULL
exec sp_prepexec @p1 output,
N'@P1 float',
N'SELECT * FROM [dbo.RateGroup] dbo_RateGroup WHERE rgRateGroup_SysID = @P1',
29
select @p1
set @p1=NULL
exec sp_prepexec @p1 output,
N'@P1 float',
N'SELECT * FROM [dbo.RateGroup] dbo_RateGroup WHERE rgRateGroup_SysID = @P1',
29
select @p1
The good statement that A5 sometimes sends after the update is:
declare @p1 int
set @p1=2
exec sp_prepexec @p1 output,
N'@P1 float',
N'SELECT rgRateGroup_SysID, rgDataset_GUID, rgRateGroup_RecordStatus,
rgRateGroup_Description, rgRecAdd_Person_SysID, rgRecAdd_Date,
rgRecChg_Person_SysID, rgRecChg_Date
FROM dbo.RateGroup dbo_RateGroup
WHERE rgRateGroup_SysID = @P1',9
select @p1
set @p1=2
exec sp_prepexec @p1 output,
N'@P1 float',
N'SELECT rgRateGroup_SysID, rgDataset_GUID, rgRateGroup_RecordStatus,
rgRateGroup_Description, rgRecAdd_Person_SysID, rgRecAdd_Date,
rgRecChg_Person_SysID, rgRecChg_Date
FROM dbo.RateGroup dbo_RateGroup
WHERE rgRateGroup_SysID = @P1',9
select @p1
My table is defined like this:
/****** Object: Table [dbo].[RateGroup] Script Date: 10/20/2011 12:24:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[RateGroup](
[rgRateGroup_SysID] [int] IDENTITY(1,1) NOT NULL,
[rgDataset_GUID] [uniqueidentifier] NOT NULL,
[rgRateGroup_RecordStatus] [char](1) NOT NULL,
[rgRateGroup_Description] [varchar](20) NOT NULL,
[rgRecAdd_Person_SysID] [int] NOT NULL,
[rgRecAdd_Date] [datetime] NULL,
[rgRecChg_Person_SysID] [int] NOT NULL,
[rgRecChg_Date] [datetime] NULL,
CONSTRAINT [PK_RateGroup] PRIMARY KEY CLUSTERED
(
[rgRateGroup_SysID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A=Available; R=Reserved (currently not used); U=Unavailable' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'RateGroup', @level2type=N'COLUMN',@level2name=N'rgRateGroup_RecordStatus'
GO
ALTER TABLE [dbo].[RateGroup] ADD CONSTRAINT [DF_RateGroup_RateGroup_RecordStatus] DEFAULT ('A') FOR [rgRateGroup_RecordStatus]
GO
ALTER TABLE [dbo].[RateGroup] ADD CONSTRAINT [DF_RateGroup_RecAddID] DEFAULT ((0)) FOR [rgRecAdd_Person_SysID]
GO
ALTER TABLE [dbo].[RateGroup] ADD CONSTRAINT [DF_RateGroup_RecChgID] DEFAULT ((0)) FOR [rgRecChg_Person_SysID]
GO
Comment