Is it possible to create variables of type enum in PL/SQL?
In VB.NET it would be something like e.g.: enum seasons {Spring, Summer, Autumn, Winter}
Thx.Originally posted by OracleDev
Is it possible to create variables of type enum in PL/SQL?
In VB.NET it would be something like e.g.: enum seasons {Spring, Summer, Autumn, Winter}
Thx.
No, PL/SQL does not have such a type.|||I feared this, because I couldn't find info about it.
Thx anyway.
Showing posts with label type. Show all posts
Showing posts with label type. Show all posts
Thursday, March 29, 2012
Thursday, March 22, 2012
Enterprise Mgr as an end-user data manipulation tool
As DBAs we typically restrict the use of Enterprise Manager and other DBA
Admin type utilities from end-users. Even with a user's SQL server
permissions being appropriately defined and restricted, to limit their
abilities within Enterprise Manager, I typically do not allow end users to
use Enterprise Manager, for the same reason that an Exchange administrator
doesn't allow end-users to run Exchange Administrator to manage their
mailbox. It's an administration utility and is not intended as a data
manipulation interface.
I am faced with a unique situation where a 'power user' insists on wanting
to use SQL Enterprise Manager to access a particular database to which he has
read/write permissions to the production data, as he wants to browse and
modify data ad-hoc within the Enterprise Manager GUI (by right-clicking on a
table and selecting the 'Open, Return All Rows', etc. Due to political
reasons beyond my control, it appears that I will be 'told' to let him use
Enterprise Manager by upper management, so that the user can manage the data
via SQL EM.
Outside of the technical reasons why an end-user should not be using SQL
Enterprise Manager as the GUI to manage data within a database, even with
proper security, does anyone know of official audit guidelines that would
raise a 'red flag' if an audit determined that an end-user(s) were managing
data via SQL Enterprise Manager?
Thanks
D
Apart from read/write to certain tables in the DB, what other rights does
this user have within the server and database? The fact that an end-user
can (knowingly or not), if their rights aren't severely restricted, drop a
table, access and modify security/login info, modify/overwrite/delete
backups, add/remove indexes, etc. would make me wary.
Maybe you can suggest to them that this guy use Access as the front end, and
Link the tables he needs into Access so he can edit to his heart's content
without getting anywhere near EM?
"DBADave" <DBADave@.discussions.microsoft.com> wrote in message
news:D8E94FA5-3F83-4B63-9EFA-1A65F14C1857@.microsoft.com...
> As DBAs we typically restrict the use of Enterprise Manager and other DBA
> Admin type utilities from end-users. Even with a user's SQL server
> permissions being appropriately defined and restricted, to limit their
> abilities within Enterprise Manager, I typically do not allow end users to
> use Enterprise Manager, for the same reason that an Exchange administrator
> doesn't allow end-users to run Exchange Administrator to manage their
> mailbox. It's an administration utility and is not intended as a data
> manipulation interface.
> I am faced with a unique situation where a 'power user' insists on wanting
> to use SQL Enterprise Manager to access a particular database to which he
> has
> read/write permissions to the production data, as he wants to browse and
> modify data ad-hoc within the Enterprise Manager GUI (by right-clicking on
> a
> table and selecting the 'Open, Return All Rows', etc. Due to political
> reasons beyond my control, it appears that I will be 'told' to let him use
> Enterprise Manager by upper management, so that the user can manage the
> data
> via SQL EM.
> Outside of the technical reasons why an end-user should not be using SQL
> Enterprise Manager as the GUI to manage data within a database, even with
> proper security, does anyone know of official audit guidelines that would
> raise a 'red flag' if an audit determined that an end-user(s) were
> managing
> data via SQL Enterprise Manager?
> Thanks
> D
Admin type utilities from end-users. Even with a user's SQL server
permissions being appropriately defined and restricted, to limit their
abilities within Enterprise Manager, I typically do not allow end users to
use Enterprise Manager, for the same reason that an Exchange administrator
doesn't allow end-users to run Exchange Administrator to manage their
mailbox. It's an administration utility and is not intended as a data
manipulation interface.
I am faced with a unique situation where a 'power user' insists on wanting
to use SQL Enterprise Manager to access a particular database to which he has
read/write permissions to the production data, as he wants to browse and
modify data ad-hoc within the Enterprise Manager GUI (by right-clicking on a
table and selecting the 'Open, Return All Rows', etc. Due to political
reasons beyond my control, it appears that I will be 'told' to let him use
Enterprise Manager by upper management, so that the user can manage the data
via SQL EM.
Outside of the technical reasons why an end-user should not be using SQL
Enterprise Manager as the GUI to manage data within a database, even with
proper security, does anyone know of official audit guidelines that would
raise a 'red flag' if an audit determined that an end-user(s) were managing
data via SQL Enterprise Manager?
Thanks
D
Apart from read/write to certain tables in the DB, what other rights does
this user have within the server and database? The fact that an end-user
can (knowingly or not), if their rights aren't severely restricted, drop a
table, access and modify security/login info, modify/overwrite/delete
backups, add/remove indexes, etc. would make me wary.
Maybe you can suggest to them that this guy use Access as the front end, and
Link the tables he needs into Access so he can edit to his heart's content
without getting anywhere near EM?
"DBADave" <DBADave@.discussions.microsoft.com> wrote in message
news:D8E94FA5-3F83-4B63-9EFA-1A65F14C1857@.microsoft.com...
> As DBAs we typically restrict the use of Enterprise Manager and other DBA
> Admin type utilities from end-users. Even with a user's SQL server
> permissions being appropriately defined and restricted, to limit their
> abilities within Enterprise Manager, I typically do not allow end users to
> use Enterprise Manager, for the same reason that an Exchange administrator
> doesn't allow end-users to run Exchange Administrator to manage their
> mailbox. It's an administration utility and is not intended as a data
> manipulation interface.
> I am faced with a unique situation where a 'power user' insists on wanting
> to use SQL Enterprise Manager to access a particular database to which he
> has
> read/write permissions to the production data, as he wants to browse and
> modify data ad-hoc within the Enterprise Manager GUI (by right-clicking on
> a
> table and selecting the 'Open, Return All Rows', etc. Due to political
> reasons beyond my control, it appears that I will be 'told' to let him use
> Enterprise Manager by upper management, so that the user can manage the
> data
> via SQL EM.
> Outside of the technical reasons why an end-user should not be using SQL
> Enterprise Manager as the GUI to manage data within a database, even with
> proper security, does anyone know of official audit guidelines that would
> raise a 'red flag' if an audit determined that an end-user(s) were
> managing
> data via SQL Enterprise Manager?
> Thanks
> D
Enterprise Mgr as an end-user data manipulation tool
As DBAs we typically restrict the use of Enterprise Manager and other DBA
Admin type utilities from end-users. Even with a user's SQL server
permissions being appropriately defined and restricted, to limit their
abilities within Enterprise Manager, I typically do not allow end users to
use Enterprise Manager, for the same reason that an Exchange administrator
doesn't allow end-users to run Exchange Administrator to manage their
mailbox. It's an administration utility and is not intended as a data
manipulation interface.
I am faced with a unique situation where a 'power user' insists on wanting
to use SQL Enterprise Manager to access a particular database to which he ha
s
read/write permissions to the production data, as he wants to browse and
modify data ad-hoc within the Enterprise Manager GUI (by right-clicking on a
table and selecting the 'Open, Return All Rows', etc. Due to political
reasons beyond my control, it appears that I will be 'told' to let him use
Enterprise Manager by upper management, so that the user can manage the data
via SQL EM.
Outside of the technical reasons why an end-user should not be using SQL
Enterprise Manager as the GUI to manage data within a database, even with
proper security, does anyone know of official audit guidelines that would
raise a 'red flag' if an audit determined that an end-user(s) were managing
data via SQL Enterprise Manager?
Thanks
DApart from read/write to certain tables in the DB, what other rights does
this user have within the server and database? The fact that an end-user
can (knowingly or not), if their rights aren't severely restricted, drop a
table, access and modify security/login info, modify/overwrite/delete
backups, add/remove indexes, etc. would make me wary.
Maybe you can suggest to them that this guy use Access as the front end, and
Link the tables he needs into Access so he can edit to his heart's content
without getting anywhere near EM?
"DBADave" <DBADave@.discussions.microsoft.com> wrote in message
news:D8E94FA5-3F83-4B63-9EFA-1A65F14C1857@.microsoft.com...
> As DBAs we typically restrict the use of Enterprise Manager and other DBA
> Admin type utilities from end-users. Even with a user's SQL server
> permissions being appropriately defined and restricted, to limit their
> abilities within Enterprise Manager, I typically do not allow end users to
> use Enterprise Manager, for the same reason that an Exchange administrator
> doesn't allow end-users to run Exchange Administrator to manage their
> mailbox. It's an administration utility and is not intended as a data
> manipulation interface.
> I am faced with a unique situation where a 'power user' insists on wanting
> to use SQL Enterprise Manager to access a particular database to which he
> has
> read/write permissions to the production data, as he wants to browse and
> modify data ad-hoc within the Enterprise Manager GUI (by right-clicking on
> a
> table and selecting the 'Open, Return All Rows', etc. Due to political
> reasons beyond my control, it appears that I will be 'told' to let him use
> Enterprise Manager by upper management, so that the user can manage the
> data
> via SQL EM.
> Outside of the technical reasons why an end-user should not be using SQL
> Enterprise Manager as the GUI to manage data within a database, even with
> proper security, does anyone know of official audit guidelines that would
> raise a 'red flag' if an audit determined that an end-user(s) were
> managing
> data via SQL Enterprise Manager?
> Thanks
> D
Admin type utilities from end-users. Even with a user's SQL server
permissions being appropriately defined and restricted, to limit their
abilities within Enterprise Manager, I typically do not allow end users to
use Enterprise Manager, for the same reason that an Exchange administrator
doesn't allow end-users to run Exchange Administrator to manage their
mailbox. It's an administration utility and is not intended as a data
manipulation interface.
I am faced with a unique situation where a 'power user' insists on wanting
to use SQL Enterprise Manager to access a particular database to which he ha
s
read/write permissions to the production data, as he wants to browse and
modify data ad-hoc within the Enterprise Manager GUI (by right-clicking on a
table and selecting the 'Open, Return All Rows', etc. Due to political
reasons beyond my control, it appears that I will be 'told' to let him use
Enterprise Manager by upper management, so that the user can manage the data
via SQL EM.
Outside of the technical reasons why an end-user should not be using SQL
Enterprise Manager as the GUI to manage data within a database, even with
proper security, does anyone know of official audit guidelines that would
raise a 'red flag' if an audit determined that an end-user(s) were managing
data via SQL Enterprise Manager?
Thanks
DApart from read/write to certain tables in the DB, what other rights does
this user have within the server and database? The fact that an end-user
can (knowingly or not), if their rights aren't severely restricted, drop a
table, access and modify security/login info, modify/overwrite/delete
backups, add/remove indexes, etc. would make me wary.
Maybe you can suggest to them that this guy use Access as the front end, and
Link the tables he needs into Access so he can edit to his heart's content
without getting anywhere near EM?
"DBADave" <DBADave@.discussions.microsoft.com> wrote in message
news:D8E94FA5-3F83-4B63-9EFA-1A65F14C1857@.microsoft.com...
> As DBAs we typically restrict the use of Enterprise Manager and other DBA
> Admin type utilities from end-users. Even with a user's SQL server
> permissions being appropriately defined and restricted, to limit their
> abilities within Enterprise Manager, I typically do not allow end users to
> use Enterprise Manager, for the same reason that an Exchange administrator
> doesn't allow end-users to run Exchange Administrator to manage their
> mailbox. It's an administration utility and is not intended as a data
> manipulation interface.
> I am faced with a unique situation where a 'power user' insists on wanting
> to use SQL Enterprise Manager to access a particular database to which he
> has
> read/write permissions to the production data, as he wants to browse and
> modify data ad-hoc within the Enterprise Manager GUI (by right-clicking on
> a
> table and selecting the 'Open, Return All Rows', etc. Due to political
> reasons beyond my control, it appears that I will be 'told' to let him use
> Enterprise Manager by upper management, so that the user can manage the
> data
> via SQL EM.
> Outside of the technical reasons why an end-user should not be using SQL
> Enterprise Manager as the GUI to manage data within a database, even with
> proper security, does anyone know of official audit guidelines that would
> raise a 'red flag' if an audit determined that an end-user(s) were
> managing
> data via SQL Enterprise Manager?
> Thanks
> D
Enterprise Mgr - alter table fails
My developers just started having this problem a few weeks ago. Nearly
any type of "design" table changes are failing in Enterprise Mgr. This
only seems to be happening on the servers running Enterprise Edition.
Standard Edition and MSDE do not have the problem.
All are running SQL2000 - SP4. Some servers are Win2000 Server SP4 and
others are Win2003 Server - SP4. The Windows version does not seem to
matter. I am not aware of any maintenace applied to the SQL servers,
but all workstations have recently had automatic updates turned on and
have received some updates.
Here is the most common example. The developer needs to change the
length of a field in a table. They use Enterprise Mgr, right click on
the table and select "design". They make their change and when they
hit save, they get the following error. (There is no data in the
table.)
'prob1' table
- Unable to create index 'PK_prob1'.
ODBC error: MicrosoftODBC SQL Server DriverSQL ServerTable 'prob1'
already has a primary key defined on it.
MicrosoftODBC SQL Server DriverSQL ServerCould not create constraint.
See previous errors.
I can not just tell them to switch over and use Query Analyzer. Some
of these people have little or no SQL knowledge and would never make it
through alter table statements. They build tables for their front page
apps and that's as far as they get into SQL.
Any thoughts would be helpful. I've scoured support and newsgroups and
can only find old 6.5 and 7.0 reports. I've included the DDL to create
the table if needed. I get the error just changing F2 from 20 to 25
for example.
if exists (select * from dbo.sysobjects where id =
object_id(N'dbo.prob1') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table dbo.prob1
GO
CREATE TABLE dbo.prob1 (
f1 char (10) NOT NULL ,
f2 char (20) NULL ,
f3 char (30) NULL
) ON PRIMARY
GO
ALTER TABLE dbo.prob1 ADD
CONSTRAINT PK_prob1 PRIMARY KEY CLUSTERED
(
f1
) ON PRIMARY
GO
Hi,
Just a small thought..
As you have applied SP4 to your SQL Servers, have you applied SP4 to all of
the development machines where the client tools (EM, QA) are installed, too?
Robert
<stephanie.harrell@.stateauto.com> wrote in message
news:1142271519.219796.202000@.i40g2000cwc.googlegr oups.com...
> My developers just started having this problem a few weeks ago. Nearly
> any type of "design" table changes are failing in Enterprise Mgr. This
> only seems to be happening on the servers running Enterprise Edition.
> Standard Edition and MSDE do not have the problem.
> All are running SQL2000 - SP4. Some servers are Win2000 Server SP4 and
> others are Win2003 Server - SP4. The Windows version does not seem to
> matter. I am not aware of any maintenace applied to the SQL servers,
> but all workstations have recently had automatic updates turned on and
> have received some updates.
> Here is the most common example. The developer needs to change the
> length of a field in a table. They use Enterprise Mgr, right click on
> the table and select "design". They make their change and when they
> hit save, they get the following error. (There is no data in the
> table.)
> 'prob1' table
> - Unable to create index 'PK_prob1'.
> ODBC error: MicrosoftODBC SQL Server DriverSQL ServerTable 'prob1'
> already has a primary key defined on it.
> MicrosoftODBC SQL Server DriverSQL ServerCould not create constraint.
> See previous errors.
>
> I can not just tell them to switch over and use Query Analyzer. Some
> of these people have little or no SQL knowledge and would never make it
> through alter table statements. They build tables for their front page
> apps and that's as far as they get into SQL.
> Any thoughts would be helpful. I've scoured support and newsgroups and
> can only find old 6.5 and 7.0 reports. I've included the DDL to create
> the table if needed. I get the error just changing F2 from 20 to 25
> for example.
>
> if exists (select * from dbo.sysobjects where id =
> object_id(N'dbo.prob1') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
> drop table dbo.prob1
> GO
> CREATE TABLE dbo.prob1 (
> f1 char (10) NOT NULL ,
> f2 char (20) NULL ,
> f3 char (30) NULL
> ) ON PRIMARY
> GO
> ALTER TABLE dbo.prob1 ADD
> CONSTRAINT PK_prob1 PRIMARY KEY CLUSTERED
> (
> f1
> ) ON PRIMARY
> GO
>
|||Yes, all servers have SP4. As for client tools, I would say the
majority are. There may be a couple older machines that are not
current, but have not heard from any of those people - if there are any.
|||(stephanie.harrell@.stateauto.com) writes:
> Here is the most common example. The developer needs to change the
> length of a field in a table. They use Enterprise Mgr, right click on
> the table and select "design". They make their change and when they
> hit save, they get the following error. (There is no data in the
> table.)
> 'prob1' table
> - Unable to create index 'PK_prob1'.
> ODBC error: MicrosoftODBC SQL Server DriverSQL ServerTable 'prob1'
> already has a primary key defined on it.
> MicrosoftODBC SQL Server DriverSQL ServerCould not create constraint.
> See previous errors.
>
> I can not just tell them to switch over and use Query Analyzer. Some
> of these people have little or no SQL knowledge and would never make it
> through alter table statements. They build tables for their front page
> apps and that's as far as they get into SQL.
To be very blunt, if they can't write change scripts with ALTER TABLE,
they should not be changing tables at all. Performing changes to tables
is an advanced operation, and requires careful understanding, particularly
if you are to do it in a production environment.
The Design Table function in EM has several serious flaws (and all these
flaws are carried over to SQL 2005). I include a list below, from a post
that I made just the other day.
I was not able to reproduce the problem with the table you posted. But
you could get an idea of what's going by requesting getting a change
script from EM. (Which you should do anyway, because of all the bugs
in the Table Designer.) You find this function on the 3rd button from
the left in the toolbar.
Here is a list of know defenciencies with the Table Designer:
1) The transaction scope is wacko. What should be one transaction is
split up into several, which can lead to a table change being only
partly implemented, and your database becomes a mess. Or you just lose
constraints, without knowing it.
2) In the generated script, the transaction spans multiple batches. This
means that if one batch fails with a batch-aborting error, the
transaction is rolled back. The remaining batches in the script are
still carried out which is not likely what you want. (This flaw does
not appear if you save directly, as the Table Designer does not continue
to submit batches if there is an error.)
3) The table designer essentially behaves as there has been no later
version of SQL Server. That is, in many cases where it could use
ALTER TABLE, it instead runs a script where it creates a new table
and copies data over.
4) Say that you have to tables A and B. B has an FK to A. You first make a
change to B, and generate a script. Then you change your mind, and
close without saving anything. Instead you make a change A. When you
generate script (or even worse just press Save), you find that the
change to B is included.
5) All constraints that are reapplied, are reapplied WITH NOCHECK,
which means that they are not trusted as far as the optimizer is
concerned. This have serious impact on performance, not the least
with partitioned views.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
|||Thank you for your reply and you are certainly entitled to your opinion
on who should change tables. Our set up works for us. We support a
large audience of developers at varying levels of expertise and this is
the first time we've encountered any problems with the tool. I will
pass along your suggestion on generating the change script to our
developers.
|||(stephanie.harrell@.stateauto.com) writes:
> Thank you for your reply and you are certainly entitled to your opinion
> on who should change tables. Our set up works for us. We support a
> large audience of developers at varying levels of expertise and this is
> the first time we've encountered any problems with the tool.
That you know of. Some of the problems that I pointed out are of the
kind that you may not notice directly when they cause problems. If you
lose an FK constraint, you may not notice until years later when you find
some junk in the column.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
|||I thought I would let you know that I found the problem. The
XACT_ABORT option had been turned on server-wide. The new tools with
SQL 2005 allow you to turn that option off/on in the server properties
and someone had turned it on. Once I turned it back off, Enterprise
Manager worked like a champ again. Guess this is why we have
development servers - to learn lessons the hard way.
Thanks all!
Erland Sommarskog wrote:
> (stephanie.harrell@.stateauto.com) writes:
> That you know of. Some of the problems that I pointed out are of the
> kind that you may not notice directly when they cause problems. If you
> lose an FK constraint, you may not notice until years later when you find
> some junk in the column.
>
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/pro...ads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinf...ons/books.mspx
any type of "design" table changes are failing in Enterprise Mgr. This
only seems to be happening on the servers running Enterprise Edition.
Standard Edition and MSDE do not have the problem.
All are running SQL2000 - SP4. Some servers are Win2000 Server SP4 and
others are Win2003 Server - SP4. The Windows version does not seem to
matter. I am not aware of any maintenace applied to the SQL servers,
but all workstations have recently had automatic updates turned on and
have received some updates.
Here is the most common example. The developer needs to change the
length of a field in a table. They use Enterprise Mgr, right click on
the table and select "design". They make their change and when they
hit save, they get the following error. (There is no data in the
table.)
'prob1' table
- Unable to create index 'PK_prob1'.
ODBC error: MicrosoftODBC SQL Server DriverSQL ServerTable 'prob1'
already has a primary key defined on it.
MicrosoftODBC SQL Server DriverSQL ServerCould not create constraint.
See previous errors.
I can not just tell them to switch over and use Query Analyzer. Some
of these people have little or no SQL knowledge and would never make it
through alter table statements. They build tables for their front page
apps and that's as far as they get into SQL.
Any thoughts would be helpful. I've scoured support and newsgroups and
can only find old 6.5 and 7.0 reports. I've included the DDL to create
the table if needed. I get the error just changing F2 from 20 to 25
for example.
if exists (select * from dbo.sysobjects where id =
object_id(N'dbo.prob1') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table dbo.prob1
GO
CREATE TABLE dbo.prob1 (
f1 char (10) NOT NULL ,
f2 char (20) NULL ,
f3 char (30) NULL
) ON PRIMARY
GO
ALTER TABLE dbo.prob1 ADD
CONSTRAINT PK_prob1 PRIMARY KEY CLUSTERED
(
f1
) ON PRIMARY
GO
Hi,
Just a small thought..
As you have applied SP4 to your SQL Servers, have you applied SP4 to all of
the development machines where the client tools (EM, QA) are installed, too?
Robert
<stephanie.harrell@.stateauto.com> wrote in message
news:1142271519.219796.202000@.i40g2000cwc.googlegr oups.com...
> My developers just started having this problem a few weeks ago. Nearly
> any type of "design" table changes are failing in Enterprise Mgr. This
> only seems to be happening on the servers running Enterprise Edition.
> Standard Edition and MSDE do not have the problem.
> All are running SQL2000 - SP4. Some servers are Win2000 Server SP4 and
> others are Win2003 Server - SP4. The Windows version does not seem to
> matter. I am not aware of any maintenace applied to the SQL servers,
> but all workstations have recently had automatic updates turned on and
> have received some updates.
> Here is the most common example. The developer needs to change the
> length of a field in a table. They use Enterprise Mgr, right click on
> the table and select "design". They make their change and when they
> hit save, they get the following error. (There is no data in the
> table.)
> 'prob1' table
> - Unable to create index 'PK_prob1'.
> ODBC error: MicrosoftODBC SQL Server DriverSQL ServerTable 'prob1'
> already has a primary key defined on it.
> MicrosoftODBC SQL Server DriverSQL ServerCould not create constraint.
> See previous errors.
>
> I can not just tell them to switch over and use Query Analyzer. Some
> of these people have little or no SQL knowledge and would never make it
> through alter table statements. They build tables for their front page
> apps and that's as far as they get into SQL.
> Any thoughts would be helpful. I've scoured support and newsgroups and
> can only find old 6.5 and 7.0 reports. I've included the DDL to create
> the table if needed. I get the error just changing F2 from 20 to 25
> for example.
>
> if exists (select * from dbo.sysobjects where id =
> object_id(N'dbo.prob1') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
> drop table dbo.prob1
> GO
> CREATE TABLE dbo.prob1 (
> f1 char (10) NOT NULL ,
> f2 char (20) NULL ,
> f3 char (30) NULL
> ) ON PRIMARY
> GO
> ALTER TABLE dbo.prob1 ADD
> CONSTRAINT PK_prob1 PRIMARY KEY CLUSTERED
> (
> f1
> ) ON PRIMARY
> GO
>
|||Yes, all servers have SP4. As for client tools, I would say the
majority are. There may be a couple older machines that are not
current, but have not heard from any of those people - if there are any.
|||(stephanie.harrell@.stateauto.com) writes:
> Here is the most common example. The developer needs to change the
> length of a field in a table. They use Enterprise Mgr, right click on
> the table and select "design". They make their change and when they
> hit save, they get the following error. (There is no data in the
> table.)
> 'prob1' table
> - Unable to create index 'PK_prob1'.
> ODBC error: MicrosoftODBC SQL Server DriverSQL ServerTable 'prob1'
> already has a primary key defined on it.
> MicrosoftODBC SQL Server DriverSQL ServerCould not create constraint.
> See previous errors.
>
> I can not just tell them to switch over and use Query Analyzer. Some
> of these people have little or no SQL knowledge and would never make it
> through alter table statements. They build tables for their front page
> apps and that's as far as they get into SQL.
To be very blunt, if they can't write change scripts with ALTER TABLE,
they should not be changing tables at all. Performing changes to tables
is an advanced operation, and requires careful understanding, particularly
if you are to do it in a production environment.
The Design Table function in EM has several serious flaws (and all these
flaws are carried over to SQL 2005). I include a list below, from a post
that I made just the other day.
I was not able to reproduce the problem with the table you posted. But
you could get an idea of what's going by requesting getting a change
script from EM. (Which you should do anyway, because of all the bugs
in the Table Designer.) You find this function on the 3rd button from
the left in the toolbar.
Here is a list of know defenciencies with the Table Designer:
1) The transaction scope is wacko. What should be one transaction is
split up into several, which can lead to a table change being only
partly implemented, and your database becomes a mess. Or you just lose
constraints, without knowing it.
2) In the generated script, the transaction spans multiple batches. This
means that if one batch fails with a batch-aborting error, the
transaction is rolled back. The remaining batches in the script are
still carried out which is not likely what you want. (This flaw does
not appear if you save directly, as the Table Designer does not continue
to submit batches if there is an error.)
3) The table designer essentially behaves as there has been no later
version of SQL Server. That is, in many cases where it could use
ALTER TABLE, it instead runs a script where it creates a new table
and copies data over.
4) Say that you have to tables A and B. B has an FK to A. You first make a
change to B, and generate a script. Then you change your mind, and
close without saving anything. Instead you make a change A. When you
generate script (or even worse just press Save), you find that the
change to B is included.
5) All constraints that are reapplied, are reapplied WITH NOCHECK,
which means that they are not trusted as far as the optimizer is
concerned. This have serious impact on performance, not the least
with partitioned views.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
|||Thank you for your reply and you are certainly entitled to your opinion
on who should change tables. Our set up works for us. We support a
large audience of developers at varying levels of expertise and this is
the first time we've encountered any problems with the tool. I will
pass along your suggestion on generating the change script to our
developers.
|||(stephanie.harrell@.stateauto.com) writes:
> Thank you for your reply and you are certainly entitled to your opinion
> on who should change tables. Our set up works for us. We support a
> large audience of developers at varying levels of expertise and this is
> the first time we've encountered any problems with the tool.
That you know of. Some of the problems that I pointed out are of the
kind that you may not notice directly when they cause problems. If you
lose an FK constraint, you may not notice until years later when you find
some junk in the column.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
|||I thought I would let you know that I found the problem. The
XACT_ABORT option had been turned on server-wide. The new tools with
SQL 2005 allow you to turn that option off/on in the server properties
and someone had turned it on. Once I turned it back off, Enterprise
Manager worked like a champ again. Guess this is why we have
development servers - to learn lessons the hard way.
Thanks all!
Erland Sommarskog wrote:
> (stephanie.harrell@.stateauto.com) writes:
> That you know of. Some of the problems that I pointed out are of the
> kind that you may not notice directly when they cause problems. If you
> lose an FK constraint, you may not notice until years later when you find
> some junk in the column.
>
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/pro...ads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinf...ons/books.mspx
Sunday, February 26, 2012
Enterprise Manager data entry limit
I have a table that has several fields of data type varchar
(4000). I cannot enter more that 1024 characters using
Enterprise Manager. I can create a table in Access and
import it or use VB to populate the table without any
problem. Why doesn't EM allow data to be entered up to the
field length in the table design?
Hi,
Sorry to tell this.
Enterprise manager is a GUI tool to do database administration, it is not a
tool to do data entry. You can very well
use Query Analyzer to insert the text data into a table using INSERT
statement.
Insert into table_name values('jhsajdhaskdlksadhsalkdjsaldjlsadjlsajdjl.. .n
characters)
Thanks
Hari
MCDBA
"Colin" <anonymous@.discussions.microsoft.com> wrote in message
news:1db6a01c4546c$17824130$a101280a@.phx.gbl...
> I have a table that has several fields of data type varchar
> (4000). I cannot enter more that 1024 characters using
> Enterprise Manager. I can create a table in Access and
> import it or use VB to populate the table without any
> problem. Why doesn't EM allow data to be entered up to the
> field length in the table design?
|||Colin,
I don't know the answer to your question, perhaps its a limit of the
grid control that is used? I have a question for you. Why do you want to
insert such huge values through Enterprise Manager? Why not just write a
quick script in Query Analyzer to insert the data?
Also beware that you could run into problems if all your field lengths
exceed the size of a data page (8k).
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Colin wrote:
> I have a table that has several fields of data type varchar
> (4000). I cannot enter more that 1024 characters using
> Enterprise Manager. I can create a table in Access and
> import it or use VB to populate the table without any
> problem. Why doesn't EM allow data to be entered up to the
> field length in the table design?
|||Thanks for the replies.
I understand EM is not the tool to use for data
entry...just curious why it limited data entry in this
way.
|||Hi Colin,
I've been chatting with the SQL MVPs and some people at Microsoft about
this issue on your behalf, and I was told to RTFM. :-) SQL MVP, Steve
Kass pointed this out to me:
"Some of the limitations of Enterprise Manager are documented in the
following Books Online article:
Editing Rows in the Results Pane
In particular, that article says:
You can edit a memo-type column (such as a text, memo, or long character
column) if the column does not display <Long Text>. The Results pane can
accept up to 900 characters of text in memo-type columns. If you are
typing in a cell and exceed the amount of text that the Results pane can
accept, the Query Designer will beep to indicate that you have exceeded
this limit."
I hope this helps further.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Colin wrote:
> Thanks for the replies.
> I understand EM is not the tool to use for data
> entry...just curious why it limited data entry in this
> way.
(4000). I cannot enter more that 1024 characters using
Enterprise Manager. I can create a table in Access and
import it or use VB to populate the table without any
problem. Why doesn't EM allow data to be entered up to the
field length in the table design?
Hi,
Sorry to tell this.
Enterprise manager is a GUI tool to do database administration, it is not a
tool to do data entry. You can very well
use Query Analyzer to insert the text data into a table using INSERT
statement.
Insert into table_name values('jhsajdhaskdlksadhsalkdjsaldjlsadjlsajdjl.. .n
characters)
Thanks
Hari
MCDBA
"Colin" <anonymous@.discussions.microsoft.com> wrote in message
news:1db6a01c4546c$17824130$a101280a@.phx.gbl...
> I have a table that has several fields of data type varchar
> (4000). I cannot enter more that 1024 characters using
> Enterprise Manager. I can create a table in Access and
> import it or use VB to populate the table without any
> problem. Why doesn't EM allow data to be entered up to the
> field length in the table design?
|||Colin,
I don't know the answer to your question, perhaps its a limit of the
grid control that is used? I have a question for you. Why do you want to
insert such huge values through Enterprise Manager? Why not just write a
quick script in Query Analyzer to insert the data?
Also beware that you could run into problems if all your field lengths
exceed the size of a data page (8k).
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Colin wrote:
> I have a table that has several fields of data type varchar
> (4000). I cannot enter more that 1024 characters using
> Enterprise Manager. I can create a table in Access and
> import it or use VB to populate the table without any
> problem. Why doesn't EM allow data to be entered up to the
> field length in the table design?
|||Thanks for the replies.
I understand EM is not the tool to use for data
entry...just curious why it limited data entry in this
way.
|||Hi Colin,
I've been chatting with the SQL MVPs and some people at Microsoft about
this issue on your behalf, and I was told to RTFM. :-) SQL MVP, Steve
Kass pointed this out to me:
"Some of the limitations of Enterprise Manager are documented in the
following Books Online article:
Editing Rows in the Results Pane
In particular, that article says:
You can edit a memo-type column (such as a text, memo, or long character
column) if the column does not display <Long Text>. The Results pane can
accept up to 900 characters of text in memo-type columns. If you are
typing in a cell and exceed the amount of text that the Results pane can
accept, the Query Designer will beep to indicate that you have exceeded
this limit."
I hope this helps further.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Colin wrote:
> Thanks for the replies.
> I understand EM is not the tool to use for data
> entry...just curious why it limited data entry in this
> way.
Enterprise Manager data entry limit
I have a table that has several fields of data type varchar
(4000). I cannot enter more that 1024 characters using
Enterprise Manager. I can create a table in Access and
import it or use VB to populate the table without any
problem. Why doesn't EM allow data to be entered up to the
field length in the table design?Hi,
Sorry to tell this.
Enterprise manager is a GUI tool to do database administration, it is not a
tool to do data entry. You can very well
use Query Analyzer to insert the text data into a table using INSERT
statement.
Insert into table_name values('jhsajdhaskdlksadhsalkdjsaldjlsad
jlsajdjl...n
characters)
Thanks
Hari
MCDBA
"Colin" <anonymous@.discussions.microsoft.com> wrote in message
news:1db6a01c4546c$17824130$a101280a@.phx
.gbl...
> I have a table that has several fields of data type varchar
> (4000). I cannot enter more that 1024 characters using
> Enterprise Manager. I can create a table in Access and
> import it or use VB to populate the table without any
> problem. Why doesn't EM allow data to be entered up to the
> field length in the table design?|||Colin,
I don't know the answer to your question, perhaps its a limit of the
grid control that is used? I have a question for you. Why do you want to
insert such huge values through Enterprise Manager? Why not just write a
quick script in Query Analyzer to insert the data?
Also beware that you could run into problems if all your field lengths
exceed the size of a data page (8k).
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Colin wrote:
> I have a table that has several fields of data type varchar
> (4000). I cannot enter more that 1024 characters using
> Enterprise Manager. I can create a table in Access and
> import it or use VB to populate the table without any
> problem. Why doesn't EM allow data to be entered up to the
> field length in the table design?|||Thanks for the replies.
I understand EM is not the tool to use for data
entry...just curious why it limited data entry in this
way.|||Hi Colin,
I've been chatting with the SQL MVPs and some people at Microsoft about
this issue on your behalf, and I was told to RTFM. :-) SQL MVP, Steve
Kass pointed this out to me:
"Some of the limitations of Enterprise Manager are documented in the
following Books Online article:
Editing Rows in the Results Pane
In particular, that article says:
You can edit a memo-type column (such as a text, memo, or long character
column) if the column does not display <Long Text>. The Results pane can
accept up to 900 characters of text in memo-type columns. If you are
typing in a cell and exceed the amount of text that the Results pane can
accept, the Query Designer will beep to indicate that you have exceeded
this limit."
I hope this helps further.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Colin wrote:
> Thanks for the replies.
> I understand EM is not the tool to use for data
> entry...just curious why it limited data entry in this
> way.
(4000). I cannot enter more that 1024 characters using
Enterprise Manager. I can create a table in Access and
import it or use VB to populate the table without any
problem. Why doesn't EM allow data to be entered up to the
field length in the table design?Hi,
Sorry to tell this.
Enterprise manager is a GUI tool to do database administration, it is not a
tool to do data entry. You can very well
use Query Analyzer to insert the text data into a table using INSERT
statement.
Insert into table_name values('jhsajdhaskdlksadhsalkdjsaldjlsad
jlsajdjl...n
characters)
Thanks
Hari
MCDBA
"Colin" <anonymous@.discussions.microsoft.com> wrote in message
news:1db6a01c4546c$17824130$a101280a@.phx
.gbl...
> I have a table that has several fields of data type varchar
> (4000). I cannot enter more that 1024 characters using
> Enterprise Manager. I can create a table in Access and
> import it or use VB to populate the table without any
> problem. Why doesn't EM allow data to be entered up to the
> field length in the table design?|||Colin,
I don't know the answer to your question, perhaps its a limit of the
grid control that is used? I have a question for you. Why do you want to
insert such huge values through Enterprise Manager? Why not just write a
quick script in Query Analyzer to insert the data?
Also beware that you could run into problems if all your field lengths
exceed the size of a data page (8k).
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Colin wrote:
> I have a table that has several fields of data type varchar
> (4000). I cannot enter more that 1024 characters using
> Enterprise Manager. I can create a table in Access and
> import it or use VB to populate the table without any
> problem. Why doesn't EM allow data to be entered up to the
> field length in the table design?|||Thanks for the replies.
I understand EM is not the tool to use for data
entry...just curious why it limited data entry in this
way.|||Hi Colin,
I've been chatting with the SQL MVPs and some people at Microsoft about
this issue on your behalf, and I was told to RTFM. :-) SQL MVP, Steve
Kass pointed this out to me:
"Some of the limitations of Enterprise Manager are documented in the
following Books Online article:
Editing Rows in the Results Pane
In particular, that article says:
You can edit a memo-type column (such as a text, memo, or long character
column) if the column does not display <Long Text>. The Results pane can
accept up to 900 characters of text in memo-type columns. If you are
typing in a cell and exceed the amount of text that the Results pane can
accept, the Query Designer will beep to indicate that you have exceeded
this limit."
I hope this helps further.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Colin wrote:
> Thanks for the replies.
> I understand EM is not the tool to use for data
> entry...just curious why it limited data entry in this
> way.
Enterprise Manager data entry limit
I have a table that has several fields of data type varchar
(4000). I cannot enter more that 1024 characters using
Enterprise Manager. I can create a table in Access and
import it or use VB to populate the table without any
problem. Why doesn't EM allow data to be entered up to the
field length in the table design?Hi,
Sorry to tell this.
Enterprise manager is a GUI tool to do database administration, it is not a
tool to do data entry. You can very well
use Query Analyzer to insert the text data into a table using INSERT
statement.
Insert into table_name values('jhsajdhaskdlksadhsalkdjsaldjlsadjlsajdjl...n
characters)
Thanks
Hari
MCDBA
"Colin" <anonymous@.discussions.microsoft.com> wrote in message
news:1db6a01c4546c$17824130$a101280a@.phx.gbl...
> I have a table that has several fields of data type varchar
> (4000). I cannot enter more that 1024 characters using
> Enterprise Manager. I can create a table in Access and
> import it or use VB to populate the table without any
> problem. Why doesn't EM allow data to be entered up to the
> field length in the table design?|||Colin,
I don't know the answer to your question, perhaps its a limit of the
grid control that is used? I have a question for you. Why do you want to
insert such huge values through Enterprise Manager? Why not just write a
quick script in Query Analyzer to insert the data?
Also beware that you could run into problems if all your field lengths
exceed the size of a data page (8k).
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Colin wrote:
> I have a table that has several fields of data type varchar
> (4000). I cannot enter more that 1024 characters using
> Enterprise Manager. I can create a table in Access and
> import it or use VB to populate the table without any
> problem. Why doesn't EM allow data to be entered up to the
> field length in the table design?|||Thanks for the replies.
I understand EM is not the tool to use for data
entry...just curious why it limited data entry in this
way.|||Hi Colin,
I've been chatting with the SQL MVPs and some people at Microsoft about
this issue on your behalf, and I was told to RTFM. :-) SQL MVP, Steve
Kass pointed this out to me:
"Some of the limitations of Enterprise Manager are documented in the
following Books Online article:
Editing Rows in the Results Pane
In particular, that article says:
You can edit a memo-type column (such as a text, memo, or long character
column) if the column does not display <Long Text>. The Results pane can
accept up to 900 characters of text in memo-type columns. If you are
typing in a cell and exceed the amount of text that the Results pane can
accept, the Query Designer will beep to indicate that you have exceeded
this limit."
I hope this helps further.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Colin wrote:
> Thanks for the replies.
> I understand EM is not the tool to use for data
> entry...just curious why it limited data entry in this
> way.|||Can one of you experts give me some solutions?
We have small web-based sale order system linked to SQL server. One of the web page fields: "Remark" field only accepts 250 characters.
On the web page, the Remark field will let you type more than 250 characters. However, it only display maximum 250 characters in print preview. Any solutions?
Thank you in advance for any sugguestions.
"Colin" wrote:
> I have a table that has several fields of data type varchar
> (4000). I cannot enter more that 1024 characters using
> Enterprise Manager. I can create a table in Access and
> import it or use VB to populate the table without any
> problem. Why doesn't EM allow data to be entered up to the
> field length in the table design?
>
(4000). I cannot enter more that 1024 characters using
Enterprise Manager. I can create a table in Access and
import it or use VB to populate the table without any
problem. Why doesn't EM allow data to be entered up to the
field length in the table design?Hi,
Sorry to tell this.
Enterprise manager is a GUI tool to do database administration, it is not a
tool to do data entry. You can very well
use Query Analyzer to insert the text data into a table using INSERT
statement.
Insert into table_name values('jhsajdhaskdlksadhsalkdjsaldjlsadjlsajdjl...n
characters)
Thanks
Hari
MCDBA
"Colin" <anonymous@.discussions.microsoft.com> wrote in message
news:1db6a01c4546c$17824130$a101280a@.phx.gbl...
> I have a table that has several fields of data type varchar
> (4000). I cannot enter more that 1024 characters using
> Enterprise Manager. I can create a table in Access and
> import it or use VB to populate the table without any
> problem. Why doesn't EM allow data to be entered up to the
> field length in the table design?|||Colin,
I don't know the answer to your question, perhaps its a limit of the
grid control that is used? I have a question for you. Why do you want to
insert such huge values through Enterprise Manager? Why not just write a
quick script in Query Analyzer to insert the data?
Also beware that you could run into problems if all your field lengths
exceed the size of a data page (8k).
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Colin wrote:
> I have a table that has several fields of data type varchar
> (4000). I cannot enter more that 1024 characters using
> Enterprise Manager. I can create a table in Access and
> import it or use VB to populate the table without any
> problem. Why doesn't EM allow data to be entered up to the
> field length in the table design?|||Thanks for the replies.
I understand EM is not the tool to use for data
entry...just curious why it limited data entry in this
way.|||Hi Colin,
I've been chatting with the SQL MVPs and some people at Microsoft about
this issue on your behalf, and I was told to RTFM. :-) SQL MVP, Steve
Kass pointed this out to me:
"Some of the limitations of Enterprise Manager are documented in the
following Books Online article:
Editing Rows in the Results Pane
In particular, that article says:
You can edit a memo-type column (such as a text, memo, or long character
column) if the column does not display <Long Text>. The Results pane can
accept up to 900 characters of text in memo-type columns. If you are
typing in a cell and exceed the amount of text that the Results pane can
accept, the Query Designer will beep to indicate that you have exceeded
this limit."
I hope this helps further.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Colin wrote:
> Thanks for the replies.
> I understand EM is not the tool to use for data
> entry...just curious why it limited data entry in this
> way.|||Can one of you experts give me some solutions?
We have small web-based sale order system linked to SQL server. One of the web page fields: "Remark" field only accepts 250 characters.
On the web page, the Remark field will let you type more than 250 characters. However, it only display maximum 250 characters in print preview. Any solutions?
Thank you in advance for any sugguestions.
"Colin" wrote:
> I have a table that has several fields of data type varchar
> (4000). I cannot enter more that 1024 characters using
> Enterprise Manager. I can create a table in Access and
> import it or use VB to populate the table without any
> problem. Why doesn't EM allow data to be entered up to the
> field length in the table design?
>
Friday, February 24, 2012
Enterprise Manager 'Change Query Type' Window
I'm running a SQL Server Enterprise Manager. When I click on 'Change Query
Type', a window pops up on the bottom right hand corner of my screen with the
options: 'Select, Insert from, Insert into, Update, etc.'. The window used
to appear right under the bottom, but now every time I click it, the window
shows up on the bottom right of the screen. Does anyone know how to change
this? I want it to appear closer to the button.
Thanks,
On Fri, 17 Mar 2006 05:16:31 -0800, PML wrote:
>I'm running a SQL Server Enterprise Manager. When I click on 'Change Query
>Type', a window pops up on the bottom right hand corner of my screen with the
>options: 'Select, Insert from, Insert into, Update, etc.'. The window used
>to appear right under the bottom, but now every time I click it, the window
>shows up on the bottom right of the screen. Does anyone know how to change
>this? I want it to appear closer to the button.
Hi PML,
Don't use Enterprise Manager to design your queries. This part of EM has
lots of bugs and other "funny" issues.
http://www.aspfaq.com/show.asp?id=2455
Hugo Kornelis, SQL Server MVP
Type', a window pops up on the bottom right hand corner of my screen with the
options: 'Select, Insert from, Insert into, Update, etc.'. The window used
to appear right under the bottom, but now every time I click it, the window
shows up on the bottom right of the screen. Does anyone know how to change
this? I want it to appear closer to the button.
Thanks,
On Fri, 17 Mar 2006 05:16:31 -0800, PML wrote:
>I'm running a SQL Server Enterprise Manager. When I click on 'Change Query
>Type', a window pops up on the bottom right hand corner of my screen with the
>options: 'Select, Insert from, Insert into, Update, etc.'. The window used
>to appear right under the bottom, but now every time I click it, the window
>shows up on the bottom right of the screen. Does anyone know how to change
>this? I want it to appear closer to the button.
Hi PML,
Don't use Enterprise Manager to design your queries. This part of EM has
lots of bugs and other "funny" issues.
http://www.aspfaq.com/show.asp?id=2455
Hugo Kornelis, SQL Server MVP
Wednesday, February 15, 2012
Enter Default Values for all columns in all tables except Primary Keys
How can i enter Default Values of " " to all the columns of type character
of all the tables (excluding system tables) and Default Values of 0
of all columns of type numbers. Excluding all primary key columns.
of all the tables (excluding system tables) and Default Values of 0
of all columns of type numbers. Excluding all primary key columns.
Thank youOn Sun, 3 Apr 2005 18:05:46 -0400, serge wrote:
>How can i enter Default Values of " " to all the columns of type character
>of all the tables (excluding system tables) and Default Values of 0
>of all columns of type numbers. Excluding all primary key columns.
>Thank you
Hi Serge,
CREATE TABLE Example (PKCol int NOT NULL PRIMARY KEY,
NumCol int NOT NULL DEFAULT 0,
CharCol varchar(20) NOT NULL DEFAULT '')
go
INSERT Example (PKCol)
VALUES (1)
SELECT * FROM Example
go
DROP TABLE Example
go
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)
Subscribe to:
Posts (Atom)