Showing posts with label description. Show all posts
Showing posts with label description. Show all posts

Wednesday, March 21, 2012

Primary Key on Two Columns

How can I create a primary key on two columns? I could not find any sensible code sample or description how it should be done. It is clear from MSDN that it is possible but there are no examples.

There is a textbox "Included Columns" in one of the tools for setting primary keys for one column but it does not allow me to enter anything.

Thanks.

Drop table T1

CREATE TABLE [dbo].[T1](

[c1] char(10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

Angel [int] NOT NULL,

Beer [nchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,

CONSTRAINT [PK_T1] PRIMARY KEY CLUSTERED

(

Angel ASC,

Beer ASC

)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

) ON [PRIMARY]

one way is as above mentioned , here your pk will be created on column a and b

from Management studio , open the table highlight the multiple colum and press right button. you can select set primary key option

Madhu

|||This is cute, esp the management studio approach. Thank you.

Friday, March 9, 2012

'PRIMARY' filegroup is full

Hi,
In our development server, when we tried to insert some large data we had
this error message -
.......................
SQL error description: [Microsoft][ODBC SQL Server Driver][SQL Server]Could
not allocate space for object '<TABLE NAME>' in database '<DATABASE>' because
the 'PRIMARY' filegroup is full.
.......................
The file property 'Automatically grow file' is selected for both data and
log file. Again maxsize is unlimited with growth set to 10% for both files.
How can I resolve this issue? Can someone let me know please.
Many thanks in advance,
Harish Mohanbabu
MBS Axapta - MVP
http://www.harishm.com/
Harish
Are you sure there is enough disk space?
If you are, it is probably during the insertion autogow feature kicks in and
you've got the error.
Try update statistics and not inserting a large amount of data, instead
divide the transaction into a small one
"Harish Mohanbabu" <Axapta@.online.nospam> wrote in message
news:3D9837CC-C9FE-4773-9145-601C1C4F2A98@.microsoft.com...
> Hi,
> In our development server, when we tried to insert some large data we had
> this error message -
> ......................
> SQL error description: [Microsoft][ODBC SQL Server Driver][SQL
> Server]Could
> not allocate space for object '<TABLE NAME>' in database '<DATABASE>'
> because
> the 'PRIMARY' filegroup is full.
> ......................
> The file property 'Automatically grow file' is selected for both data and
> log file. Again maxsize is unlimited with growth set to 10% for both
> files.
> How can I resolve this issue? Can someone let me know please.
> Many thanks in advance,
> Harish Mohanbabu
> --
> MBS Axapta - MVP
> http://www.harishm.com/
|||Hi Uri,
Thanks for your response.
Well - there is plenty of hard disk space (approx 50 GB). And I am afraid I
can't break the data any further than this.
BTW, I just tried increasing space allowed to the data file. Do you think
this will make any difference? Meanwhile I will try to do the import once
again and see how it goes.
Regards,
Harish Mohanbabu
MBS Axapta - MVP
http://www.harishm.com/
"Uri Dimant" wrote:

> Harish
> Are you sure there is enough disk space?
> If you are, it is probably during the insertion autogow feature kicks in and
> you've got the error.
> Try update statistics and not inserting a large amount of data, instead
> divide the transaction into a small one
|||After increasing the space allowed, I tried pushing quite some volume of
data. Looks like this did the trick. Now it is working fine again!
Harish Mohanbabu
MBS Axapta - MVP
http://www.harishm.com/
"Harish Mohanbabu" wrote:

> Hi Uri,
> Thanks for your response.
> Well - there is plenty of hard disk space (approx 50 GB). And I am afraid I
> can't break the data any further than this.
> BTW, I just tried increasing space allowed to the data file. Do you think
> this will make any difference? Meanwhile I will try to do the import once
> again and see how it goes.
> Regards,
> Harish Mohanbabu
> --
> MBS Axapta - MVP
> http://www.harishm.com/
|||If you get a timeout during autogrow, the autogrow that had occurred will be rolled back. End result
is that it appears that autogrow doesn't work.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Harish Mohanbabu" <Axapta@.online.nospam> wrote in message
news:10C9E60A-4823-44B3-9D28-0B1172B8627F@.microsoft.com...[vbcol=seagreen]
> After increasing the space allowed, I tried pushing quite some volume of
> data. Looks like this did the trick. Now it is working fine again!
> Harish Mohanbabu
> --
> MBS Axapta - MVP
> http://www.harishm.com/
> "Harish Mohanbabu" wrote:
|||Hello,
Based on my research, generally this error occurs when the amount of time
SQL server was taking to expand the file exceeded the allowed time built-in
and thus the
error. We can resolve the issue by setting the increment to be larger or
increase the database data file.
Sophie Guo
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
================================================== ===
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.

'PRIMARY' filegroup is full

Hi,
In our development server, when we tried to insert some large data we had
this error message -
......................
SQL error description: [Microsoft][ODBC SQL Server Driver][SQL S
erver]Could
not allocate space for object '<TABLE NAME>' in database '<DATABASE>' becaus
e
the 'PRIMARY' filegroup is full.
......................
The file property 'Automatically grow file' is selected for both data and
log file. Again maxsize is unlimited with growth set to 10% for both files.
How can I resolve this issue? Can someone let me know please.
Many thanks in advance,
Harish Mohanbabu
--
MBS Axapta - MVP
http://www.harishm.com/Harish
Are you sure there is enough disk space?
If you are, it is probably during the insertion autogow feature kicks in and
you've got the error.
Try update statistics and not inserting a large amount of data, instead
divide the transaction into a small one
"Harish Mohanbabu" <Axapta@.online.nospam> wrote in message
news:3D9837CC-C9FE-4773-9145-601C1C4F2A98@.microsoft.com...
> Hi,
> In our development server, when we tried to insert some large data we had
> this error message -
> ......................
> SQL error description: [Microsoft][ODBC SQL Server Driver][SQL
> Server]Could
> not allocate space for object '<TABLE NAME>' in database '<DATABASE>'
> because
> the 'PRIMARY' filegroup is full.
> ......................
> The file property 'Automatically grow file' is selected for both data and
> log file. Again maxsize is unlimited with growth set to 10% for both
> files.
> How can I resolve this issue? Can someone let me know please.
> Many thanks in advance,
> Harish Mohanbabu
> --
> MBS Axapta - MVP
> http://www.harishm.com/|||Hi Uri,
Thanks for your response.
Well - there is plenty of hard disk space (approx 50 GB). And I am afraid I
can't break the data any further than this.
BTW, I just tried increasing space allowed to the data file. Do you think
this will make any difference? Meanwhile I will try to do the import once
again and see how it goes.
Regards,
Harish Mohanbabu
--
MBS Axapta - MVP
http://www.harishm.com/
"Uri Dimant" wrote:

> Harish
> Are you sure there is enough disk space?
> If you are, it is probably during the insertion autogow feature kicks in a
nd
> you've got the error.
> Try update statistics and not inserting a large amount of data, instead
> divide the transaction into a small one|||After increasing the space allowed, I tried pushing quite some volume of
data. Looks like this did the trick. Now it is working fine again!
Harish Mohanbabu
--
MBS Axapta - MVP
http://www.harishm.com/
"Harish Mohanbabu" wrote:

> Hi Uri,
> Thanks for your response.
> Well - there is plenty of hard disk space (approx 50 GB). And I am afraid
I
> can't break the data any further than this.
> BTW, I just tried increasing space allowed to the data file. Do you think
> this will make any difference? Meanwhile I will try to do the import once
> again and see how it goes.
> Regards,
> Harish Mohanbabu
> --
> MBS Axapta - MVP
> http://www.harishm.com/|||If you get a timeout during autogrow, the autogrow that had occurred will be
rolled back. End result
is that it appears that autogrow doesn't work.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Harish Mohanbabu" <Axapta@.online.nospam> wrote in message
news:10C9E60A-4823-44B3-9D28-0B1172B8627F@.microsoft.com...[vbcol=seagreen]
> After increasing the space allowed, I tried pushing quite some volume of
> data. Looks like this did the trick. Now it is working fine again!
> Harish Mohanbabu
> --
> MBS Axapta - MVP
> http://www.harishm.com/
> "Harish Mohanbabu" wrote:
>|||Hello,
Based on my research, generally this error occurs when the amount of time
SQL server was taking to expand the file exceeded the allowed time built-in
and thus the
error. We can resolve the issue by setting the increment to be larger or
increase the database data file.
Sophie Guo
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
========================================
=============
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.

'PRIMARY' filegroup is full

Hi,
In our development server, when we tried to insert some large data we had
this error message -
......................
SQL error description: [Microsoft][ODBC SQL Server Driver][SQL Server]Could
not allocate space for object '<TABLE NAME>' in database '<DATABASE>' because
the 'PRIMARY' filegroup is full.
......................
The file property 'Automatically grow file' is selected for both data and
log file. Again maxsize is unlimited with growth set to 10% for both files.
How can I resolve this issue? Can someone let me know please.
Many thanks in advance,
Harish Mohanbabu
--
MBS Axapta - MVP
http://www.harishm.com/Harish
Are you sure there is enough disk space?
If you are, it is probably during the insertion autogow feature kicks in and
you've got the error.
Try update statistics and not inserting a large amount of data, instead
divide the transaction into a small one
"Harish Mohanbabu" <Axapta@.online.nospam> wrote in message
news:3D9837CC-C9FE-4773-9145-601C1C4F2A98@.microsoft.com...
> Hi,
> In our development server, when we tried to insert some large data we had
> this error message -
> ......................
> SQL error description: [Microsoft][ODBC SQL Server Driver][SQL
> Server]Could
> not allocate space for object '<TABLE NAME>' in database '<DATABASE>'
> because
> the 'PRIMARY' filegroup is full.
> ......................
> The file property 'Automatically grow file' is selected for both data and
> log file. Again maxsize is unlimited with growth set to 10% for both
> files.
> How can I resolve this issue? Can someone let me know please.
> Many thanks in advance,
> Harish Mohanbabu
> --
> MBS Axapta - MVP
> http://www.harishm.com/|||Hi Uri,
Thanks for your response.
Well - there is plenty of hard disk space (approx 50 GB). And I am afraid I
can't break the data any further than this.
BTW, I just tried increasing space allowed to the data file. Do you think
this will make any difference? Meanwhile I will try to do the import once
again and see how it goes.
Regards,
Harish Mohanbabu
--
MBS Axapta - MVP
http://www.harishm.com/
"Uri Dimant" wrote:
> Harish
> Are you sure there is enough disk space?
> If you are, it is probably during the insertion autogow feature kicks in and
> you've got the error.
> Try update statistics and not inserting a large amount of data, instead
> divide the transaction into a small one|||After increasing the space allowed, I tried pushing quite some volume of
data. Looks like this did the trick. Now it is working fine again!
Harish Mohanbabu
--
MBS Axapta - MVP
http://www.harishm.com/
"Harish Mohanbabu" wrote:
> Hi Uri,
> Thanks for your response.
> Well - there is plenty of hard disk space (approx 50 GB). And I am afraid I
> can't break the data any further than this.
> BTW, I just tried increasing space allowed to the data file. Do you think
> this will make any difference? Meanwhile I will try to do the import once
> again and see how it goes.
> Regards,
> Harish Mohanbabu
> --
> MBS Axapta - MVP
> http://www.harishm.com/|||If you get a timeout during autogrow, the autogrow that had occurred will be rolled back. End result
is that it appears that autogrow doesn't work.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Harish Mohanbabu" <Axapta@.online.nospam> wrote in message
news:10C9E60A-4823-44B3-9D28-0B1172B8627F@.microsoft.com...
> After increasing the space allowed, I tried pushing quite some volume of
> data. Looks like this did the trick. Now it is working fine again!
> Harish Mohanbabu
> --
> MBS Axapta - MVP
> http://www.harishm.com/
> "Harish Mohanbabu" wrote:
>> Hi Uri,
>> Thanks for your response.
>> Well - there is plenty of hard disk space (approx 50 GB). And I am afraid I
>> can't break the data any further than this.
>> BTW, I just tried increasing space allowed to the data file. Do you think
>> this will make any difference? Meanwhile I will try to do the import once
>> again and see how it goes.
>> Regards,
>> Harish Mohanbabu
>> --
>> MBS Axapta - MVP
>> http://www.harishm.com/|||Hello,
Based on my research, generally this error occurs when the amount of time
SQL server was taking to expand the file exceeded the allowed time built-in
and thus the
error. We can resolve the issue by setting the increment to be larger or
increase the database data file.
Sophie Guo
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
=====================================================When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================This posting is provided "AS IS" with no warranties, and confers no rights.