Wednesday, March 21, 2012
Problems with partition view because it is evaluation version?
I am trying to get a partition view to work. The
partition view is made up of tables that as far as I can
tell qualify for having a partion column. Each tables is
identical except for the check constraint.
If I try to update a row I get an error that partioning
column was not found.
Updateable partition views only work on the enterprise
edition as I understand it. I am trying this out on the
evaluation edition. Could this be the problem or is it
more likely to be in my view construction?
Sql is:
CREATE TABLE [dbo].[bb_chat_200309] (
[chatID] [numeric](18, 0) IDENTITY (1, 1) NOT
NULL ,
[yearMonth] [varchar] (6) NOT NULL ,
[originatedBy] [varchar] (12) NULL ,
[originatedDate] [datetime] NULL ,
[terminatedBy] [varchar] (12) NULL ,
[terminatedDate] [datetime] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[bb_chat_200310] (
[chatID] [numeric](18, 0) IDENTITY (1, 1) NOT
NULL ,
[yearMonth] [varchar] (6) NOT NULL ,
[originatedBy] [varchar] (12) NULL ,
[originatedDate] [datetime] NULL ,
[terminatedBy] [varchar] (12) NULL ,
[terminatedDate] [datetime] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[bb_chat_200309] WITH NOCHECK ADD
CONSTRAINT [pk_bb_chat_200309] PRIMARY KEY
CLUSTERED
(
[chatID],
[yearMonth]
) ON [PRIMARY] ,
CHECK ([yearMonth] = 200309)
GO
ALTER TABLE [dbo].[bb_chat_200310] WITH NOCHECK ADD
CONSTRAINT [pk_bb_chat_200310] PRIMARY KEY
CLUSTERED
(
[chatID],
[yearMonth]
) ON [PRIMARY] ,
CHECK ([yearMonth] = 200310)
GO
create view dbo.bb_chat as
select
chatID
, yearMonth
, originatedBy
, originatedDate
, terminatedBy
, terminatedDate
from bb_chat_200405
union all
select
chatID
, yearMonth
, originatedBy
, originatedDate
, terminatedBy
, terminatedDate
from bb_chat_200404
Thanks for any help
GlynTry specifying the check constraint as part of the CREATE TABLE. For
example:
CREATE TABLE [dbo].[bb_chat_200309] (
[chatID] [numeric](18, 0) IDENTITY (1, 1) NOT
NULL ,
[yearMonth] [varchar] (6) NOT NULL
CONSTRAINT CK_bb_chat_200309_yearmonth CHECK ([yearMonth] = '200309') ,
[originatedBy] [varchar] (12) NULL ,
[originatedDate] [datetime] NULL ,
[terminatedBy] [varchar] (12) NULL ,
[terminatedDate] [datetime] NULL
) ON [PRIMARY]
GO
Hope this helps.
Dan Guzman
SQL Server MVP
"Glyn Walters" <glyn_walters@.hotmail.com> wrote in message
news:f9b601c43e65$9cba4a90$a601280a@.phx.gbl...
> Hi
> I am trying to get a partition view to work. The
> partition view is made up of tables that as far as I can
> tell qualify for having a partion column. Each tables is
> identical except for the check constraint.
> If I try to update a row I get an error that partioning
> column was not found.
> Updateable partition views only work on the enterprise
> edition as I understand it. I am trying this out on the
> evaluation edition. Could this be the problem or is it
> more likely to be in my view construction?
> Sql is:
> CREATE TABLE [dbo].[bb_chat_200309] (
> [chatID] [numeric](18, 0) IDENTITY (1, 1) NOT
> NULL ,
> [yearMonth] [varchar] (6) NOT NULL ,
> [originatedBy] [varchar] (12) NULL ,
> [originatedDate] [datetime] NULL ,
> [terminatedBy] [varchar] (12) NULL ,
> [terminatedDate] [datetime] NULL
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[bb_chat_200310] (
> [chatID] [numeric](18, 0) IDENTITY (1, 1) NOT
> NULL ,
> [yearMonth] [varchar] (6) NOT NULL ,
> [originatedBy] [varchar] (12) NULL ,
> [originatedDate] [datetime] NULL ,
> [terminatedBy] [varchar] (12) NULL ,
> [terminatedDate] [datetime] NULL
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[bb_chat_200309] WITH NOCHECK ADD
> CONSTRAINT [pk_bb_chat_200309] PRIMARY KEY
> CLUSTERED
> (
> [chatID],
> [yearMonth]
> ) ON [PRIMARY] ,
> CHECK ([yearMonth] = 200309)
> GO
> ALTER TABLE [dbo].[bb_chat_200310] WITH NOCHECK ADD
> CONSTRAINT [pk_bb_chat_200310] PRIMARY KEY
> CLUSTERED
> (
> [chatID],
> [yearMonth]
> ) ON [PRIMARY] ,
> CHECK ([yearMonth] = 200310)
> GO
> create view dbo.bb_chat as
> select
> chatID
> , yearMonth
> , originatedBy
> , originatedDate
> , terminatedBy
> , terminatedDate
> from bb_chat_200405
> union all
> select
> chatID
> , yearMonth
> , originatedBy
> , originatedDate
> , terminatedBy
> , terminatedDate
> from bb_chat_200404
> Thanks for any help
> Glyn|||Hi. Thanks for the advice. Howvere I do create the tables
like that. The output above was from exporting sql. I
create the tables using this script:
set @.sql = 'create table dbo.bb_chatUser_' + @.YYYYMM + '(
chatID numeric(18, 0) not null
, yearMonth varchar(6) not null constraint
ck_bb_chatUser_' + @.YYYYMM + '_yearmonth check (yearMonth
= ' + @.YYYYMM + ')
, invitedBy varchar (12) not null
, invitedDate datetime not null
, guestID varchar(12) not null
, answeredDate datetime null
, leftDate datetime
)'
exec(@.sql);
I think my tables and view qualify as yearMonth has a non-
overlapping check constraint and is part of the primary
key. Are there any other things I need to do to make the
view updateable?|||drop and re-create the constraints, there is an article by MS
http://support.microsoft.com/defaul...kb;en-us;270013|||Thanks for the advice. If was my mistake in the end the
check constraints were yearMonth = 200310 rather
than '200310'.
Problems with partition view because it is evaluation version?
I am trying to get a partition view to work. The
partition view is made up of tables that as far as I can
tell qualify for having a partion column. Each tables is
identical except for the check constraint.
If I try to update a row I get an error that partioning
column was not found.
Updateable partition views only work on the enterprise
edition as I understand it. I am trying this out on the
evaluation edition. Could this be the problem or is it
more likely to be in my view construction?
Sql is:
CREATE TABLE [dbo].[bb_chat_200309] (
[chatID] [numeric](18, 0) IDENTITY (1, 1) NOT
NULL ,
[yearMonth] [varchar] (6) NOT NULL ,
[originatedBy] [varchar] (12) NULL ,
[originatedDate] [datetime] NULL ,
[terminatedBy] [varchar] (12) NULL ,
[terminatedDate] [datetime] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[bb_chat_200310] (
[chatID] [numeric](18, 0) IDENTITY (1, 1) NOT
NULL ,
[yearMonth] [varchar] (6) NOT NULL ,
[originatedBy] [varchar] (12) NULL ,
[originatedDate] [datetime] NULL ,
[terminatedBy] [varchar] (12) NULL ,
[terminatedDate] [datetime] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[bb_chat_200309] WITH NOCHECK ADD
CONSTRAINT [pk_bb_chat_200309] PRIMARY KEY
CLUSTERED
(
[chatID],
[yearMonth]
) ON [PRIMARY] ,
CHECK ([yearMonth] = 200309)
GO
ALTER TABLE [dbo].[bb_chat_200310] WITH NOCHECK ADD
CONSTRAINT [pk_bb_chat_200310] PRIMARY KEY
CLUSTERED
(
[chatID],
[yearMonth]
) ON [PRIMARY] ,
CHECK ([yearMonth] = 200310)
GO
create view dbo.bb_chat as
select
chatID
, yearMonth
, originatedBy
, originatedDate
, terminatedBy
, terminatedDate
from bb_chat_200405
union all
select
chatID
, yearMonth
, originatedBy
, originatedDate
, terminatedBy
, terminatedDate
from bb_chat_200404
Thanks for any help
GlynTry specifying the check constraint as part of the CREATE TABLE. For
example:
CREATE TABLE [dbo].[bb_chat_200309] (
[chatID] [numeric](18, 0) IDENTITY (1, 1) NOT
NULL ,
[yearMonth] [varchar] (6) NOT NULL
CONSTRAINT CK_bb_chat_200309_yearmonth CHECK ([yearMonth] = '200309') ,
[originatedBy] [varchar] (12) NULL ,
[originatedDate] [datetime] NULL ,
[terminatedBy] [varchar] (12) NULL ,
[terminatedDate] [datetime] NULL
) ON [PRIMARY]
GO
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Glyn Walters" <glyn_walters@.hotmail.com> wrote in message
news:f9b601c43e65$9cba4a90$a601280a@.phx.gbl...
> Hi
> I am trying to get a partition view to work. The
> partition view is made up of tables that as far as I can
> tell qualify for having a partion column. Each tables is
> identical except for the check constraint.
> If I try to update a row I get an error that partioning
> column was not found.
> Updateable partition views only work on the enterprise
> edition as I understand it. I am trying this out on the
> evaluation edition. Could this be the problem or is it
> more likely to be in my view construction?
> Sql is:
> CREATE TABLE [dbo].[bb_chat_200309] (
> [chatID] [numeric](18, 0) IDENTITY (1, 1) NOT
> NULL ,
> [yearMonth] [varchar] (6) NOT NULL ,
> [originatedBy] [varchar] (12) NULL ,
> [originatedDate] [datetime] NULL ,
> [terminatedBy] [varchar] (12) NULL ,
> [terminatedDate] [datetime] NULL
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[bb_chat_200310] (
> [chatID] [numeric](18, 0) IDENTITY (1, 1) NOT
> NULL ,
> [yearMonth] [varchar] (6) NOT NULL ,
> [originatedBy] [varchar] (12) NULL ,
> [originatedDate] [datetime] NULL ,
> [terminatedBy] [varchar] (12) NULL ,
> [terminatedDate] [datetime] NULL
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[bb_chat_200309] WITH NOCHECK ADD
> CONSTRAINT [pk_bb_chat_200309] PRIMARY KEY
> CLUSTERED
> (
> [chatID],
> [yearMonth]
> ) ON [PRIMARY] ,
> CHECK ([yearMonth] = 200309)
> GO
> ALTER TABLE [dbo].[bb_chat_200310] WITH NOCHECK ADD
> CONSTRAINT [pk_bb_chat_200310] PRIMARY KEY
> CLUSTERED
> (
> [chatID],
> [yearMonth]
> ) ON [PRIMARY] ,
> CHECK ([yearMonth] = 200310)
> GO
> create view dbo.bb_chat as
> select
> chatID
> , yearMonth
> , originatedBy
> , originatedDate
> , terminatedBy
> , terminatedDate
> from bb_chat_200405
> union all
> select
> chatID
> , yearMonth
> , originatedBy
> , originatedDate
> , terminatedBy
> , terminatedDate
> from bb_chat_200404
> Thanks for any help
> Glyn|||Hi. Thanks for the advice. Howvere I do create the tables
like that. The output above was from exporting sql. I
create the tables using this script:
set @.sql = 'create table dbo.bb_chatUser_' + @.YYYYMM + '(
chatID numeric(18, 0) not null
, yearMonth varchar(6) not null constraint
ck_bb_chatUser_' + @.YYYYMM + '_yearmonth check (yearMonth
= ' + @.YYYYMM + ')
, invitedBy varchar (12) not null
, invitedDate datetime not null
, guestID varchar(12) not null
, answeredDate datetime null
, leftDate datetime
)'
exec(@.sql);
I think my tables and view qualify as yearMonth has a non-
overlapping check constraint and is part of the primary
key. Are there any other things I need to do to make the
view updateable?|||drop and re-create the constraints, there is an article by MS
http://support.microsoft.com/default.aspx?scid=kb;en-us;270013|||Thanks for the advice. If was my mistake in the end the
check constraints were yearMonth = 200310 rather
than '200310'.sql
Problems with partition view because it is evaluation version?
I am trying to get a partition view to work. The
partition view is made up of tables that as far as I can
tell qualify for having a partion column. Each tables is
identical except for the check constraint.
If I try to update a row I get an error that partioning
column was not found.
Updateable partition views only work on the enterprise
edition as I understand it. I am trying this out on the
evaluation edition. Could this be the problem or is it
more likely to be in my view construction?
Sql is:
CREATE TABLE [dbo].[bb_chat_200309] (
[chatID] [numeric](18, 0) IDENTITY (1, 1) NOT
NULL ,
[yearMonth] [varchar] (6) NOT NULL ,
[originatedBy] [varchar] (12) NULL ,
[originatedDate] [datetime] NULL ,
[terminatedBy] [varchar] (12) NULL ,
[terminatedDate] [datetime] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[bb_chat_200310] (
[chatID] [numeric](18, 0) IDENTITY (1, 1) NOT
NULL ,
[yearMonth] [varchar] (6) NOT NULL ,
[originatedBy] [varchar] (12) NULL ,
[originatedDate] [datetime] NULL ,
[terminatedBy] [varchar] (12) NULL ,
[terminatedDate] [datetime] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[bb_chat_200309] WITH NOCHECK ADD
CONSTRAINT [pk_bb_chat_200309] PRIMARY KEY
CLUSTERED
(
[chatID],
[yearMonth]
) ON [PRIMARY] ,
CHECK ([yearMonth] = 200309)
GO
ALTER TABLE [dbo].[bb_chat_200310] WITH NOCHECK ADD
CONSTRAINT [pk_bb_chat_200310] PRIMARY KEY
CLUSTERED
(
[chatID],
[yearMonth]
) ON [PRIMARY] ,
CHECK ([yearMonth] = 200310)
GO
create view dbo.bb_chat as
select
chatID
,yearMonth
,originatedBy
,originatedDate
,terminatedBy
,terminatedDate
from bb_chat_200405
union all
select
chatID
,yearMonth
,originatedBy
,originatedDate
,terminatedBy
,terminatedDate
from bb_chat_200404
Thanks for any help
Glyn
Try specifying the check constraint as part of the CREATE TABLE. For
example:
CREATE TABLE [dbo].[bb_chat_200309] (
[chatID] [numeric](18, 0) IDENTITY (1, 1) NOT
NULL ,
[yearMonth] [varchar] (6) NOT NULL
CONSTRAINT CK_bb_chat_200309_yearmonth CHECK ([yearMonth] = '200309') ,
[originatedBy] [varchar] (12) NULL ,
[originatedDate] [datetime] NULL ,
[terminatedBy] [varchar] (12) NULL ,
[terminatedDate] [datetime] NULL
) ON [PRIMARY]
GO
Hope this helps.
Dan Guzman
SQL Server MVP
"Glyn Walters" <glyn_walters@.hotmail.com> wrote in message
news:f9b601c43e65$9cba4a90$a601280a@.phx.gbl...
> Hi
> I am trying to get a partition view to work. The
> partition view is made up of tables that as far as I can
> tell qualify for having a partion column. Each tables is
> identical except for the check constraint.
> If I try to update a row I get an error that partioning
> column was not found.
> Updateable partition views only work on the enterprise
> edition as I understand it. I am trying this out on the
> evaluation edition. Could this be the problem or is it
> more likely to be in my view construction?
> Sql is:
> CREATE TABLE [dbo].[bb_chat_200309] (
> [chatID] [numeric](18, 0) IDENTITY (1, 1) NOT
> NULL ,
> [yearMonth] [varchar] (6) NOT NULL ,
> [originatedBy] [varchar] (12) NULL ,
> [originatedDate] [datetime] NULL ,
> [terminatedBy] [varchar] (12) NULL ,
> [terminatedDate] [datetime] NULL
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[bb_chat_200310] (
> [chatID] [numeric](18, 0) IDENTITY (1, 1) NOT
> NULL ,
> [yearMonth] [varchar] (6) NOT NULL ,
> [originatedBy] [varchar] (12) NULL ,
> [originatedDate] [datetime] NULL ,
> [terminatedBy] [varchar] (12) NULL ,
> [terminatedDate] [datetime] NULL
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[bb_chat_200309] WITH NOCHECK ADD
> CONSTRAINT [pk_bb_chat_200309] PRIMARY KEY
> CLUSTERED
> (
> [chatID],
> [yearMonth]
> ) ON [PRIMARY] ,
> CHECK ([yearMonth] = 200309)
> GO
> ALTER TABLE [dbo].[bb_chat_200310] WITH NOCHECK ADD
> CONSTRAINT [pk_bb_chat_200310] PRIMARY KEY
> CLUSTERED
> (
> [chatID],
> [yearMonth]
> ) ON [PRIMARY] ,
> CHECK ([yearMonth] = 200310)
> GO
> create view dbo.bb_chat as
> select
> chatID
> , yearMonth
> , originatedBy
> , originatedDate
> , terminatedBy
> , terminatedDate
> from bb_chat_200405
> union all
> select
> chatID
> , yearMonth
> , originatedBy
> , originatedDate
> , terminatedBy
> , terminatedDate
> from bb_chat_200404
> Thanks for any help
> Glyn
|||Hi. Thanks for the advice. Howvere I do create the tables
like that. The output above was from exporting sql. I
create the tables using this script:
set @.sql = 'create table dbo.bb_chatUser_' + @.YYYYMM + '(
chatID numeric(18, 0) not null
,yearMonth varchar(6) not null constraint
ck_bb_chatUser_' + @.YYYYMM + '_yearmonth check (yearMonth
= ' + @.YYYYMM + ')
,invitedBy varchar (12) not null
,invitedDate datetime not null
,guestID varchar(12) not null
,answeredDate datetime null
,leftDate datetime
)'
exec(@.sql);
I think my tables and view qualify as yearMonth has a non-
overlapping check constraint and is part of the primary
key. Are there any other things I need to do to make the
view updateable?
|||drop and re-create the constraints, there is an article by MS
http://support.microsoft.com/default...b;en-us;270013
|||Thanks for the advice. If was my mistake in the end the
check constraints were yearMonth = 200310 rather
than '200310'.
Tuesday, March 20, 2012
Problems with mimimum value for DateTime Package Variable since SP1
The former version used 12/30/1899 as the minimum value that can be entered.
Now the min value has changed to something about 1960.
During package execution I'd like to distinguish between two states:
1. The Variable has not yet been written to.
2. Any of my executable has written to it.
At the moment I check the value of it to be the minimum value (see above) or not.
So if I develop packages under SP1 I get into trouble.
Any way out of it?
Thanks
Fridtjof
[EDIT] The mindate in C# differs from both date values mentioned above! Consistency? Hum![/EDIT]
How did you determine that you can't put values below 1960 in there? I (or more accurately Darren who is sat right next to me) has just typed the value 01/01/1900 into the variables window and it sems to take it OK.
What specifically are you not able to do?
-Jamie
|||Typing works fine, and the following code worked too.
Public Sub Main()
Dts.Variables("Variable").Value = DateTime.MaxValue
System.Windows.Forms.MessageBox.Show(Dts.Variables("Variable").Value.ToString())
Dts.Variables("Variable").Value = DateTime.MinValue
System.Windows.Forms.MessageBox.Show(Dts.Variables("Variable").Value.ToString())
Dts.TaskResult = Dts.Results.Success
End Sub
|||Oops, I don't really know what went wrong but it works as you mentioned.Sorry for posting too quick...
Problems with long execution time
We have recently released a new version of our gallery function where we
give the users the possibility to upload images, videos and sound files. We
moved about 15 million objects from the earlier version of the application.
Each day about 150- to 200 thousand objects are uploaded and 100 thousand
objects are deleted.
One of the features in the new versions is the search functionality. The
users can mark their content with tags that are searchable via a full text
index. Each day about 1.5 million queries are executed against the full text
index and about the double against the table that the index is based on.
The full text query uses CONTAINSTABLE and gets 100 rows from the index.
These rows is joined with the table that the index is based on via a INNER
JOIN and four other tables that is needed to present all information about
the object (one INNER JOIN and three LEFT OUTER JOIN).
The problem we have come over is that queries take extremely long time to
execute (up to five minutes). Under a beta period we ran the application with
the same amount of data but with less queries against the tables, under this
period we don’t discovered any problems. After the release the msftesql.exe
consumed 100 % CPU. From the start we were using INFLECTION, after removing
that the process isn’t constantly using 100% CPU but is still peaking at full
CPU usage.
We are using Sql Server 2005. The machine running the Sql Server has two AMD
Opteron 64 bit Dual Core 2.4 GHz with 16 GB of RAM.
My question is if anyone has some input of how to proceed with the
identification of the problem? What limitations of the amount of queries
(both selects and changes of the content) have a full text index? Dose anyone
has some documentation/literature about this subject to recommend?
Thanks in advance!
Regards,
Karl
When you remove full-text from the query what is your performance like. I
strongly suspect that your problem is that you are running into a lazy spool
which will make your SQL FTS performance extremely slow. You will need to
re-write your queries to remove lazy spool.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"karl_a" <karl_a@.discussions.microsoft.com> wrote in message
news:F02AAEAF-0F3E-4847-8210-2D36EF61EC9A@.microsoft.com...
> Hello,
> We have recently released a new version of our gallery function where we
> give the users the possibility to upload images, videos and sound files.
> We
> moved about 15 million objects from the earlier version of the
> application.
> Each day about 150- to 200 thousand objects are uploaded and 100 thousand
> objects are deleted.
> One of the features in the new versions is the search functionality. The
> users can mark their content with tags that are searchable via a full text
> index. Each day about 1.5 million queries are executed against the full
> text
> index and about the double against the table that the index is based on.
> The full text query uses CONTAINSTABLE and gets 100 rows from the index.
> These rows is joined with the table that the index is based on via a INNER
> JOIN and four other tables that is needed to present all information about
> the object (one INNER JOIN and three LEFT OUTER JOIN).
> The problem we have come over is that queries take extremely long time to
> execute (up to five minutes). Under a beta period we ran the application
> with
> the same amount of data but with less queries against the tables, under
> this
> period we don't discovered any problems. After the release the
> msftesql.exe
> consumed 100 % CPU. From the start we were using INFLECTION, after
> removing
> that the process isn't constantly using 100% CPU but is still peaking at
> full
> CPU usage.
> We are using Sql Server 2005. The machine running the Sql Server has two
> AMD
> Opteron 64 bit Dual Core 2.4 GHz with 16 GB of RAM.
> My question is if anyone has some input of how to proceed with the
> identification of the problem? What limitations of the amount of queries
> (both selects and changes of the content) have a full text index? Dose
> anyone
> has some documentation/literature about this subject to recommend?
> Thanks in advance!
> Regards,
> Karl
|||Laxy spool might indicate the wrong join algorithm selection.
You might consider the following workarounds:
1) insert the results of containstable into a temptable (e.g. clustered on
ftkey) and then join the temptable with the rest of your query.
2) You mentioned CONTAINS returns 100 rows. Is that by virtue of data
distribution or due to top_n_by_rank parameter? If you're not using the
latter, I strongly recommend doing so.
3) If there's a specific query plan that you find optimal (e.g. the one you
observed in testing), and the one you're getting now is different, you can
consider using the OPTIMIZE FOR hint to hint the CONTAINSTABLE parameter
value that produced the optimal plan.
Hop this helps,
Regards,
-Denis.
"Hilary Cotter" wrote:
> When you remove full-text from the query what is your performance like. I
> strongly suspect that your problem is that you are running into a lazy spool
> which will make your SQL FTS performance extremely slow. You will need to
> re-write your queries to remove lazy spool.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
>
> "karl_a" <karl_a@.discussions.microsoft.com> wrote in message
> news:F02AAEAF-0F3E-4847-8210-2D36EF61EC9A@.microsoft.com...
>
>
Monday, March 12, 2012
Problems with JDBC
Indeed, when fetching a smallint from SQL Server i got instead an Integer.
How can i do to avoid such a problem?
Some hints?
many tanks, gaetano"okai" <okai@.lycos.it> wrote in message news:bg3da5$fe7$1@.news.mch.sbs.de...
> I downloaded the latest version on JDBC from Microsoft and I got problems.
> Indeed, when fetching a smallint from SQL Server i got instead an Integer.
> How can i do to avoid such a problem?
> Some hints?
>
> many tanks, gaetano
I don't know anything about JDBC myself, but there is a dedicated newsgroup
for this, so you might get a better answer there:
microsoft.public.sqlserver.jdbcdriver
Simon
Wednesday, March 7, 2012
Problems with Dateformat
I have 2 MS SQL Servers (one in the English Language version, one in
German). On each server I have the same database (one for testing, one for
work).
When I'm queriing a datatable from vb.net I'm getting problems with a a
datetime parameter:
The English Language Version accepts: yyyy.MM.dd HH:mm
The German Language Version accepts: dd.MM.yyyy HH:mm
How can I change the DateFormat from the German Version to the English
Version, without reinstalling MS-SQL-Server in English and without changing
all my code to the two dateversions?
Any help would be very appreciated
Tom
You might want to have a look at these:
http://www.karaszi.com/SQLServer/info_datetime.asp Guide to Datetimes
http://www.sqlservercentral.com/colu...qldatetime.asp
Datetimes
http://www.murach.com/books/sqls/article.htm Datetime Searching
Andrew J. Kelly SQL MVP
"Tomilee" <Tomilee@.discussions.microsoft.com> wrote in message
news:66A9DE78-136B-488E-A7E1-4C5387D16590@.microsoft.com...
> Hi all
> I have 2 MS SQL Servers (one in the English Language version, one in
> German). On each server I have the same database (one for testing, one for
> work).
> When I'm queriing a datatable from vb.net I'm getting problems with a a
> datetime parameter:
> The English Language Version accepts: yyyy.MM.dd HH:mm
> The German Language Version accepts: dd.MM.yyyy HH:mm
> How can I change the DateFormat from the German Version to the English
> Version, without reinstalling MS-SQL-Server in English and without
> changing
> all my code to the two dateversions?
> Any help would be very appreciated
> Tom
>
|||Thanks Andrew for your links - unfortunately only the second works. I try to
explain my problem a bit more detailed:
I developed a vb.net client running on desktops. This client is running
queries on a MS SQL Server 2000. After starting the client it asks, witch
server the user wants to choose.
I’ve installed MS SQL servers 2000 twice:
One on my desktop in German.
..
One on a server with my client. This is an English version.
When I query from vb.net it works well on the English MS SQL Server 2000
with the following sample:
"select * from session where GuiAktiv > '" & _
Format(Now.AddSeconds(-60), "yyyy.MM.dd HH:mm") & "' order by id desc"
When I query from vb.net on the German MS SQL Server I receive the following
exception:
"Bei der Konvertierung eines char-Datentyps in einen datetime-Datentyp
liegt der datetime-Wert au?erhalb des gültigen Bereiches ?
Or in English (my translation):
During the conversion of a char-datatype in a datetime-datatype, the
datetime-value is outside the allowed values
What is going wrong?
Thanks in advance
Tom
"Andrew J. Kelly" wrote:
> You might want to have a look at these:
> http://www.karaszi.com/SQLServer/info_datetime.asp Guide to Datetimes
> http://www.sqlservercentral.com/colu...qldatetime.asp
> Datetimes
> http://www.murach.com/books/sqls/article.htm Datetime Searching
> --
> Andrew J. Kelly SQL MVP
>
> "Tomilee" <Tomilee@.discussions.microsoft.com> wrote in message
> news:66A9DE78-136B-488E-A7E1-4C5387D16590@.microsoft.com...
>
>
|||Tomilee (Tomilee@.discussions.microsoft.com) writes:
> Thanks Andrew for your links - unfortunately only the second works.
The link http://www.karaszi.com/SQLServer/info_datetime.asp works for me.
> I developed a vb.net client running on desktops. This client is running
> queries on a MS SQL Server 2000. After starting the client it asks, witch
> server the user wants to choose.
> I've installed MS SQL servers 2000 twice:
> One on my desktop in German.
> .
> One on a server with my client. This is an English version.
> When I query from vb.net it works well on the English MS SQL Server 2000
> with the following sample:
> "select * from session where GuiAktiv > '" & _
> Format(Now.AddSeconds(-60), "yyyy.MM.dd HH:mm") & "' order by id desc"
>...
This is where you go wrong. When you build your SQL statements, do always
use parameters, never build complete strings. What you should do is this:
cmd.CommandText = &_
"SELECT * FROM session WHERE GuiAktiv > @.oneminuteago ORDER BY id DESC"
cmd.Parameters.Add("@.oneminuteago", SqlDbType.DateTime)
cmd.Parameters(0).Value = Now.AddSeconds(-60))
In this particular case, this has the effect that the date is passed as a
binary value to SQL Server, and there can never be any misunderstanding
about the format.
The above is even more important if your data comes from user input. If
you build strings, a malicious user could enter data with a single quote
in it which would close the string. Then the user can add a completely
other SQL statement that does evil things. Don't laugh. This is called
SQL injection, and is a commonly used by intruders.
What happens now is that you pass a formatted date to SQL Server. Most
date formats in SQL Server are interpreted according to dateformat and
language settings. YYYY-MM-DD does not work with a German dmy setting.
If you are absolute dead set on using strings, you should use any of the
formats:
YYYYMMDD [HH:MM:SS.mmm]
YYYY-MM-DDTHH:MM:DD[.mmm]
T here stands for itself. Brackets show optional components. These are
the only two format that SQL Server will always understand.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
|||> What happens now is that you pass a formatted date to SQL Server. Most
> date formats in SQL Server are interpreted according to dateformat and
> language settings. YYYY-MM-DD does not work with a German dmy setting.
> If you are absolute dead set on using strings, you should use any of the
> formats:
> YYYYMMDD [HH:MM:SS.mmm]
> YYYY-MM-DDTHH:MM:DD[.mmm]
> T here stands for itself. Brackets show optional components. These are
> the only two format that SQL Server will always understand.
Only note:
format ISO 8601 YYYY-MM-DDTHH:MM:DD[.mmm] isn't supported on MSSQL7.
|||Thank you for this useful information!
Tom
"RADl0PASlV" wrote:
> Only note:
> format ISO 8601 YYYY-MM-DDTHH:MM:DD[.mmm] isn't supported on MSSQL7.
>
>
Monday, February 20, 2012
Problems when restoring database backup
"RAID member number 2 is missing for the specified database. Abnormal termination for the Database Backup or Restore"
or somethig like that ( I have translated it from Spanish).
Does anyone know the cause of this problem and how to solve it?
Any suggestion would be strongly appreciated.Which version of SQL Server are you running ? Please submit your restore database statement you are using. Do you know how the database was backed up ?|||Have you looked at Microsoft Technet article?
INF: Error Message: 3132 "The RAID set for database ... missing member number" (Q256973) (http://support.microsoft.com/default.aspx?scid=kb;EN-US;q256973)|||thanks!
Problems when performing RESTORE DATABASE on Windows XP Mediacenter with Intel Core Duo
We have an application, which as a database server uses
MS SQL Server 2000 Desktop Engine (MSDE; SP3a version). One
of the application users reported that after he switched
computers (installed our application with MSDE on a new
computer with parameters mentioned in the message subject),
the application began to have problems with backup functionality.
The backup functionality of the application does only one
thing: it uses SQL-DMO interface to execute this TransactSQL:
"RESTORE DATABASE ...". The effect of that is one of two:
either the database is apparently restored, but the control
does not return to the application (so the application hangs),
or the database remains in "restoring" state (and the control
does not return to the application too) and is useless to
the user.
The question is: Do you know any possible causes and / or
solutions to this problems? I'd be grateful for any information.
The user did not send me the server log files yet. As soon
as I get them, I'll try to post anything interesting that
I find in them.
HilarionHi
Can you run the command from osql on this machine?
John
"Hilarion" wrote:
> Hi!
> We have an application, which as a database server uses
> MS SQL Server 2000 Desktop Engine (MSDE; SP3a version). One
> of the application users reported that after he switched
> computers (installed our application with MSDE on a new
> computer with parameters mentioned in the message subject),
> the application began to have problems with backup functionality.
> The backup functionality of the application does only one
> thing: it uses SQL-DMO interface to execute this TransactSQL:
> "RESTORE DATABASE ...". The effect of that is one of two:
> either the database is apparently restored, but the control
> does not return to the application (so the application hangs),
> or the database remains in "restoring" state (and the control
> does not return to the application too) and is useless to
> the user.
> The question is: Do you know any possible causes and / or
> solutions to this problems? I'd be grateful for any information.
> The user did not send me the server log files yet. As soon
> as I get them, I'll try to post anything interesting that
> I find in them.
> Hilarion
>|||Hilarion wrote:
> > We have an application, which as a database server uses
> > MS SQL Server 2000 Desktop Engine (MSDE; SP3a version). One
> > of the application users reported that after he switched
> > computers (installed our application with MSDE on a new
> > computer with parameters mentioned in the message subject),
> > the application began to have problems with backup functionality.
> > The backup functionality of the application does only one
> > thing: it uses SQL-DMO interface to execute this TransactSQL:
> > "RESTORE DATABASE ...". The effect of that is one of two:
> > either the database is apparently restored, but the control
> > does not return to the application (so the application hangs),
> > or the database remains in "restoring" state (and the control
> > does not return to the application too) and is useless to
> > the user.
> > The question is: Do you know any possible causes and / or
> > solutions to this problems? I'd be grateful for any information.
> > The user did not send me the server log files yet. As soon
> > as I get them, I'll try to post anything interesting that
> > I find in them.
John Bell wrote:
> Can you run the command from osql on this machine?
I have no direct access to the machine and not a very good contact
to the user, but I'll try to ask that user to try osql to perform
the restore operation. I'll post the results as soon as I get them.
Thank you for your suggestion. If you have any other ideas, then
please post them (do not wait for my reply on the "osql" use -
- it may take much time). Thank you in advance for any future
suggestions and any other help.
Hilarion|||Hi
Maybe it would be possible to use remote desktop or some other alternative
to get this tested? If you have an alternative backup file you could try then
it may be worth trying.
John
"Hilarion" wrote:
> Hilarion wrote:
> > > We have an application, which as a database server uses
> > > MS SQL Server 2000 Desktop Engine (MSDE; SP3a version). One
> > > of the application users reported that after he switched
> > > computers (installed our application with MSDE on a new
> > > computer with parameters mentioned in the message subject),
> > > the application began to have problems with backup functionality.
> > > The backup functionality of the application does only one
> > > thing: it uses SQL-DMO interface to execute this TransactSQL:
> > > "RESTORE DATABASE ...". The effect of that is one of two:
> > > either the database is apparently restored, but the control
> > > does not return to the application (so the application hangs),
> > > or the database remains in "restoring" state (and the control
> > > does not return to the application too) and is useless to
> > > the user.
> > > The question is: Do you know any possible causes and / or
> > > solutions to this problems? I'd be grateful for any information.
> > > The user did not send me the server log files yet. As soon
> > > as I get them, I'll try to post anything interesting that
> > > I find in them.
>
> John Bell wrote:
> > Can you run the command from osql on this machine?
> I have no direct access to the machine and not a very good contact
> to the user, but I'll try to ask that user to try osql to perform
> the restore operation. I'll post the results as soon as I get them.
> Thank you for your suggestion. If you have any other ideas, then
> please post them (do not wait for my reply on the "osql" use -
> - it may take much time). Thank you in advance for any future
> suggestions and any other help.
> Hilarion
>