Ask a Question related to Coldfusion Database Access, Design and Development.
-
akcreative #1
Select Primary Key
Hi
Is there any way to select Primary key from table . If you do not know your
primary key. I mean can we make any condition or check in which select
statement will only select the primary key.
Thanks
Jon
akcreative Guest
-
Primary Scratch & Windows Primary Paging file?
Okay, I accidentally uninstalled Adobe Photoshop the other day. So I re-installed it and now when I click on the Photoshop Icon and it starts to... -
#25474 [Bgs]: posting arrays from a select box with multiple select is not working properly
ID: 25474 User updated by: fmuller at cisco dot com -Summary: apache2filter: posting from a multiple select box is not... -
How do you select a row if you know the value of the row's primary key?
I would like to know how to select the correct row of the datagrid knowing only the value of its DataKeyField. Could someone please tell me how to... -
#25474 [Fbk->Opn]: posting arrays from a select box with multiple select is not working properly
ID: 25474 User updated by: fmuller at cisco dot com Reported By: fmuller at cisco dot com -Status: Feedback... -
SELECT DISTINCT + ORDER BY gives ERROR 145: ORDER BY items mustappear in the select list if SELECT DISTINCT is specified.
Dan, You should be able to do this: SELECT Id, FaxID, ReceivedTime, Pages FROM ( SELECT DISTINCT .Id AS Id, -
Dan Bracuk #2
Re: Select Primary Key
In some databases you can find out the primary key by querying the system tables, assuming you have permission to do so. The specifics are db dependent.
Dan Bracuk Guest
-
akcreative #3
Re: Select Primary Key
Hi
I can see many System tables in my database. Can you please give me an example. That will help me alot. Thanks, Jon
akcreative Guest
-
paross1 #4
Re: Select Primary Key
On a philosophical note, it seems to me that if you don't know enough about
your data model / database / schema to know what your keys are, then you
probably shouldn't be doing any queries until you do. Kind of like hunting in a
cave without a flashlight.
Phil
paross1 Guest
-
akcreative #5
Re: Select Primary Key
Thanks alot for your help.
I am using SQL server. Actually I am trying to create a CFC that will check
the database dependency. I know my databse well. But I am trying to create a
tree relationship of database programically
Thanks Jon
akcreative Guest
-
paross1 #6
Re: Select Primary Key
You may want to take a look at SQL Server Books online (BOL) and research
Catalog Functions.
For example:
SQLPrimaryKeys uses the catalog stored procedure sp_pkeys to report primary
key participants from a table. Though a table may have a column or columns that
can serve as unique row identifiers, tables created without a PRIMARY KEY
constraint return an empty result set to SQLPrimaryKeys. The ODBC function
SQLSpecialColumns reports row identifier candidates for tables without primary
keys.
Phil
paross1 Guest
-
akcreative #7
Re: Select Primary Key
hi
did not have any clue how can i use SQLPrimaryKeys
thanks
akcreative Guest
-
paross1 #8
Re: Select Primary Key
I take it that you don't have access to BooksOnLine? It is free to download
from Microsoft, and you would be well advised to do so.
You could look at your sysconstraints table, but then you get into table IDs
and column IDs and status flags, etc. Not much help without a roadmap.
Phil
paross1 Guest
-
Sojovi #9
Re: Select Primary Key
Paross1 is right. Books Online and a little of sweat. Anyway, a little help
this time :
SELECT kcu.table_name,kcu.column_name
FROMinformation_schema.TABLE_CONSTRAINTS
tc,information_schema.KEY_COLUMN_USAGE kcu
WHERE tc.constraint_type='PRIMARY KEY' AND
tc.CONSTRAINT_NAME=kcu.CONSTRAINT_NAME
Regards
Sojovi Guest



Reply With Quote

