Datatype-convertion in TSQL
- From: "Filips Benoit" <benoit.filips@xxxxxxxxxx>
- Date: Tue, 20 Jun 2006 16:55:18 GMT
Dear all,
Tables: COMPANY: COM_ID, COM_NAME, .....
PROPERTY: PRP_ID, PRP_NAME, PRP_DATATYPE_ID, PRP_DEFAULT_VALUE
( nvarchar)
COMPANY_PROPERTY: CPROP_COM_ID, CPROP_PRP_ID, CPROP_VALUE
(nvarchar)
Use: Without adding new field the user can add new properties to the
companies just by adding a new property in table PROPERTY and mapping the
new property to a companie. CPRP_VALUE contains all kind of datatypes but is
stored as text.
Problem: when I query the database ( SP, views, etc) I have problems with
floats and date bacause in the interface ( Access2000.adp) :
the float-format is 0,11 and in TSQL is 0.11
the date-format is DD/MM/YYYY and in TSQL it is YYYY-MM-DD
Can I convert the data within the Stored Procedure for selecting and sorting
on those fields.
for example: How to sort on CPRP_VALUE containing floatvalues stored as
nvarchar ??
The client wants to stay with the comma-format because it is common-used
here.
The format can be TSQL-format in the resultset of a Stored Procedure without
changing the format in the database because this is used for the output to
the clients.
Same problem with dates !!!
thanks,
Filip
.
- Follow-Ups:
- Re: Datatype-convertion in TSQL
- From: Erland Sommarskog
- Re: Datatype-convertion in TSQL
- Prev by Date: Error: 16954, Severity: 10, State: 1 and Timeout problem
- Next by Date: encryption in sql server 2005
- Previous by thread: Error: 16954, Severity: 10, State: 1 and Timeout problem
- Next by thread: Re: Datatype-convertion in TSQL
- Index(es):
Relevant Pages
|