Click here to Skip to main content
15,903,012 members
Home / Discussions / Database
   

Database

 
GeneralProblem with table format when pulled from SQL Server to Sql Server CE, using RDA Pull Method Pin
JustChiLLin14-Apr-04 1:13
JustChiLLin14-Apr-04 1:13 
Generalthe problem of @@TRANCOUNT--how to eliminate the no.266 error Pin
williamchou13-Apr-04 23:33
williamchou13-Apr-04 23:33 
GeneralRe: the problem of @@TRANCOUNT--how to eliminate the no.266 error Pin
Mike Dimmick14-Apr-04 5:28
Mike Dimmick14-Apr-04 5:28 
GeneralSET DATEFORMAT Pin
monrobot1312-Apr-04 19:13
monrobot1312-Apr-04 19:13 
GeneralRe: SET DATEFORMAT Pin
Mike Dimmick13-Apr-04 4:05
Mike Dimmick13-Apr-04 4:05 
GeneralRe: SET DATEFORMAT Pin
monrobot1313-Apr-04 15:20
monrobot1313-Apr-04 15:20 
GeneralFormat Columns Pin
monrobot138-Apr-04 16:42
monrobot138-Apr-04 16:42 
GeneralRe: Format Columns Pin
Colin Angus Mackay9-Apr-04 0:12
Colin Angus Mackay9-Apr-04 0:12 
select cast(test_column as char(15)) from test_table


This will truncate the column to 15 characters if it exceeds it, or pad on the right if the column doesn't

select cast(test_column as char(15)) from test_table

test_column     
--------------- 
1234567890     
12345          

(2 row(s) affected)

select cast(test_column as char(5)) from test_table

test_column 
----------- 
12345
12345

(2 row(s) affected)

The test_table had two rows, test_column was "1234567890" on the first row and "12345" on the second.

There is also a convert function you may like to look up which gives finer control of the output format (especially for dates) if you need it.

Does this help?


"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar

"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)


GeneralRe: Format Columns Pin
monrobot139-Apr-04 6:13
monrobot139-Apr-04 6:13 
GeneralMSDE Deployment Pin
betterc8-Apr-04 5:50
betterc8-Apr-04 5:50 
GeneralRe: MSDE Deployment Pin
Sarvesvara (BVKS) Dasa13-Apr-04 18:31
Sarvesvara (BVKS) Dasa13-Apr-04 18:31 
GeneralRe: MSDE Deployment Pin
betterc14-Apr-04 0:58
betterc14-Apr-04 0:58 
GeneralRe: MSDE Deployment Pin
Sarvesvara (BVKS) Dasa14-Apr-04 1:03
Sarvesvara (BVKS) Dasa14-Apr-04 1:03 
GeneralRe: MSDE Deployment Pin
betterc14-Apr-04 1:03
betterc14-Apr-04 1:03 
GeneralRe: MSDE Deployment Pin
Sarvesvara (BVKS) Dasa14-Apr-04 1:06
Sarvesvara (BVKS) Dasa14-Apr-04 1:06 
GeneralRe: MSDE Deployment Pin
betterc14-Apr-04 1:08
betterc14-Apr-04 1:08 
GeneralRe: MSDE Deployment Pin
Sarvesvara (BVKS) Dasa14-Apr-04 1:13
Sarvesvara (BVKS) Dasa14-Apr-04 1:13 
GeneralRe: MSDE Deployment Pin
betterc14-Apr-04 1:21
betterc14-Apr-04 1:21 
GeneralRe: MSDE Deployment Pin
Sarvesvara (BVKS) Dasa14-Apr-04 1:39
Sarvesvara (BVKS) Dasa14-Apr-04 1:39 
GeneralRe: MSDE Deployment Pin
betterc14-Apr-04 13:51
betterc14-Apr-04 13:51 
GeneralRe: MSDE Deployment Pin
Sarvesvara (BVKS) Dasa14-Apr-04 18:45
Sarvesvara (BVKS) Dasa14-Apr-04 18:45 
GeneralADOX & ADO Pin
Shenthil7-Apr-04 19:18
Shenthil7-Apr-04 19:18 
GeneralRe: ADOX & ADO Pin
Steve S8-Apr-04 1:08
Steve S8-Apr-04 1:08 
GeneralSelect SQL String Pin
Nguyen Vu Cuong7-Apr-04 15:50
Nguyen Vu Cuong7-Apr-04 15:50 
GeneralRe: Select SQL String Pin
Steven Campbell13-Apr-04 9:17
Steven Campbell13-Apr-04 9:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.