What exactly is the requrement. If you want data to be saved in sql, you can use bigint as datatype in sql. Please tell if you require any other details.
and add record on that column. you may check below example,
CREATE TABLE [dbo].[Table_1](
[Id] [bigint] NULL
) ON [PRIMARY]
GO
insert into Table_1
select 1234567890123456
0
Abdalla ElawadRank #1,443 · 1.1K reputationPosted Aug 23, 2016, 1:31 AM EDT
0
hi guys
oki i create stored procedures , and insert data as bigint are inserted but I have problem in Select statement when we return bigint i need to convert bigint in Proc or C# code
as follow Proc Insert :
USE CASH_PLAN
GO
CREATE PROC InBound_Insert
(@VehcileKey bigint
,@FleetNo bigint
,@RegisterNo bigint
,@RegisterAlpha nvarchar(10)
,@Customer nvarchar(50)
,@ServiceType nvarchar(10)
,@TripTeam nvarchar(30)
,@EmpCustd2 nvarchar(50)
,@EmpCustd1 nvarchar(50)
,@EmpDriver nvarchar(50)
,@ID_Driver bigint
,@ID_Cusdt2 bigint
,@ID_Cusdt1 bigint
,@PostionDriver nvarchar(20)
,@PositionCusd2 nvarchar(20)
,@PositionCusd1 nvarchar(20)
,@MobileCustd2 nvarchar(20)
,@MobileCustd1 nvarchar(20)
,@MobileDriver nvarchar(20)
,@Weapon bigint
,@WeaponBullets bigint
,@HandheldTerm bigint
,@CustomerKey bigint
,@Mileage bigint)
AS
BEGIN
INSERT INTO InBound
(VehcileKey
,FleetNo
,RegisterNo
,RegisterAlpha
,Customer
,ServiceType
,TripTeam
,EmpCustd2
,EmpCustd1
,EmpDriver
,ID_Driver
,ID_Cusdt2
,ID_Cusdt1
,PostionDriver
,PositionCusd2
,PositionCusd1
,MobileCustd2
,MobileCustd1
,MobileDriver
,Weapon
,WeaponBullets
,HandheldTerm
,CustomerKey
,Mileage)
VALUES
(@VehcileKey
,@FleetNo
,@RegisterNo
,@RegisterAlpha
,@Customer
,@ServiceType
,@TripTeam
,@EmpCustd2
,@EmpCustd1
,@EmpDriver
,@ID_Driver
,@ID_Cusdt2
,@ID_Cusdt1
,@PostionDriver
,@PositionCusd2
,@PositionCusd1
,@MobileCustd2
,@MobileCustd1
,@MobileDriver
,@Weapon
,@WeaponBullets
,@HandheldTerm
,@CustomerKey
,@Mileage) END
0
Midhun TpRank #388 · 6.5K reputationPosted Aug 23, 2016, 1:37 AM EDT
0
Hi,
What's your issue with select statement?
Why do you need to convert data in select statement?
0
Nitin SontakkeRank #264 · 9.6K reputationPosted Aug 23, 2016, 2:14 AM EDT
0
You have shared the code which has absolutely no issues. If you have problem on C# side, may sharing that code could have been helpful.
If you are reading data from SqlDataReader, use GetInt64 method.
0
Abdalla ElawadRank #1,443 · 1.1K reputationPosted Aug 23, 2016, 2:25 AM EDT
0
hi
this is code c# :
try
{
SqlCommand cmd = new SqlCommand("InBound_Insert", Conn);
Midhun TpRank #388 · 6.5K reputationPosted Aug 22, 2016, 10:31 PM EDT
ketan borsdiyaRank #2,258 · 624 reputationPosted Aug 22, 2016, 11:31 PM EDT
Abdalla ElawadRank #1,443 · 1.1K reputationPosted Aug 23, 2016, 1:31 AM EDT
Midhun TpRank #388 · 6.5K reputationPosted Aug 23, 2016, 1:37 AM EDT
Nitin SontakkeRank #264 · 9.6K reputationPosted Aug 23, 2016, 2:14 AM EDT
Abdalla ElawadRank #1,443 · 1.1K reputationPosted Aug 23, 2016, 2:25 AM EDT
Midhun TpRank #388 · 6.5K reputationPosted Aug 23, 2016, 3:33 AM EDT
ketan borsdiyaRank #2,258 · 624 reputationPosted Aug 23, 2016, 5:21 AM EDT
Bikesh SrivastavaRank #108 · 20.3K reputationPosted Aug 23, 2016, 5:45 AM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts