Add a column with a default value to an existing table in SQL Server

Syntax: Example: Notes: Optional Constraint Name:If you leave out CONSTRAINT D_SomeTable_SomeCol then SQL Server will autogenerate    a Default-Contraint with a funny Name like: DF__SomeTa__SomeC__4FB7FEF6 Optional With-Values Statement:The WITH VALUES is only needed when your Column is Nullable    and you want the Default Value used for Existing Records.If your Column is NOT NULL, then it will automatically use the Default … Read more

Arithmetic overflow error converting expression to data type datetime. (while displaying date time..)

You issue is that you’re trying to convert the numeric to a datetime, and this just isn’t working. You need to turn your numeric into a string first: SQL Fiddle with demo. When you try and convert a numeric type to a datetime, SQL Server tries to add the numeric value as the number of days to the date 01-Jan-1900. In your … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)