Thursday, March 22, 2012
Can't find NOT FOR REPLICATION option
the NOT FOR REPLICATION option.Dan,
it looks like your post is a reply to an earlier post/thread, and all I have
to go on is the title but if you need to script out a table with this
attribute it should look something like this:
CREATE TABLE [dbo].[TestIdent] (
[ID] [int] IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL ,
[descr] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[rowguid] uniqueidentifier ROWGUIDCOL NOT NULL
) ON [PRIMARY]
GO
BTW, if this is a transactional nosync initialization, used with a view to
using the identity property on the subscriber in a failover situation, you
should consider initializing with queued updating subscribers instead, as
the internal identity number will not get incremented on the subscriber and
DBCC CHECKIDENT can't be used on columns set with this attribute to reseed
it.
HTH,
Paul Ibison
Can't find NOT FOR REPLICATION option
the NOT FOR REPLICATION option.
Dan,
it looks like your post is a reply to an earlier post/thread, and all I have
to go on is the title but if you need to script out a table with this
attribute it should look something like this:
CREATE TABLE [dbo].[TestIdent] (
[ID] [int] IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL ,
[descr] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[rowguid] uniqueidentifier ROWGUIDCOL NOT NULL
) ON [PRIMARY]
GO
BTW, if this is a transactional nosync initialization, used with a view to
using the identity property on the subscriber in a failover situation, you
should consider initializing with queued updating subscribers instead, as
the internal identity number will not get incremented on the subscriber and
DBCC CHECKIDENT can't be used on columns set with this attribute to reseed
it.
HTH,
Paul Ibison
|||Thanks Paul, this is actually my first post about this, I just copied
the message SQL gave me when trying to setup a snapshot replication. I
looked all over Enterprise Manager but couldn't find an option "NOT FOR
REPLICATION". I guess you can only do it via SQL script.
FYI, I am just trying to reset a test DB back to production state every
night at midnight (after they play in the test DB all day). Nothing
should replicate to the production server......only from the
productions server to the test server. Hope I am headed in the right
direction.
Thanks again,
Dan
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
|||Dan,
you are on the right track. What you are doing is called a nosync
initialization. You need to script out the tables and create them on the
subscriber before initializing and change the article properties so as to
not drop the table on the subscriber during a name conflict. The setting
"NOT FOR
REPLICATION" can be done in EM. It is on an identity's column in table
design, but can equally be done in a script.
Snapshot replication is good for this, but 'Database Shipping' can equally
be used and also takes users and permissions that your application might
require. It also saves you from adding articles as the application develops.
HTH,
Paul Ibison
|||Can I just create a blank database on the test server and restore the
last backup over top of the blank DB? Then just change each IDENITY
column to NOT FOR REPLICATION?
Thanks for all the help,
Dan
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
|||Dan,
if you mean a nosync initialization, this doesn't work, as when your
subscriber is ultimately being used as a test machine, your identity values
will clash. If the identity columns are used for PKs then you will end up
getting PK violations. This is because replication will not increment the
identity value when records are added to the subscriber and DBCC CHECKIDENT
cannot be used to reseed the identity value. I'd consider shipping database
backups for your scenario. You could alternatively avoid these problems by
using merge or transactional with queued updating subscribers, but there
will be a lot of unnecessary work going on behind the scenes on your
production server which you really don't want.
HTH,
Paul Ibison
|||So replication will not increment the identity value when records are
added to the subscriber? What value, if any, gets put in the identity
field during replication?
How does the shipping database option work?
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
|||Dan,
true - replication doesn't increment the internal identity value - it stays
as the initial seed. Don't confuse this with the population of the column
during replication which works OK, essentially doing an identity insert.
This setting is really used for updating subscribers - snapshot or
transactional, or merge.
By database shipping I was thinking of doing a backup of the production
database, copying it over to the test server and restoring it there. You'll
need to create your own jobs to implement this, but it is not difficult. In
fact if you do a search for log-shipping scripts you can hack these to do
what you want, which is essentially very similar.
HTH,
Paul Ibison
|||Thanks Paul, I will Google log-shipping scripts and see if I can get
that working.
Thanks again for all the help,
Dan
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Can't find NOT FOR REPLICATION option
the NOT FOR REPLICATION option.Dan,
it looks like your post is a reply to an earlier post/thread, and all I have
to go on is the title but if you need to script out a table with this
attribute it should look something like this:
CREATE TABLE [dbo].[TestIdent] (
[ID] [int] IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL ,
[descr] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[rowguid] uniqueidentifier ROWGUIDCOL NOT NULL
) ON [PRIMARY]
GO
BTW, if this is a transactional nosync initialization, used with a view to
using the identity property on the subscriber in a failover situation, you
should consider initializing with queued updating subscribers instead, as
the internal identity number will not get incremented on the subscriber and
DBCC CHECKIDENT can't be used on columns set with this attribute to reseed
it.
HTH,
Paul Ibison|||Thanks Paul, this is actually my first post about this, I just copied
the message SQL gave me when trying to setup a snapshot replication. I
looked all over Enterprise Manager but couldn't find an option "NOT FOR
REPLICATION". I guess you can only do it via SQL script.
FYI, I am just trying to reset a test DB back to production state every
night at midnight (after they play in the test DB all day). Nothing
should replicate to the production server......only from the
productions server to the test server. Hope I am headed in the right
direction.
Thanks again,
Dan
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!|||Dan,
you are on the right track. What you are doing is called a nosync
initialization. You need to script out the tables and create them on the
subscriber before initializing and change the article properties so as to
not drop the table on the subscriber during a name conflict. The setting
"NOT FOR
REPLICATION" can be done in EM. It is on an identity's column in table
design, but can equally be done in a script.
Snapshot replication is good for this, but 'Database Shipping' can equally
be used and also takes users and permissions that your application might
require. It also saves you from adding articles as the application develops.
HTH,
Paul Ibison|||Can I just create a blank database on the test server and restore the
last backup over top of the blank DB? Then just change each IDENITY
column to NOT FOR REPLICATION?
Thanks for all the help,
Dan
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!|||Dan,
if you mean a nosync initialization, this doesn't work, as when your
subscriber is ultimately being used as a test machine, your identity values
will clash. If the identity columns are used for PKs then you will end up
getting PK violations. This is because replication will not increment the
identity value when records are added to the subscriber and DBCC CHECKIDENT
cannot be used to reseed the identity value. I'd consider shipping database
backups for your scenario. You could alternatively avoid these problems by
using merge or transactional with queued updating subscribers, but there
will be a lot of unnecessary work going on behind the scenes on your
production server which you really don't want.
HTH,
Paul Ibison|||So replication will not increment the identity value when records are
added to the subscriber? What value, if any, gets put in the identity
field during replication?
How does the shipping database option work?
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!|||Dan,
true - replication doesn't increment the internal identity value - it stays
as the initial seed. Don't confuse this with the population of the column
during replication which works OK, essentially doing an identity insert.
This setting is really used for updating subscribers - snapshot or
transactional, or merge.
By database shipping I was thinking of doing a backup of the production
database, copying it over to the test server and restoring it there. You'll
need to create your own jobs to implement this, but it is not difficult. In
fact if you do a search for log-shipping scripts you can hack these to do
what you want, which is essentially very similar.
HTH,
Paul Ibison|||Thanks Paul, I will Google log-shipping scripts and see if I can get
that working.
Thanks again for all the help,
Dan
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!sql
Can't find answer to this anywhere
When using rs.CreateFolder to create a folder, is it possible to set the
"Inherit security from parent" property to false? How would I do this. What
is the property called? I have tried "InheritSecurity" but that did not
work...On Mon, 18 Apr 2005 03:57:27 -0700, "DBA72"
<DBA72@.discussions.microsoft.com> wrote:
>A fairly straightforward question:
>When using rs.CreateFolder to create a folder, is it possible to set the
>"Inherit security from parent" property to false? How would I do this. What
>is the property called? I have tried "InheritSecurity" but that did not
>work...
You might want to look at UpdateDeleteAuthorizationPolicy. I don't
know of any example syntax to go beyond what is in BOL, which isn't
much.
Andrew Watt
MVP - InfoPathsql
Cant figure out error message in SQL
Can someone please look at my stored procedure? I am trying to create the following stored procedure, but get the following error
messages:
Msg 102, Level 15, State 1, Procedure InsertWork, Line 3
Incorrect syntax near '7'.
Msg 102, Level 15, State 1, Procedure InsertWork, Line 25
Incorrect syntax near'@.7am8am'.
USE [Work]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[InsertWork]
(
7am8am nvarchar(500),
8am9am nvarchar(500),
9am10am nvarchar(500),
10am11am nvarchar(500),
11am12noon nvarchar(500),
12Noon1pm nvarchar(500),
1pm2pm nvarchar(500),
2pm3pm nvarchar(500),
3pm4pm nvarchar(500),
4pm5pm nvarchar(500),
5pm6pm nvarchar(500),
6pm7pm nvarchar(500),
7pm8pm nvarchar(500),
8pm9pm nvarchar(500),
9pm10pm nvarchar(500),
10pm11pm nvarchar(500),
Notes nvarchar(500),
Date nvarchar(15)
)
AS BEGIN
INSERT INTO WorkDay
VALUES
@.7am8am,
@.8am9am,
@.9am10am,
@.10am11am,
@.11am12Noon,
@.12Noon1pm,
@.1pm2pm,
@.2pm3pm,
@.3pm4pm,
@.4pm5pm,
@.5pm6pm,
@.6pm7pm,
@.7pm8pm,
@.8pm9pm,
@.9pm10pm,
@.10pm11pm,
@.Notes,
@.Date
END
You cannot have variables/parameters names that starts with a number. Try prefixing them with an underscore (quick fix).
johram:
You cannot have variables/parameters names that starts with a number.
Actually you can. The parameters have to start with @. for SQL Server to know its a parameter..
CREATE PROCEDURE [dbo].[InsertWork](@.7am8amnvarchar(500),@.8am9amnvarchar(500),@.9am10amnvarchar(500),@.10am11amnvarchar(500), @.11am12noonnvarchar(500),@.12Noon1pmnvarchar(500),@.1pm2pmnvarchar(500),@.2pm3pmnvarchar(500),@.3pm4pmnvarchar(500),@.4pm5pmnvarchar(500), @.5pm6pmnvarchar(500),@.6pm7pmnvarchar(500),@.7pm8pmnvarchar(500),@.8pm9pmnvarchar(500),@.9pm10pmnvarchar(500), @.10pm11pmnvarchar(500),@.Notesnvarchar(500),@.Datenvarchar(15))AS BEGIN INSERT INTO WorkDayVALUES (@.7am8am, @.8am9am,@.9am10am, @.10am11am, @.11am12Noon,@.12Noon1pm,@.1pm2pm,@.2pm3pm,@.3pm4pm,@.4pm5pm,@.5pm6pm,@.6pm7pm,@.7pm8pm, @.8pm9pm,@.9pm10pm,@.10pm11pm,@.Notes,@.Date )END|||
ndinakar:
Actually you can. The parameters have to start with @. for SQL Server to know its a parameter..
Of course :-)
Tuesday, March 20, 2012
Can't even create a new SQL db, despite SQL Server 2005 installed.
I've open Web Dev and tried to create a new SQL Database Item, only to receive this error:
"Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function properly. Please verify the installation of the component or download from the URL http://microsoft.com"
I'm totally new to this, but this still makes no sense.
hi Brad,
only SQLExpress is designed to use User Instances, the feature you are supposed to use via all "Express editions" of Visual Studio ..
as you can see, all other SQL Server 2005 editions do not provide this feature so you have to directly code your connection to access these editions, as the builtin designers of Express editions of VS do not grant the possibility to connect to traditionals instances..
or... you can install a SQLExpress instance side by side on your pc..
regards
Cant enable database for full-text searching
The Microsoft Search service cannot be administered under the present user account
When attempting to enable a database for full-text searching by running the stored procedure "sp_fulltext_database" the following error message is recieved:
Server: Msg 7635, Level 16, State 1, Procedure sp_fulltext_database, Line 46
The Microsoft Search service cannot be administered under the present user account
The user account that the SQL service is running under has full administrative rights (including the privileges such as log on locally/as a batch/as a service etc - the SQL BUILTIN\Adminstrators login also exists) and the MSSQL and MS Search services have been stopped and started to ensure that the system account does have control of the MS Search service.
Although the text of the error message refers to user rights, line 46 of the stored procedure refers to the DBCC CALLFULLTEXT function and so it appears that the process is actually falling over when trying to drop catalogues.
The server was upgraded from SQL Server 6.5 to SQL Server 2000 and the Full-Text Search component was selected. However it was noticed that the folders Config, Projects and GatherLogs were not present under the following directory:
C:\Program files\Microsoft SQL Server\MSSQL\FTData\SQL Server\
(It was attempted to reinstall the Full-Text Search component from the SQL 2000 CD but as the component was already installed this wasnt possible)
The relevant config files, including the schema.txt, were then copied to the above location and it was ensured that the schema.txt file was the same in both the above location and the MSSQL\Binn folder (and on the SQL 2000 CD). But this has had no effect.
It has also been noticed that there is no registry key relating to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\ MSSQLServer\SQLFTSearch\Setup\Schema
However we have another server (which was a SQL 2000 install, as opposed to an upgrade) which also doesnt have this registry entry and that server isnt experiencing any problems with full-text search/indexing.
Can anyone suggest any other possible fixes before we resort to reinstalling SQL server?
Thanks,
ElaineHave you tried to run the stored procedure or sp_fulltext_database using query analyzer ?|||I'd be looking at the following closely ( assuming you may not have checked these out already ):
www.microsoft.com/technet
www.sqlmag.com
I'd be checking technet first as it sounds awfully like a upgrade "undocumented" type problem.
Apart from that, sounds like you have done everyting else right.
Try setting the SQL Server account to run under a domain account, but make sure you set the startup account to be the same in the Server Properties tab in EM as the account you use when you alter the startup account in Services. This is for the benefit of the Full Text service.
Post back if probs.
J.|||Thanks for your suggestions
...but we resorted to reinstalling SQL which has worked, so it appears that there might be problems with the full-text feature if you've upgraded to sql 2000 from 6.5 (as opposed to a straight 2000 install).
(we retained the databases by detaching them and copying the .mdf/.ldf files to another location. Then once the new install of SQL 2000 was complete we re-attached the databases - NB. the detach/attach method doesn't cover DTS packages. Also if specific users are created for a DB after reattaching you might need to delete them from the DB user section, then recreate them in the security logins section)
Monday, March 19, 2012
Can''t deploy managed assembly to Katmai
Hi!
When I create a managed assembly database project inside Visual Studio 2005 and want to change the database connection to a Katmai server, I get the following error message:
"This server version is not supported. You must have Microsoft SQL Server 2005 Beta 2 or later."
Is this a bug inside Katmai or Visual Studio 2005?
Thanks
Klaus Aschenbrenner
http://www.csharp.at
http://www.csharp.at/blog
Hi Klaus!That is a bug/feature/something in the VS deployment project :-). You can either deploy manually or use my deployment project from inside VS.
Niels
Can''t deploy managed assembly to Katmai
Hi!
When I create a managed assembly database project inside Visual Studio 2005 and want to change the database connection to a Katmai server, I get the following error message:
"This server version is not supported. You must have Microsoft SQL Server 2005 Beta 2 or later."
Is this a bug inside Katmai or Visual Studio 2005?
Thanks
Klaus Aschenbrenner
http://www.csharp.at
http://www.csharp.at/blog
Hi Klaus!It's a VS thing. You can either deploy manually, or use my deployment project from within VS to deploy.
Niels
|||
Hi Klaus,
This is a known issue with Visual Studio 2005 / 2008 beta. This will be fixed in a future release of Visual Studio.
As suggested by Neils, you can build your assembly through Visual Studio and deploy it using CREATE ASSEMBLY/CREATE FUNCTION statements from management studio.
Let me know if you need more information.
Thanks,
-Vineet
Sunday, March 11, 2012
Can't delete full text catalog on clustered sql serer 2000
which is not part of the cluster's shared resources, and I believe doesn't
exist either (I not familiar with clustering at all).
Now the problem is that it now won't let me remove this full text catalog,
giving me the error that it can't *create* a full text catalog on a disk
which isn't part of the cluster's shared resources. How can I delete it?
Ian.Ian,
Most un-usual! As by design, you should be only able to create FT Catalogs
on the shard drive in a clustered environment. How did you do this? If it
can be reproduced, it should be filed as a bug. Have you tried the
following:
use <your_database_name>
go
exec sp_fulltext_catalog '<Your_FT_Catalog_Name>','drop'
go
If not, try it. If it fails, please post the error that it returns. If it
does fail, you may have to try:
EXEC sp_fulltext_service 'clean_up'
if this too fails, I have some code I can email you directly code (the code
is not for the faint-of-heart) that can get you out of this "catch-22"
situation.
Thanks,
John
--
SQL Full Text Search Blog
http://spaces.msn.com/members/jtkane/
"Ian" <Ixpah@.newsgroup.nospam> wrote in message
news:#rqy8sFBFHA.3588@.TK2MSFTNGP11.phx.gbl...
> Basically SQL Server has allowed me to create a full text catalog on a
drive
> which is not part of the cluster's shared resources, and I believe doesn't
> exist either (I not familiar with clustering at all).
> Now the problem is that it now won't let me remove this full text catalog,
> giving me the error that it can't *create* a full text catalog on a disk
> which isn't part of the cluster's shared resources. How can I delete it?
> Ian.
>|||Hello Ian,
To understsand the issue better, I'd like to know the exact steps you
create and delete the full text catalog. What is the exact error message
you encountered?
Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
| From: "Ian" <Ixpah@.newsgroup.nospam>
| Subject: Can't delete full text catalog on clustered sql serer 2000
| Date: Thu, 27 Jan 2005 10:30:33 -0000
| Lines: 11
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <#rqy8sFBFHA.3588@.TK2MSFTNGP11.phx.gbl>
| Newsgroups: microsoft.public.sqlserver.programming
| NNTP-Posting-Host: host81-137-218-140.in-addr.btopenworld.com
81.137.218.140
| Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXS01.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08
.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.programming:499844
| X-Tomcat-NG: microsoft.public.sqlserver.programming
|
| Basically SQL Server has allowed me to create a full text catalog on a
drive
| which is not part of the cluster's shared resources, and I believe
doesn't
| exist either (I not familiar with clustering at all).
|
| Now the problem is that it now won't let me remove this full text
catalog,
| giving me the error that it can't *create* a full text catalog on a disk
| which isn't part of the cluster's shared resources. How can I delete it?
|
| Ian.
|
|
||||I used a script which was very similiar (if not the same) as this:
exec sp_fulltext_database 'enable'
exec sp_fulltext_catalog 'popall_ft','create'
exec sp_fulltext_table 'dbo. articles','create','popall_ft','pk__arti
cles'
exec sp_fulltext_column 'dbo.articles','comment','add'
exec sp_fulltext_table 'dbo.articles','activate'
exec sp_fulltext_table 'dbo.articles','start_change_tracking'
exec sp_fulltext_table 'dbo. articles','start_background_updateindex'
Unfortunately I tried disabling/enabling full text search in order to try
and fix this problem and now can't re-enable it due to the following error:
Server: Msg 7627, Level 16, State 1, Procedure sp_fulltext_database, Line 61
Full-text catalog in directory 'e:\mssql\ftdata' for clustered server cannot
be created. Only directories on a disk in the cluster group of the server
can be used.
Ian.
"Peter Yang [MSFT]" <petery@.online.microsoft.com> wrote in message
news:z8KjaoOBFHA.2732@.cpmsftngxa10.phx.gbl...
> Hello Ian,
> To understsand the issue better, I'd like to know the exact steps you
> create and delete the full text catalog. What is the exact error message
> you encountered?
> Regards,
> Peter Yang
> MCSE2000/2003, MCSA, MCDBA
> Microsoft Online Partner Support
>
> --
> | From: "Ian" <Ixpah@.newsgroup.nospam>
> | Subject: Can't delete full text catalog on clustered sql serer 2000
> | Date: Thu, 27 Jan 2005 10:30:33 -0000
> | Lines: 11
> | X-Priority: 3
> | X-MSMail-Priority: Normal
> | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
> | X-RFC2646: Format=Flowed; Original
> | Message-ID: <#rqy8sFBFHA.3588@.TK2MSFTNGP11.phx.gbl>
> | Newsgroups: microsoft.public.sqlserver.programming
> | NNTP-Posting-Host: host81-137-218-140.in-addr.btopenworld.com
> 81.137.218.140
> | Path:
> cpmsftngxa10.phx.gbl!TK2MSFTNGXS01.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP
08
> phx.gbl!TK2MSFTNGP11.phx.gbl
> | Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.programming:499844
> | X-Tomcat-NG: microsoft.public.sqlserver.programming
> |
> | Basically SQL Server has allowed me to create a full text catalog on a
> drive
> | which is not part of the cluster's shared resources, and I believe
> doesn't
> | exist either (I not familiar with clustering at all).
> |
> | Now the problem is that it now won't let me remove this full text
> catalog,
> | giving me the error that it can't *create* a full text catalog on a disk
> | which isn't part of the cluster's shared resources. How can I delete it?
> |
> | Ian.
> |
> |
> |
>|||Hi lan,
Thanks for your posting!
Peter Yang is OOF and I am his backup!
From your descriptions, I understood that you would like to create a
full-text index catalog, which is on a disk on which the SQL Server
resource is not dependant. In SQL Server 2000 virtual server instance, you
will have to add the disk as a dependency to the SQL Server resource in the
Cluster Administrator.
Refer to the Knowledge Base article for more information and how to add the
disk as a dependency
INF: Creating Databases or Changing Disk File Locations on a Shared Cluster
Drive on Which SQL Server 2000 was not Originally Installed
http://support.microsoft.com/?id=295732
Thank you for your patience and corporation. If you have any questions or
concerns, don't hesitate to let me know. We are always here to be of
assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
Business-Critical Phone Support (BCPS) provides you with technical phone
support at no charge during critical LAN outages or "business down"
situations. This benefit is available 24 hours a day, 7 days a w
Microsoft technology partners in the United States and Canada.
This and other support options are available here:
BCPS:
https://partner.microsoft.com/US/te...erview/40010469
Others: https://partner.microsoft.com/US/te...upportoverview/
If you are outside the United States, please visit our International
Support page:
http://support.microsoft.com/defaul...rnational.aspx.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.|||I have *already* created a full text catalog on a drive which isn't part of
the cluster and probably doesn't exist either. This is the problem I'm
experiencing: not able to delete it or enable full text search because of
it.
I think I've worked out a way round the problem of re-enabling full text
search for the database by changing the path column in the
sysfulltextcatalogs table to a clustered resource. Hopefully once ft is
re-enabled I can then either delete the catalog or use it as is.
Ian.
"Michael Cheng [MSFT]" <v-mingqc@.online.microsoft.com> wrote in message
news:BrTuYlRDFHA.3744@.cpmsftngxa10.phx.gbl...
> Hi lan,
> Thanks for your posting!
> Peter Yang is OOF and I am his backup!
> From your descriptions, I understood that you would like to create a
> full-text index catalog, which is on a disk on which the SQL Server
> resource is not dependant. In SQL Server 2000 virtual server instance, you
> will have to add the disk as a dependency to the SQL Server resource in
> the
> Cluster Administrator.
> Refer to the Knowledge Base article for more information and how to add
> the
> disk as a dependency
> INF: Creating Databases or Changing Disk File Locations on a Shared
> Cluster
> Drive on Which SQL Server 2000 was not Originally Installed
> http://support.microsoft.com/?id=295732
> Thank you for your patience and corporation. If you have any questions or
> concerns, don't hesitate to let me know. We are always here to be of
> assistance!
>
> Sincerely yours,
> Michael Cheng
> Microsoft Online Partner Support
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ========================================
=============
> Business-Critical Phone Support (BCPS) provides you with technical phone
> support at no charge during critical LAN outages or "business down"
> situations. This benefit is available 24 hours a day, 7 days a w
> Microsoft technology partners in the United States and Canada.
> This and other support options are available here:
> BCPS:
> https://partner.microsoft.com/US/te...erview/40010469
> Others: https://partner.microsoft.com/US/te...upportoverview/
> If you are outside the United States, please visit our International
> Support page:
> http://support.microsoft.com/defaul...rnational.aspx.
> ========================================
=============
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
Thursday, March 8, 2012
Can't created a linked server on a named instance to default insta
t
instance using intergrated security. It seems to work fine from a default
instance to any other SQL instance, including a named instance, but any time
I create the linked server on the named instance a call to the linked server
fails with the error:
Msg 18452, Level 14, State 1, Line 1
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
All servers are running SQL Server 2000 and the only difference in the
installation besides the fact one is named, is that the named instance is SP
4
and all others are SP3.
From a default instance the following works fine:
sp_addlinkedserver 'ORDEV01'
ORDEV01.Master.dbo.sp_helpdb
and the following to a named instance works as well:
sp_addlinkedserver 'LOU\Master'
[LOU\Master].Master.dbo.sp_helpdb
But if I try to created a linked server on the name dinstance LOU\Master I
get the error:
Msg 18452, Level 14, State 1, Line 1
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
Thanks in advance for any help.Byron
Does the instance have Windows Authentication?
"Byron" <Byron@.discussions.microsoft.com> wrote in message
news:CB90A676-83FF-41CC-9C04-221920F998FF@.microsoft.com...
>I have been trying to create a linked server on a named instance to a
>default
> instance using intergrated security. It seems to work fine from a default
> instance to any other SQL instance, including a named instance, but any
> time
> I create the linked server on the named instance a call to the linked
> server
> fails with the error:
> Msg 18452, Level 14, State 1, Line 1
> Login failed for user '(null)'. Reason: Not associated with a trusted SQL
> Server connection.
> All servers are running SQL Server 2000 and the only difference in the
> installation besides the fact one is named, is that the named instance is
> SP4
> and all others are SP3.
> From a default instance the following works fine:
> sp_addlinkedserver 'ORDEV01'
> ORDEV01.Master.dbo.sp_helpdb
> and the following to a named instance works as well:
> sp_addlinkedserver 'LOU\Master'
> [LOU\Master].Master.dbo.sp_helpdb
> But if I try to created a linked server on the name dinstance LOU\Master I
> get the error:
> Msg 18452, Level 14, State 1, Line 1
> Login failed for user '(null)'. Reason: Not associated with a trusted SQL
> Server connection.
> Thanks in advance for any help.
cant create VIEW. HELP!
SQL> CREATE VIEW
2 "MY_ADDSTUDENTTARGET" ("DEMOGRAPHICID","ETHNICITYID","REFERRERID","DEMOGRAPHICSTUDENTID","ACADE
MICYEARID","DOB","EMAIL","FNAME","HOMEADDRESS1","HOMEADDRESS2","HOMECITY","HOMECOUNTRY","HOMEPOST","
HOMESTATE","LNAME","MAILINGADDRESS1","MAILINGADDRESS2","MAILINGCITY","MAILINGCOUNTRY","MAILINGPOST",
"MAILINGSTATE","MNAME","PHONE1","SEX","SSN","STUDENTSTATUS","STUDENTTYPE","SUPPCOLLEGEID","CURRENTOU
","MAJORID","OUSTUDENTTYPE","VA","SUPPHSID","HOMEHS","HSADDR1","HSADDR2","HSCITY","HSSTATE","HSPOST"
,"HSPHONE","LOGINID","STUDENTACCOUNTID", "ACCOUNTID", "ACCOUNTSTUDENTID")
3 AS
4 SELECT DEMOGRAPHIC.DEMOGRAPHICID, DEMOGRAPHIC.ETHNICITYID, DEMOGRAPHIC.REFERRERID, DEMOGRAPHIC.
STUDENTID, STUDENT.ACADEMICYEARID, STUDENT.DOB, STUDENT.EMAIL, STUDENT.FNAME, STUDENT.HOMEADDRESS1,S
TUDENT.HOMEADDRESS2, STUDENT.HOMECITY, STUDENT.HOMECOUNTRY, STUDENT.HOMEPOST, STUDENT.HOMESTATE, STU
DENT.LNAME, STUDENT.MAILINGADDRESS1, STUDENT.MAILINGADDRESS2, STUDENT.MAILINGCITY, STUDENT.MAILINGCO
UNTRY, STUDENT.MAILINGPOST, STUDENT.MAILINGSTATE, STUDENT.MNAME, STUDENT.PHONE1, STUDENT.SEX, STUDEN
T.SSN, STUDENT.STUDENTSTATUS, STUDENT.STUDENTTYPE, SUPPCOLLEGE.SUPPCOLLEGEID, SUPPCOLLEGE.CURRENTOU,
SUPPCOLLEGE.MAJORID, SUPPCOLLEGE.OUSTUDENTTYPE, SUPPCOLLEGE.VA, SUPPHS.SUPPHSID, SUPPHS.HOMEHS, SUP
PHS.HSADDR1, SUPPHS.HSADDR2, SUPPHS.HSCITY, SUPPHS.HSSTATE, SUPPHS.HSPOST, SUPPHS.HSPHONE, STUDENT.L
OGINID, STUDENTACCOUNT.STUDENTACCOUNTID, STUDENTACCOUNT.ACCOUNTID, STUDENTACCOUNT.STUDENTID
5 FROM DEMOGRAPHIC, STUDENT, SUPPCOLLEGE, SUPPHS, STUDENTACCOUNT;
i get the followimg error: "MY_ADDSTUDENTTARGET" ("DEMOGRAPHICID","ETHNICITYID","REFERRERID","DEMOGRAPHICSTUDENTID","ACADEMICYE
ERROR at line 2:
ORA-00972: identifier is too long
if i do it without the quotes around the VIEW name and column names, i get this error: MICYEARID,DOB,EMAIL,FNAME,HOMEADDRESS1,HOMEADDRESS 2,HOMECITY,HOMECOUNTRY,HOMEPOST,
*
ERROR at line 3:
ORA-00907: missing right parenthesis
help, i don't know what to do.
thanks.
system: WinXP, Oracle8iEach column name has a limit of 30 characters from SQL / PLSQL.
"SESTUDENTACCOUNT.STUDENTACCOUNTID"|||well, i got rid of that really long column name (31 chars), but i am still getting the same error. any ideas?|||never mind, i figured it out. apparently, there is a command line string limit in pl/sql. you learn something new every day i guess.
Can't create trigger
and WHID is one field of it.
I use the code below to create a trigger but fail with message:
"The multi-part identifier "Inserted.PID" could not be bound."
How can I do that?
-----
create trigger trigWH on WH
AFTER INSERT
AS
UPDATE WH SET WHID=1 WHERE WH.PID=Inserted.PID and
WH.GradeID=Inserted.GradeID and WH.Sem=Inserted.Sem
GOUPDATE WH SET WHID=1
FROM inserted -- you were missing this...
WHERE
WH.PID=Inserted.PID
and
W.GradeID=Inserted.GradeID
and
WH.Sem=Inserted.Sem
"ad" <flying@.wfes.tcc.edu.tw> wrote in message
news:OV$Aie9tFHA.3932@.TK2MSFTNGP15.phx.gbl...
>I have a WH table with three primary key: PID, SchYears, Sem.
> and WHID is one field of it.
> I use the code below to create a trigger but fail with message:
> "The multi-part identifier "Inserted.PID" could not be bound."
> How can I do that?
> -----
> create trigger trigWH on WH
> AFTER INSERT
> AS
> UPDATE WH SET WHID=1 WHERE WH.PID=Inserted.PID and
> WH.GradeID=Inserted.GradeID and WH.Sem=Inserted.Sem
> GO
>|||To complete it
UPDATE WH SET WHID=1
FROM inserted INNER JOIN WH ON
WH.PID=Inserted.PID
and
W.GradeID=Inserted.GradeID
and
WH.Sem=Inserted.Sem
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"ad" <flying@.wfes.tcc.edu.tw> wrote in message
news:OV$Aie9tFHA.3932@.TK2MSFTNGP15.phx.gbl...
>I have a WH table with three primary key: PID, SchYears, Sem.
> and WHID is one field of it.
> I use the code below to create a trigger but fail with message:
> "The multi-part identifier "Inserted.PID" could not be bound."
> How can I do that?
> -----
> create trigger trigWH on WH
> AFTER INSERT
> AS
> UPDATE WH SET WHID=1 WHERE WH.PID=Inserted.PID and
> WH.GradeID=Inserted.GradeID and WH.Sem=Inserted.Sem
> GO
>
Can't create trigger
and WHID is one field of it.
I use the code below to create a trigger but fail with message:
"The multi-part identifier "Inserted.PID" could not be bound."
How can I do that?
-----
create trigger trigWH on WH
AFTER INSERT
AS
UPDATE WH SET WHID=1 WHERE WH.PID=Inserted.PID and
WH.GradeID=Inserted.GradeID and WH.Sem=Inserted.Sem
GO
UPDATE WH SET WHID=1
FROM inserted -- you were missing this...
WHERE
WH.PID=Inserted.PID
and
W.GradeID=Inserted.GradeID
and
WH.Sem=Inserted.Sem
"ad" <flying@.wfes.tcc.edu.tw> wrote in message
news:OV$Aie9tFHA.3932@.TK2MSFTNGP15.phx.gbl...
>I have a WH table with three primary key: PID, SchYears, Sem.
> and WHID is one field of it.
> I use the code below to create a trigger but fail with message:
> "The multi-part identifier "Inserted.PID" could not be bound."
> How can I do that?
> -----
> create trigger trigWH on WH
> AFTER INSERT
> AS
> UPDATE WH SET WHID=1 WHERE WH.PID=Inserted.PID and
> WH.GradeID=Inserted.GradeID and WH.Sem=Inserted.Sem
> GO
>
|||To complete it
UPDATE WH SET WHID=1
FROM inserted INNER JOIN WH ON
WH.PID=Inserted.PID
and
W.GradeID=Inserted.GradeID
and
WH.Sem=Inserted.Sem
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"ad" <flying@.wfes.tcc.edu.tw> wrote in message
news:OV$Aie9tFHA.3932@.TK2MSFTNGP15.phx.gbl...
>I have a WH table with three primary key: PID, SchYears, Sem.
> and WHID is one field of it.
> I use the code below to create a trigger but fail with message:
> "The multi-part identifier "Inserted.PID" could not be bound."
> How can I do that?
> -----
> create trigger trigWH on WH
> AFTER INSERT
> AS
> UPDATE WH SET WHID=1 WHERE WH.PID=Inserted.PID and
> WH.GradeID=Inserted.GradeID and WH.Sem=Inserted.Sem
> GO
>
Can't create trigger
and WHID is one field of it.
I use the code below to create a trigger but fail with message:
"The multi-part identifier "Inserted.PID" could not be bound."
How can I do that?
----
--
create trigger trigWH on WH
AFTER INSERT
AS
UPDATE WH SET WHID=1 WHERE WH.PID=Inserted.PID and
WH.GradeID=Inserted.GradeID and WH.Sem=Inserted.Sem
GOUPDATE WH SET WHID=1
FROM inserted -- you were missing this...
WHERE
WH.PID=Inserted.PID
and
W.GradeID=Inserted.GradeID
and
WH.Sem=Inserted.Sem
"ad" <flying@.wfes.tcc.edu.tw> wrote in message
news:OV$Aie9tFHA.3932@.TK2MSFTNGP15.phx.gbl...
>I have a WH table with three primary key: PID, SchYears, Sem.
> and WHID is one field of it.
> I use the code below to create a trigger but fail with message:
> "The multi-part identifier "Inserted.PID" could not be bound."
> How can I do that?
> ----
--
> create trigger trigWH on WH
> AFTER INSERT
> AS
> UPDATE WH SET WHID=1 WHERE WH.PID=Inserted.PID and
> WH.GradeID=Inserted.GradeID and WH.Sem=Inserted.Sem
> GO
>|||To complete it
UPDATE WH SET WHID=1
FROM inserted INNER JOIN WH ON
WH.PID=Inserted.PID
and
W.GradeID=Inserted.GradeID
and
WH.Sem=Inserted.Sem
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"ad" <flying@.wfes.tcc.edu.tw> wrote in message
news:OV$Aie9tFHA.3932@.TK2MSFTNGP15.phx.gbl...
>I have a WH table with three primary key: PID, SchYears, Sem.
> and WHID is one field of it.
> I use the code below to create a trigger but fail with message:
> "The multi-part identifier "Inserted.PID" could not be bound."
> How can I do that?
> ----
--
> create trigger trigWH on WH
> AFTER INSERT
> AS
> UPDATE WH SET WHID=1 WHERE WH.PID=Inserted.PID and
> WH.GradeID=Inserted.GradeID and WH.Sem=Inserted.Sem
> GO
>
Can't create table definition with primary key and SMO.
I'm trying this code, but it doesn't work. Can you help me?
I show you the error and code...I don't understand what is the adverted "Primary element" in error messaje and I'm really astonished because one time the code works whitout index definition, but any way, it doesn't work now.
Thanks,
Asereware
Context Info:
Visual C# Express Edition.
SQL Server 2005 Express & SQL Server 2000. The behavior is the same in both.
Error message:
<ERROR>-
Fuente:Vivenda.Testings
Descripción simple:
Error de Crear para Tabla 'dbo.AsereTablaSMO1'.
Detalle:
Microsoft.SqlServer.Management.Smo.FailedOperationException: Error de Crear para
Tabla 'dbo.AsereTablaSMO1'. > Microsoft.SqlServer.Management.Smo.FailedOper
ationException: No se puede crear Table '[dbo].[AsereTablaSMO1]' si aún no se ha
creado el elemento primario.
en Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetParentObject()
en Microsoft.SqlServer.Management.Smo.SqlSmoObject.CreateImplInit(StringColle
ction& createQuery, ScriptingOptions& so)
en Microsoft.SqlServer.Management.Smo.SqlSmoObject.CreateImpl()
Fin del seguimiento de la pila de la excepción interna
en Vivenda.Testings.Program.TestSQLServerSMO() en Program.cs:línea 640
en Vivenda.Testings.Program.Main(String[] args) en Program.cs:línea 50
Source Code:
private static void TestSQLServerSMO()
{
SqlConnection cnn = null;
Microsoft.SqlServer.Management.Common.ServerConnection cnn1 = null;
try
{
cnn = new SqlConnection("data source=(local);initial catalog=bap;Integrated Security=true;Connect Timeout=30");
cnn1 = new Microsoft.SqlServer.Management.Common.ServerConnection(cnn);
Server local = new Server(cnn1);
Database vivenda = new Database(local, "pubs");
if (vivenda.Tables.Contains("AsereTablaSMO1"))
vivenda.Tables["AsereTablaSMO1"].Drop();
//--
//Table definition
//--
Table impTable = new Table(vivenda, "AsereTablaSMO1");
Column col1 = new Column(impTable, "AsID", new DataType(SqlDataType.Int));
col1.Nullable = false;
col1.Identity = true;
impTable.Columns.Add(col1);
Column col2 = new Column(impTable, "Description", new DataType(SqlDataType.NVarChar, 150));
col2.Nullable = true;
impTable.Columns.Add(col2);
//-
//Index def
//-
if (impTable.Indexes.Contains("PKI_AsereTablaSMO1"))
impTable.Indexes["PKI_AsereTablaSMO1"].Drop();
Index idx = new Index(impTable, "PKI_AsereTablaSMO1");
idx.IndexedColumns.Add(new IndexedColumn(idx, col1.Name));
idx.IsClustered = true;
idx.IsUnique = true;
idx.IndexKeyType = IndexKeyType.DriPrimaryKey;
//Create object.
impTable.Create();
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (cnn1 != null)
{
cnn1.Disconnect();
cnn1 = null;
}
}
}
//End
You have to create the table before you can create an index on the table. Consider this VB example (derived from the Books Online examples):
Dim srv As Server
srv = New Server("MyServer")
'Reference the AdventureWorks database.
Dim db As Database
db = srv.Databases("AdventureWorks")
'Define a Table object variable by supplying the parent database and table name in the constructor.
Dim tb As Table
tb = New Table(db, "Test_Table")
'Add various columns to the table.
Dim col1 As Column
col1 = New Column(tb, "Name", DataType.NChar(50))
col1.Collation = "Latin1_General_CI_AS"
col1.Nullable = True
tb.Columns.Add(col1)
Dim col2 As Column
col2 = New Column(tb, "ID", DataType.Int)
col2.Identity = True
col2.IdentitySeed = 1
col2.IdentityIncrement = 1
tb.Columns.Add(col2)
Dim col3 As Column
col3 = New Column(tb, "Value", DataType.Real)
tb.Columns.Add(col3)
Dim col4 As Column
col4 = New Column(tb, "Date", DataType.DateTime)
col4.Nullable = False
tb.Columns.Add(col4)
'Create the table on the instance of SQL Server.
tb.Create()
Dim idx As Index
idx = New Index(tb, "TestIndex")
'Add indexed columns to the index.
Dim icol1 As IndexedColumn
icol1 = New IndexedColumn(idx, "ID", True)
idx.IndexedColumns.Add(icol1)
idx.IndexKeyType = IndexKeyType.DriUniqueKey
idx.IsClustered = False
idx.FillFactor = 50
'Create the index on the instance of SQL Server.
idx.Create()
If you try to create the index before issuing the tb.Create() method you get an exception, because the table doesn't yet exist. By creating the index after the table has been created the idx.Create() works without exception.
|||Thanks Allen. Here is the final code section changed and working:
Alvaro
//Create object. It is fundamental before set index.
impTable.Create();
//-
//Index def
//-
if (impTable.Indexes.Contains("PKI_AsereTablaSMO1"))
impTable.Indexes["PKI_AsereTablaSMO1"].Drop();
Index idx = new Index(impTable, "PKI_AsereTablaSMO1");
idx.IndexedColumns.Add(new IndexedColumn(idx, col1.Name));
idx.IsClustered = true;
idx.IsUnique = true;
idx.IndexKeyType = IndexKeyType.DriPrimaryKey;
//-
//Create Index.
//-
idx.Create();
Can't create table definition with primary key and SMO.
I'm trying this code, but it doesn't work. Can you help me?
I show you the error and code...I don't understand what is the adverted "Primary element" in error messaje and I'm really astonished because one time the code works whitout index definition, but any way, it doesn't work now.
Thanks,
Asereware
Context Info:
Visual C# Express Edition.
SQL Server 2005 Express & SQL Server 2000. The behavior is the same in both.
Error message:
<ERROR>-
Fuente:Vivenda.Testings
Descripción simple:
Error de Crear para Tabla 'dbo.AsereTablaSMO1'.
Detalle:
Microsoft.SqlServer.Management.Smo.FailedOperationException: Error de Crear para
Tabla 'dbo.AsereTablaSMO1'. > Microsoft.SqlServer.Management.Smo.FailedOper
ationException: No se puede crear Table '[dbo].[AsereTablaSMO1]' si aún no se ha
creado el elemento primario.
en Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetParentObject()
en Microsoft.SqlServer.Management.Smo.SqlSmoObject.CreateImplInit(StringColle
ction& createQuery, ScriptingOptions& so)
en Microsoft.SqlServer.Management.Smo.SqlSmoObject.CreateImpl()
Fin del seguimiento de la pila de la excepción interna
en Vivenda.Testings.Program.TestSQLServerSMO() en Program.cs:línea 640
en Vivenda.Testings.Program.Main(String[] args) en Program.cs:línea 50
Source Code:
private static void TestSQLServerSMO()
{
SqlConnection cnn = null;
Microsoft.SqlServer.Management.Common.ServerConnection cnn1 = null;
try
{
cnn = new SqlConnection("data source=(local);initial catalog=bap;Integrated Security=true;Connect Timeout=30");
cnn1 = new Microsoft.SqlServer.Management.Common.ServerConnection(cnn);
Server local = new Server(cnn1);
Database vivenda = new Database(local, "pubs");
if (vivenda.Tables.Contains("AsereTablaSMO1"))
vivenda.Tables["AsereTablaSMO1"].Drop();
//--
//Table definition
//--
Table impTable = new Table(vivenda, "AsereTablaSMO1");
Column col1 = new Column(impTable, "AsID", new DataType(SqlDataType.Int));
col1.Nullable = false;
col1.Identity = true;
impTable.Columns.Add(col1);
Column col2 = new Column(impTable, "Description", new DataType(SqlDataType.NVarChar, 150));
col2.Nullable = true;
impTable.Columns.Add(col2);
//-
//Index def
//-
if (impTable.Indexes.Contains("PKI_AsereTablaSMO1"))
impTable.Indexes["PKI_AsereTablaSMO1"].Drop();
Index idx = new Index(impTable, "PKI_AsereTablaSMO1");
idx.IndexedColumns.Add(new IndexedColumn(idx, col1.Name));
idx.IsClustered = true;
idx.IsUnique = true;
idx.IndexKeyType = IndexKeyType.DriPrimaryKey;
//Create object.
impTable.Create();
}
catch (Exception ex)
{
throw (ex);
}
finally
{
if (cnn1 != null)
{
cnn1.Disconnect();
cnn1 = null;
}
}
}
//End
You have to create the table before you can create an index on the table. Consider this VB example (derived from the Books Online examples):
Dim srv As Server
srv = New Server("MyServer")
'Reference the AdventureWorks database.
Dim db As Database
db = srv.Databases("AdventureWorks")
'Define a Table object variable by supplying the parent database and table name in the constructor.
Dim tb As Table
tb = New Table(db, "Test_Table")
'Add various columns to the table.
Dim col1 As Column
col1 = New Column(tb, "Name", DataType.NChar(50))
col1.Collation = "Latin1_General_CI_AS"
col1.Nullable = True
tb.Columns.Add(col1)
Dim col2 As Column
col2 = New Column(tb, "ID", DataType.Int)
col2.Identity = True
col2.IdentitySeed = 1
col2.IdentityIncrement = 1
tb.Columns.Add(col2)
Dim col3 As Column
col3 = New Column(tb, "Value", DataType.Real)
tb.Columns.Add(col3)
Dim col4 As Column
col4 = New Column(tb, "Date", DataType.DateTime)
col4.Nullable = False
tb.Columns.Add(col4)
'Create the table on the instance of SQL Server.
tb.Create()
Dim idx As Index
idx = New Index(tb, "TestIndex")
'Add indexed columns to the index.
Dim icol1 As IndexedColumn
icol1 = New IndexedColumn(idx, "ID", True)
idx.IndexedColumns.Add(icol1)
idx.IndexKeyType = IndexKeyType.DriUniqueKey
idx.IsClustered = False
idx.FillFactor = 50
'Create the index on the instance of SQL Server.
idx.Create()
If you try to create the index before issuing the tb.Create() method you get an exception, because the table doesn't yet exist. By creating the index after the table has been created the idx.Create() works without exception.
|||Thanks Allen. Here is the final code section changed and working:
Alvaro
//Create object. It is fundamental before set index.
impTable.Create();
//-
//Index def
//-
if (impTable.Indexes.Contains("PKI_AsereTablaSMO1"))
impTable.Indexes["PKI_AsereTablaSMO1"].Drop();
Index idx = new Index(impTable, "PKI_AsereTablaSMO1");
idx.IndexedColumns.Add(new IndexedColumn(idx, col1.Name));
idx.IsClustered = true;
idx.IsUnique = true;
idx.IndexKeyType = IndexKeyType.DriPrimaryKey;
//-
//Create Index.
//-
idx.Create();
Cant create table
When I get to the mysql promt and type:
create table mytable(id int);
I get this error:
ERROR 1046 <3D000>: No database selected
It seems that I need to create a database first, but I was told this was not
necessary to create a table, is this right?You'll probably get a better response in a MySQL forum - this
newsgroup is for Microsoft SQL Server.
http://www.google.com/search?source...ySQL+ERROR+1046
Simon
Cant create table
ERROR 1005 (HY000): Can't create table '.\haps\transcript.frm' (errno: 150)
create table teaching (
ProfId int,
CrsCode varchar(10),
Semester varchar(10),
primary key(ProfId, CrsCode, Semester)
) engine=InnoDB;
create table transcript (
StudId int,
CrsCode varchar(10),
Semester varchar(10),
primary key(StudId, CrsCode, Semester),
foreign key(CrsCode, Semester) references teaching(ProfId, CrsCode,
Semester)
) engine=InnoDB;
What am I doing wrong??For starters, you're posting in the wrong newsgroup :)
Try posting in the MySQL newsgroups, rather than the SQL Server groups,
and they might be help to give you better insight. However, this link
might point you in the right direction.
http://www.mysqlusers.com/msg/11638.html
HTH,
Stu|||Because you are in MySql
"blumi" <test@.me.com> a crit dans le message de news:
d9roip$m29$1@.news.net.uni-c.dk...
>I get this error when I try to create the following tables:
>
> ERROR 1005 (HY000): Can't create table '.\haps\transcript.frm' (errno:
> 150)
> create table teaching (
> ProfId int,
> CrsCode varchar(10),
> Semester varchar(10),
> primary key(ProfId, CrsCode, Semester)
> ) engine=InnoDB;
>
> create table transcript (
> StudId int,
> CrsCode varchar(10),
> Semester varchar(10),
> primary key(StudId, CrsCode, Semester),
> foreign key(CrsCode, Semester) references teaching(ProfId, CrsCode,
> Semester)
> ) engine=InnoDB;
> What am I doing wrong??
Cant Create Subscription...
I've got a strange problem that I can't quite figure out. Whenever I go to setup a new subscription for a report (any report) I can't select a schedule or create the subscription.
I get to the Subscription page, but pressing any of the buttons: "Ok", "Cancel", "Select Schedule" does nothing.
Anyone else ever have this issue?
Any feedback would be greatly appreciated.
can you able to see SubscriptionProperties.aspx Page after clicking on New Subscription.
Thanx
Rohit|||
Yeah, pressing "New Subscription" takes me to the form (SubscriptionProperties.aspx), but not matter what button I press on the form - Ok, Cancel, Select Schedule... nothing happens.
It's as if you were creating an .aspx form and set "AutoPostBack" on a control to false. Clicking on any of the buttons does nothing. Therefore, I'm not able to create a new subscription or alter
any of the subscriptions schedules that I currently have.
I've restarted the reportserver service and I've restarted the application pool. Neither helps.
Just wanted to follow up on this in case that someone else runs accross this. This was a framework issue with SP1. Not really related to Reporting Services, but possibly relevant nonetheless.
http://channel9.msdn.com/showpost.aspx?postid=21650