Showing posts with label key. Show all posts
Showing posts with label key. Show all posts

Monday, March 12, 2012

How do I generate auto increment number in SQL Express?

Hi, in Access, I can use an Auto-Increment number for my primary key field. May I know how do I do that in SQL Express? In addition, is there any tutorial on how to use SQL Express to generate customised unique numbers (such as membership number, Customer ID such as A001 where A is based on the customer's name while 001 is due to the fact that the customer is the first among those with names starting with A)?Thanks a lot.For your first question: In SQL Server, you can use data type int as your identity column and assign this column as indentity field from the property window. It will work like autonumber field in Access.|||

cckiat:

Hi, in Access, I can use an Auto-Increment number for my primary key field. May I know how do I do that in SQL Express? In addition, is there any tutorial on how to use SQL Express to generate customised unique numbers (such as membership number, Customer ID such as A001 where A is based on the customer's name while 001 is due to the fact that the customer is the first among those with names starting with A)? Thanks a lot.

IDENTITY is the auto increament in SQL Server it is a property of the column, the second one you described is a SEQUENCE it is in Oracle not SQL Server but it is similar to IDENTITY. Both are defined by ANSI SQL but Microsoft and Oracle choose to implement one and not the other. But you can use GUID in SQL Server to generate Unique numbers but it is a 16bytes Binary data type so use it with care. Hope this helps.

Friday, March 9, 2012

How do I fire a sql statement from being seen by a trace session

Hi
I am trying to do an OPENROWSET call to an ODBC driver which needs a key
to work but i need to keep the KEY hidden from being seen/ traced.
Is there a way to execute an sql statement and disable a tracing session or
another way stop a OPENROWSET argument from being traced and duplicated.
Thank you in advance for your time..
EdwinEdwin,
You can't hide anything away from the Profiler. It's not guaranteed that
the Profiler will get every statement but you can't hide statements
kind regards
Greg O
Need to document your databases. Use the firs and still the best AGS SQL
Scribe
http://www.ag-software.com
"Exonet Developer" <Exonet Developer@.discussions.microsoft.com> wrote in
message news:C5F9A585-7362-41AC-8C2D-6D7574FFF60E@.microsoft.com...
> Hi
> I am trying to do an OPENROWSET call to an ODBC driver which needs a key
> to work but i need to keep the KEY hidden from being seen/ traced.
> Is there a way to execute an sql statement and disable a tracing session
> or
> another way stop a OPENROWSET argument from being traced and duplicated.
> Thank you in advance for your time..
> Edwin|||you can add sensitive text like "sp_addlogin" as comment in your sql
statements and sql profiler will hide this statement
Aleksandar Grbic
MCDBA, Senior Database Administrator
"Exonet Developer" wrote:

> Hi
> I am trying to do an OPENROWSET call to an ODBC driver which needs a key
> to work but i need to keep the KEY hidden from being seen/ traced.
> Is there a way to execute an sql statement and disable a tracing session o
r
> another way stop a OPENROWSET argument from being traced and duplicated.
> Thank you in advance for your time..
> Edwin|||Hi Aleksandar,
Can you give me an example of this. I don't really understand what you mean
kind regards
Greg O
"Aleksandar Grbic" <AleksandarGrbic@.discussions.microsoft.com> wrote in
message news:FD863E94-89C2-45D3-B682-F7AA03E0C07C@.microsoft.com...
> you can add sensitive text like "sp_addlogin" as comment in your sql
> statements and sql profiler will hide this statement
> --
> Aleksandar Grbic
> MCDBA, Senior Database Administrator
>
> "Exonet Developer" wrote:
>

Friday, February 24, 2012

How do I drop a Foreigh Key

I have a column that includes th constraint References Table(Column) in its
definition. How do I get rid of this constraint?
Thanks for you assistance.
JohnLookup DROP CONSTRAINT in the BOL
"DevalilaJohn" <DevalilaJohn@.discussions.microsoft.com> wrote in message
news:20990D35-91EE-4A8E-805B-57C78D78240F@.microsoft.com...
>I have a column that includes th constraint References Table(Column) in
>its
> definition. How do I get rid of this constraint?
> Thanks for you assistance.
> John

How do I drop a Foreigh Key

I have a column that includes th constraint References Table(Column) in its
definition. How do I get rid of this constraint?
Thanks for you assistance.
JohnLookup DROP CONSTRAINT in the BOL
"DevalilaJohn" <DevalilaJohn@.discussions.microsoft.com> wrote in message
news:20990D35-91EE-4A8E-805B-57C78D78240F@.microsoft.com...
>I have a column that includes th constraint References Table(Column) in
>its
> definition. How do I get rid of this constraint?
> Thanks for you assistance.
> John

How do I drop a Foreigh Key

I have a column that includes th constraint References Table(Column) in its
definition. How do I get rid of this constraint?
Thanks for you assistance.
John
Lookup DROP CONSTRAINT in the BOL
"DevalilaJohn" <DevalilaJohn@.discussions.microsoft.com> wrote in message
news:20990D35-91EE-4A8E-805B-57C78D78240F@.microsoft.com...
>I have a column that includes th constraint References Table(Column) in
>its
> definition. How do I get rid of this constraint?
> Thanks for you assistance.
> John