February 1, 2007 at 1:52 pm
I have a table I need to change the precision value on a column. The current Size(Precision,Scale) is set to 5(7,4). I would like it to be 9(11,4). I run the following script in SQL Analyzer
ALTER TABLE pc_hdr
{[ ALTER COLUMN pch_factor
{ decimal [ ( 9 [11 , 4 ] ) ] }}
but get the error: [Microsoft][ODBC SQL Server Driver]Syntax error or access violation
What am I doing wrong?
Thanks...Nali
February 1, 2007 at 2:22 pm
That works for me...
CREATE TABLE #Demo (a DECIMAL(7, 4))
INSERT INTO #Demo (a) VALUES (11)
SELECT a FROM #Demo
--11.0000
ALTER TABLE #Demo
ALTER COLUMN a DECIMAL(11, 6)
SELECT a FROM #Demo
--11.000000
DROP TABLE #Demo
Maybe you have a lock problem, or you need to give more information on the circumstances of the code.
February 1, 2007 at 2:26 pm
Nali,
Your syntax is wrong. Use decimal(11,4).
Greg
Greg
February 1, 2007 at 2:30 pm
Greg, that worked, thanks.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply