Link to home
Start Free TrialLog in
Avatar of tanj1035
tanj1035

asked on

sql, how to change the data type after data loading?

hi Experts,

I have loaded an excel file in the database by using sql import wizard. It automatically generated a table, like below.
CREATE TABLE [dbo].[tblCSOMonthlyLCDetail](
	[ContractString] [nvarchar](255) NULL,
	[LoanStoreID] [float] NULL,
	[CustomerFirstName] [nvarchar](255) NULL,
	[CustomerLastName] [nvarchar](255) NULL,
	[LoanDate] [datetime] NULL,
	[OPB] [money] NULL,
	[Score] [float] NULL,
	[CSOFees] [money] NULL,
	[LienFees] [money] NULL,
	[LateFees] [money] NULL,
	[Renews] [float] NULL,
	[Dayslate] [float] NULL,
	[MarkerID] [float] NULL,
	[FileDate] [datetime] NULL
) ON [PRIMARY]

GO

Open in new window


After I loaded all data in this table, and I want to change data type for a few fields, the expected table structure will be like below.
CREATE TABLE [dbo].[tblCSOMonthlyLCDetail](
	[ContractString] [nvarchar](255) NOT NULL,
	[LoanStoreID] [int] NULL,
	[CustomerFirstName] [nvarchar](255) NULL,
	[CustomerLastName] [nvarchar](255) NULL,
	[LoanDate] [datetime] NULL,
	[OPB] [money] NULL,
	[Score] [int] NULL,
	[CSOFees] [money] NULL,
	[LienFees] [money] NULL,
	[LateFees] [money] NULL,
	[Renews] [bit] NULL,
	[Dayslate] [int] NULL,
	[MarkerID] [int] NULL,
	[FileDate] [datetime] NULL
) ON [PRIMARY]

GO

Open in new window


Can you help me on it?  Thanks.
SOLUTION
Avatar of Tomas Helgi Johannsson
Tomas Helgi Johannsson
Flag of Iceland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
on ssms, right click on table
design
do the required changes and save/close

if you get error, go to tools-options-designers and uncheck "prevent..." see attachmeent...
Screenshot---2017-05-09---1_58_54-PM.png
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tanj1035
tanj1035

ASKER

Thank you, guys, for alternative solutions!!!
HUH! Everybody got points except me! Wonder why!
hi , Huseyin, sorry, I may miss selecting your solution. Is there any way I can change it? Please let me know. I apologize for it :(
>Is there any way I can change it?
You should have a button with three dots on it that has 'Request Attention' as a choice.  Select that and ask that the question be re-opened for a regrade.  Happens all the time, so not a big deal.