Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Blessed1978
Yak Posting Veteran
97 Posts |
Posted - 2014-12-04 : 16:47:19
|
my target column is bigint so I would like to convert my SOURCE COLUMN to convert to BIGINT . The below shows that I am removing the RIGHT 11 characters from my source column. example 54124@yahooo.com would be 54124REPLACE([USER Username], RIGHT([USER Username],10),''), |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
Blessed1978
Yak Posting Veteran
97 Posts |
Posted - 2014-12-04 : 18:26:01
|
I posted the question its using convert within replace and right function so I can convert my resulting column from varchar to bigint |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-12-04 : 18:51:27
|
I'm really not seeing a question. I see statements, but no questions. Are you saying that the code you posted is NOT doing what you want? Could you provide more sample data?Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
Blessed1978
Yak Posting Veteran
97 Posts |
Posted - 2014-12-04 : 19:46:57
|
I explained it as much as I can. The replace function I have above is removing the last 11 characters from my source coulm which is varchar . I have to convert that same column to bigint in order to join to another table that's the whole purpose of converting |
|
|
Blessed1978
Yak Posting Veteran
97 Posts |
Posted - 2014-12-04 : 19:48:43
|
I explained it as much as I can. The replace function I have above is removing the last 11 characters from my source coulm which is varchar . I have to convert that same column to bigint in order to join to another table that's the whole purpose of converting |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-12-04 : 19:50:30
|
So wrap it in a CONVERT or CAST function.CAST(your code goes here...as bigint)Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
|
|
|