Showing posts with label instead. Show all posts
Showing posts with label instead. Show all posts

Sunday, March 25, 2012

Changing the design from char to datetime

I accidently put char instead of datetime in the Sql Server DateCreateddataType. Is there any way that now I can change. I guess even if Ichange I cannot get the time and date in a format that I want sincethey are in Char datatype.

you can change it in the design view or use the ALTER Table commandfrom thw Query analyzer. You can still change the datatype and be ableto use the datetime functions.
|||The problem is that the data in those fields have already been entered.And when I change it is not complient with the old data.

Sunday, March 11, 2012

changing security model

how do i reconfigure an installed sql server to use standard security
(sql login/pwd) instead of only accepting trusted connections
(requiring windows login/pwd)
thanks,
jasonnever mind, i found it in the enterprise manager server properties
security tab.

Saturday, February 25, 2012

Changing Ordering of a Dimension Attribute

I have a dimension attribute called Month. It is sorting alphabetically instead of based on it's underlying key value. How do I change this?

Thanks,

ChrisChange the order by from "Name" to "Key". No idea what "Attribute Name" and "Attribute Key" do however.|||If you choose attribute name, you can define the order by another field.
I have in each dimension an order field and I have configured each dimension to sort by this field. By default I fill in this field with name. But if a user request another order I can change values in this field without changing dimension structure.

Changing of @@IDENTITY item in a trigger

Hello!

I have a instead of insert trigger that after doing some validation, inserts a record into a specific table. Another table requires the key generated by this insert in order to add a record, which is done at the end of the trigger. When called from a client (via a recordset.update call) the newly created key from the first insert is overridden with the key from the second insert. Any ideas on how I can save the first key, then pass it back to the client? The client currently receives the second key created.

Thanks in advance,

EverettI have exactly the same problem and although I don't have a solution (yet), I have found out that this appears to be by design. ADO does a "Select @.@.IDENTITY" after an insert to retrieve the key of the record inserted (See Chapter 11 of "Programming ADO" by David Sceppa at http://www.microsoft.com/mspress/books/sampchap/3445a.asp). If there was some way to modify ADO's behaviour to use instead "Select IDENT_CURRENT('<tablename>')" then problem solved. The article describes a "Update Resync" dynamic record set property but it doesn't appear to be flexible enough to tell ADO to use IDENT_CURRENT.

The hunt continues...

Thursday, February 16, 2012

changing English Date to Iranian date

Hi Everyone,

I want to change the form of Date in SQL Server 2005,from English Date,to Iranian Date.

For example, instead of inserting 2007/1/1 write 85/10/11.

Thanks,

Nassa

I am not familiar with the iranian date, is the first date you mentioend correlated to the second one ?

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||

FROM SQL Server 2005 Books Online topic 'CAST and CONVERT (Transact-SQL)'.

SQL Server supports the date format in Arabic style by using the Kuwaiti algorithm.
Hijri is a calendar system with several variations. SQL Server 2005 uses the Kuwaiti algorithm.

See for custom code:
http://www.codeproject.com/useritems/Hijri_Shamsi_Date.asp?df=100&forumid=254936&exp=0&select=1371550

General international resource:
http://www.microsoft.com/globaldev/DrIntl/columns/002/default.mspx

Tuesday, February 14, 2012

Changing default value for a column

I have an existing database and I want to change it so that if no value is
inserted into a column that it populates that column with a zero instead of
a
null value. How do I make this change? I suspect I need to change all the
existing nulls to zero before making the change? Any help would be greatly
appreciated.That depends. Are you happy with the existing nulls? If so, simply add a
default constraint:
alter table MyTable
add
constraint DF1_MyTable default (0) for MyColumn
However, if you need to keep all nulls out, then populate the null columns
with some value and then alter the column:
alter table MyTable
alter column
MyColumn int not null
go
Then, add the default constraint as shown above.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"rk rider" <rkrider@.discussions.microsoft.com> wrote in message
news:722BC848-15EA-474D-8F40-6BB078F7CDF3@.microsoft.com...
I have an existing database and I want to change it so that if no value is
inserted into a column that it populates that column with a zero instead of
a
null value. How do I make this change? I suspect I need to change all the
existing nulls to zero before making the change? Any help would be greatly
appreciated.

Changing default value for a column

I have an existing database and I want to change it so that if no value is
inserted into a column that it populates that column with a zero instead of a
null value. How do I make this change? I suspect I need to change all the
existing nulls to zero before making the change? Any help would be greatly
appreciated.
That depends. Are you happy with the existing nulls? If so, simply add a
default constraint:
alter table MyTable
add
constraint DF1_MyTable default (0) for MyColumn
However, if you need to keep all nulls out, then populate the null columns
with some value and then alter the column:
alter table MyTable
alter column
MyColumn int not null
go
Then, add the default constraint as shown above.
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
..
"rk rider" <rkrider@.discussions.microsoft.com> wrote in message
news:722BC848-15EA-474D-8F40-6BB078F7CDF3@.microsoft.com...
I have an existing database and I want to change it so that if no value is
inserted into a column that it populates that column with a zero instead of
a
null value. How do I make this change? I suspect I need to change all the
existing nulls to zero before making the change? Any help would be greatly
appreciated.

Changing default value for a column

I have an existing database and I want to change it so that if no value is
inserted into a column that it populates that column with a zero instead of a
null value. How do I make this change? I suspect I need to change all the
existing nulls to zero before making the change? Any help would be greatly
appreciated.That depends. Are you happy with the existing nulls? If so, simply add a
default constraint:
alter table MyTable
add
constraint DF1_MyTable default (0) for MyColumn
However, if you need to keep all nulls out, then populate the null columns
with some value and then alter the column:
alter table MyTable
alter column
MyColumn int not null
go
Then, add the default constraint as shown above.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"rk rider" <rkrider@.discussions.microsoft.com> wrote in message
news:722BC848-15EA-474D-8F40-6BB078F7CDF3@.microsoft.com...
I have an existing database and I want to change it so that if no value is
inserted into a column that it populates that column with a zero instead of
a
null value. How do I make this change? I suspect I need to change all the
existing nulls to zero before making the change? Any help would be greatly
appreciated.