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 |
|
gaauspawcscwcj
Starting Member
29 Posts |
Posted - 2009-10-28 : 22:01:21
|
| hi alli have table with definition like belowtable : name varchar(10)series varchar(40)data : name seriesa 1b 2c 3d 1000000000000000000000000000000000000000--> the requirment is if i insert one more record so series field is increase one more than max value of series in table.--> i have to get max value of series and plus with 1 but data type of bigint is 8 bit and decimal is 18 --> i counld not get max value of series if data of series get to 40 digits.any ideas for helping methanks alotgaauspawcscwcj |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
gaauspawcscwcj
Starting Member
29 Posts |
Posted - 2009-10-28 : 23:32:11
|
| hi khtani dont understand much.all i want is get max value.function FUNCTION dbo.AddString(@String1 VARCHAR(8000), @String2 VARCHAR(8000)) must be add 2 value String1 ,String2in my case what value of String1 and String2 that i need.thanksgaauspawcscwcj |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-10-28 : 23:35:08
|
you can't convert a 40 digits long number in string to decimal or bigint. It is not big enough. You have to use a user defined function to perform the addition and you can use the function i posted in that link. KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
gaauspawcscwcj
Starting Member
29 Posts |
Posted - 2009-10-29 : 00:02:49
|
| i ve just run dbo.AddString(@String1 VARCHAR(8000), @String2 VARCHAR(8000)) base on your link but the result is not expected.the result is 011235813...6130579072161159199194853094755497--> expected result is : 0123456...6130579072161159161305790721611592gaauspawcscwcj |
 |
|
|
|
|
|