Showing posts with label located. Show all posts
Showing posts with label located. Show all posts

Tuesday, March 27, 2012

Database collation

Hello,
I have database migrated from SQL7 to SQL2K.
This database has collation 'comaptibility something bla bla'.
Other database4s located at this server has different collation name,
because were created under SQL2K. PRoblem is when I try to join tabels
between old database and new.
Is it possible to change this collation to another (from SQL2K) ?
--
Best Regards,
IksHi
It looks like you have collation compatibility problems.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/architec/8_ar_da_8uer.asp
To change collations check out:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/architec/8_ar_da_819v.asp
http://tinyurl.com/ky3q
"Iks" <jko74__usun__@.wp.pl> wrote in message
news:bi7igc$mol$1@.atlantis.news.tpi.pl...
> Hello,
> I have database migrated from SQL7 to SQL2K.
> This database has collation 'comaptibility something bla bla'.
> Other database4s located at this server has different collation name,
> because were created under SQL2K. PRoblem is when I try to join tabels
> between old database and new.
> Is it possible to change this collation to another (from SQL2K) ?
> --
> Best Regards,
> Iks
>|||Hi,
I'm not sure about that, but I think that the collations
you are trying to join are not compatible - why don't you
try to identify a collation that is equivalent from this
using in the database migrated from sql 7 and change the
collation for that specific column, i've never seen an
option that changes all collations from database at time !
Only in the installation you specify a collation that is
going to be used for the new created databases.
Sorry if Couldn't help you !
>--Original Message--
>Uzytkownik "Roberto Carrasco" <roberto_carrasco@.msn.com>
napisal w
>wiadomosci news:090701c36981$b03d9770$a301280a@.phx.gbl...
>> Hi,
>> If I understand your question --Yes SQLserver2000 Allows
>> you to have differente collation for database even to
>> columns !
>Yes, I know. But at this time I have on my server one
database
>(migrated from SQL7) with old-style collation. Other
databases
>were created with new default server collation.
>There is no problem until I have to compare two columns
from
>different databases (different collations) - join tables
from different
>databases.
>That's the reason I would like to unify collation for all
databases
>located on this server.
>--
>regards,
>Iks
>
>.
>

Monday, March 19, 2012

Database Attach error encountered

Would appreciate any inputs.

I am running SQL2005. I am trying to attach to a database located on an external hard drive that is connected to my laptop via USB connection. The database files are a copy of the database files from a server running SQL2005.

After making the copy of the database, we confirmed that we could attach to the database on the external drive from the server and were successful attaching, opening and accessing the copy. Brought the HD home to work with the database and am getting the following error when I try to attach:

Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum)


For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476


Program Location:

at Microsoft.SqlServer.Management.Smo.Enumerator.Process(Object connectionInfo, Request request)
at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabaseData.PrimaryFile.GetOriginalDatabaseName(String primaryFilePath)
at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabaseData.PrimaryFile.PopulatePrimaryFileData(String primaryFilePath)
at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabaseData.PrimaryFile..ctor(SqlManagementUserControl parent, CDataContainer dc, String fullPath, String databaseOwner, ServerConnection connectionInfo)
at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.IsSelectedFileValid(BrowseFolder dlg)

===================================

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)


Program Location:

at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteReader(String sqlCommand)
at Microsoft.SqlServer.Management.Smo.ExecuteSql.GetDataReader(String query)
at Microsoft.SqlServer.Management.Smo.DataProvider.SetConnectionAndQuery(ExecuteSql execSql, String query)
at Microsoft.SqlServer.Management.Smo.ExecuteSql.GetDataProvider(StringCollection query, Object con, StatementBuilder sb, RetriveMode rm)
at Microsoft.SqlServer.Management.Smo.SqlObjectBase.FillData(ResultType resultType, StringCollection sql, Object connectionInfo, StatementBuilder sb)
at Microsoft.SqlServer.Management.Smo.SqlObjectBase.FillDataWithUseFailure(SqlEnumResult sqlresult, ResultType resultType)
at Microsoft.SqlServer.Management.Smo.SqlObjectBase.BuildResult(EnumResult result)
at Microsoft.SqlServer.Management.Smo.PrimaryFile.GetData(EnumResult erParent)
at Microsoft.SqlServer.Management.Smo.Environment.GetData()
at Microsoft.SqlServer.Management.Smo.Environment.GetData(Request req, Object ci)
at Microsoft.SqlServer.Management.Smo.Enumerator.GetData(Object connectionInfo, Request request)
at Microsoft.SqlServer.Management.Smo.Enumerator.Process(Object connectionInfo, Request request)

===================================

CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'E:\Navision SqlData\ForentaSQL_Data.mdf'. (.Net SqlClient Data Provider)


For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.3159&EvtSrc=MSSQLServer&EvtID=5123&LinkId=20476


Server Name: twdlaptop1
Error Number: 5123
Severity: 16
State: 20
Line Number: 1

Program Location:

at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader()
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteReader(String sqlCommand)

It looks as though your problem is a permissions problem. When you're at home you're using a different login context than you are when you're at work. The external HD allows the work login access, but not the home login. I'd look at the security tab under the properties menu item for the directory where the database files are stored and see if you can add your home login to the list of allowed users.

Tuesday, February 14, 2012

data transform

I want the value of field A if value field B = C, otherwise the value of A =
D and field A and field B are located in the same table. Can anyone please
advise me how to code it in DTS transformation? Many thanks.Eric
Look at thsi script helps you with the problem
BTW why do you need to use DTS for this purpose?
CREATE TABLE #Test
(
A INT,
B INT,
C INT,
D INT
)
go
INSERT INTO #Test VALUES (1,2,3,4)
INSERT INTO #Test VALUES (10,2,2,2)
INSERT INTO #Test VALUES (2,4,11,15)
INSERT INTO #Test VALUES (30,1,22,20)
go
UPDATE #Test SET A=CASE WHEN B=C THEN A ELSE D END FROM #Test
go
SELECT * FROM #Test
"Eric Clapton" <no_spam@.bk.com> wrote in message
news:uOZ8ZmyCEHA.1604@.TK2MSFTNGP11.phx.gbl...
> I want the value of field A if value field B = C, otherwise the value of A
=
> D and field A and field B are located in the same table. Can anyone
please
> advise me how to code it in DTS transformation? Many thanks.
>|||I am exporting a table to a text file using the DTS import/export and I want
one field transform to another based on another field value. I need the code
after I click the transform button. I should be more specific earlier. Sorry
about that. Can you please help me? Thanks.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:OhhIlsyCEHA.1452@.TK2MSFTNGP09.phx.gbl...
> Eric
> Look at thsi script helps you with the problem
> BTW why do you need to use DTS for this purpose?
> CREATE TABLE #Test
> (
> A INT,
> B INT,
> C INT,
> D INT
> )
> go
> INSERT INTO #Test VALUES (1,2,3,4)
> INSERT INTO #Test VALUES (10,2,2,2)
> INSERT INTO #Test VALUES (2,4,11,15)
> INSERT INTO #Test VALUES (30,1,22,20)
> go
> UPDATE #Test SET A=CASE WHEN B=C THEN A ELSE D END FROM #Test
> go
> SELECT * FROM #Test
>
> "Eric Clapton" <no_spam@.bk.com> wrote in message
> news:uOZ8ZmyCEHA.1604@.TK2MSFTNGP11.phx.gbl...
A
> =
> please
>