Showing posts with label express. Show all posts
Showing posts with label express. Show all posts

Thursday, March 29, 2012

Attach network database Sql Server Express

I am trying to attach a network database to my sql server express

After some reading I "Enabled" tcp/ip, named pipes, and shared memory in sql server confiuration manager.

But when I go to "Attach Database" in Sql Express managemnent studio. It does not show the network drives much less allow me to attach anything on a network drive.

What am I missing here?

If I install sql server on the network machine will my local Sql express recognize it?

Database files on network shares are not supported.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||You can also see http://support.microsoft.com/kb/304261.

attach error in sql server express management studio

tried to attach a database in sse-ms, and for some reason the database name is changing to G:\someFolder\some\Folder\db.mdf, even tho i dont have a drive g:,

during "attach as" screens inside sse-ms, , ie attach>add> then select the database the mdf loction is what it is suppose to be ie C:\inetpub\wwwroot\app_data\chp11\wroxunited.mdf but the database name in the same screen shot is G:\someOtherFolderAndPath\wroxunited.mdf and the attach as is also the G:\someOtherFolderAndPath\wroxunited.mdf.

pretty confused, could use a clue, thanks

my data entry error above, the mdf locattion in the sse-ms attach area/screen is C:\inetpub\wwwroot\chp11\app_data\wroxunited.mdf, the rest of the intial post is ok tho,

anyone know if the log file (ldf) is causing this problem, chp11 came in a download form the wrox book site btw.

|||hmm found a work around, ie just deleted that database from within sse-ms, had a backup of the mdf so wasnt to worried, anyway after deleting the mdf that had the G:\WrongPath\db.mdf, i was able to attach the desired database and the mdf location, the database name and the attach as are now all correct, still kinda interested in what caused that but i am now, thanks people, have a lot to learn about sql and permission tho,

Attach db to sql 2005 express edition

My dog ate my sql2000 installation disk! After a recent xp installation I remembered that.

Now I'm in a hurry to get up and running with SQL again. I've installed SQL server 2005 express, but I can't attach any databases, or really do anything for that matter. I have a copy of SQL Server 2005 enterprise edition but that won't install on my development machine, Xp Sp2. Which way should I go, install SQL 2005 enterprise on a Win 2003 server or can I download something to administer the express version?

As always thanks for any and all replies!

/Eskil

You can download the SQL Server 2005 Management Studiohttps://www.microsoft.com/downloads/details.aspx?familyid=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&displaylang=en)

Tuesday, March 27, 2012

Attach Database problem

I am trying to attach a database as part of my overall application distribution.

After installing Express when my .NET app first starts it atempts to attach the database using EXEC sp_attach_db etc...

This used to work fine with MSDE 2000 but now the database is being attached as read-only. If I then use Management Studio to manually detach and attach the database it is fine.

Any ideas why this is happening please?

Hi,

is the file propably readonly (on system level) ? Do you use the same permission / login in your application as in SQL Server Managment studio ?

HTH, Jens Suessmeyer.


http://www.sqlserver2005.de

|||

Hi Jens

The .mdf and .ldf files are not set to read only.

This is happening on Windows XP.

When I run the attach command from within my code I am connected to the master db as the sa user. I am logged into Windows as an administrator user.

I have made sure that the database has been detached properly on my developement machine and the database is installed to the same path on the target machine.

Are you aware of any other reasons that could cause a db to be attached as read-only?

Thanks

Ade

|||

Odds are this is a result of the fact that SQL Express runs under Network Service rather than Local Service as was the case in MSDE. Check to see what permissions the Network Service account has on the directory where your database is located.

Mike

|||

Hi Mike

Thanks for your reply.

You were right - when I change SQL Express to run under the Local Service the problem goes away.

I can override the new default in the command line by setting the SQLACCOUNT="NT AUTHORITY\SYSTEM" parameter.

What I need to know now is why the default account has changed (and am I creating a problem by overriding it)?

The alternative is to leave the account as the Network Service but I don't know how then to set the relevant folder permissions from within my Instalshield setup (Windows XP Home and Professional)

Does anyone have any more comments on this?

Thanks again Mike

|||

Wow!

Thank you all!

I was trying to migrate a medical records system database that uses MSDE sql2000 over to SQL Express. I kept getting the "read only" errors when I tried to attach the databases to SQL Express. I was ripping my hair out!

Actually, I got the same error selecting 'local service', but selecting 'local system' WORKED!

David

Attach database over the network.

Hello,
I have Sql Express installed in one computer and I want to attach a database
that is stored in another computer.
How can I do that?
ThanksSQL Server doesn't support having database files over the network. Copy the
files locally then
attach to the files. Or have an SQL Server on the other machine and connect
to that SQL Server from
your client apps.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Joao Novo" <jotanovo@.gmail.com> wrote in message news:uQPr1M$gHHA.4064@.TK2MSFTNGP02.phx.gbl
..
> Hello,
> I have Sql Express installed in one computer and I want to attach a databa
se that is stored in
> another computer.
> How can I do that?
> Thanks
>sql

Attach database over the network.

Hello,
I have Sql Express installed in one computer and I want to attach a database
that is stored in another computer.
How can I do that?
ThanksSQL Server doesn't support having database files over the network. Copy the files locally then
attach to the files. Or have an SQL Server on the other machine and connect to that SQL Server from
your client apps.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Joao Novo" <jotanovo@.gmail.com> wrote in message news:uQPr1M$gHHA.4064@.TK2MSFTNGP02.phx.gbl...
> Hello,
> I have Sql Express installed in one computer and I want to attach a database that is stored in
> another computer.
> How can I do that?
> Thanks
>

Attach database from network drive

Hello,

when I attach an database from a network drive in SQL Express 2005 the access permissions on the data and log files will be change.
This ends in a deadlock when the user doesn't have administrator right on the network server, because the permissions will allow access only for administrators and an unknown Usergroup on the network server. I think it's the SQLServer2005MSSQLUser$xxx$MSSQLSERVER group from the local server.

Example:

DBCC TRACEON(1807)
GO
PRINT 'ATTACH FIRST'
CREATE DATABASE TEST ON
( FILENAME = N'\\server\tmp\test.mdf' ),
( FILENAME = N'\\server\tmp\test_log.ldf' )
FOR ATTACH;
GO
PRINT 'Detach'
exec sp_detach_db TEST
GO

When this batch runs again after some minutes you will get

Msg 5120, Level 16, State 101, Line 2

Die physikalische Datei "\\server\tmp\test.mdf" kann nicht ge?ffnet werden. Betriebssystemfehler 5: "5(Zugriff verweigert)".

This could be translated like:

The physical file "\\server\tmp\test.mdf" could not be opend. OS Error 5 (Access Denied).

This error is the same when the user doesn't have full access on the share and db files.

In SQL2000/MSDE no security permissions will be changed, so the database could always be attached.

Is there any workaround?

Perhaps setting the security permissions could switched off?

You also need full access permissions on the share and files, wich also doesn't make sense.

Hi Dieter (thanks for translating ;-)),

you have to make sure that the SERVICE account which is starting up the SQL Server service has the appropiate permissions on the network drive. Unless this can′be accomplished you can′t attach the database via network.

HTH, Jens Suessmeyer.

|||

Hi Jens,

The Service account has permissions on the network drive.

The problem is that SQL Express need full rights because of changing the permissions when attaching the db files.

First time the database could attached, but then the permissions are changed an the database could not attach again.

Dieter Pelz

Sunday, March 25, 2012

Attach database

I have a database on a server and want to put it my local laptop that also has sql express. I attached the db, I see it in Management Studio but it does not show up in

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data so my app is not working correctely. How do I get the db to show up in the MSSWL\Data folder. I'm a bit confused.

Attaching a DB to SQL Server does not move the DB file. If you want the DB file to be in a particular directory then you need to move the file to that directory and then attach the DB file to SQL Server.

|||Ok I copied the db to the data folder and then attached it. I can connect but but I get an error "connot find server\instance.|||Then it has nothing to do with the directory of the file. That means that what "MSSWL\Data" is the name of a "named" instance of Sql Server. In that case you will need to configure\modify the application so it can connect to the Sql Server installed on your machine. As it looks now the application is trying to connect to the server from where you got the database file.|||

Need some more info here, when are you getting this error? If you can't find the server, you are not able to connect as you suggest. A few other questions:

What is the name of your instance?
Have you confirmed that it's running in SQL Configuration Manager?
Are you able to connect from the local computer? (i.e. where Sql Express is installed.)

Thanks for the additional informaiton.

Mike

|||

I fugured it out. I put the db and dblog in the data folder and then attached it..it works fine now.

Thanks much

|||

Good to hear it's working.

Mike

Attach command failes

Hi
I have just received data files ( .mdf and .ldf ) and I need to attach them
to a sql express 2005. My machine is WinXP vers. 2002 SP2.
I downloaded the varius files (.NET 2, sql 2005, sql management studio
express) and installation was ok. No errors. No warnings
I am trying now to attach the data from management studio console (Database
- Attach).
But when adding .mdf file location I receive the following message:
"Failed to retrieve data.. CREATE FILE encounted operating system error 5
while attempting to open/create... Error 5123"
Do you miss anything? Any idea?
Thank you for your suggestions.Francesco wrote:
> Hi
> I have just received data files ( .mdf and .ldf ) and I need to attach them
> to a sql express 2005. My machine is WinXP vers. 2002 SP2.
> I downloaded the varius files (.NET 2, sql 2005, sql management studio
> express) and installation was ok. No errors. No warnings
> I am trying now to attach the data from management studio console (Database
> - Attach).
> But when adding .mdf file location I receive the following message:
> "Failed to retrieve data.. CREATE FILE encounted operating system error 5
> while attempting to open/create... Error 5123"
> Do you miss anything? Any idea?
> Thank you for your suggestions.
Google says this is "access denied":
operating system error 5 !!!|||On Feb 14, 8:01=A0am, Zarko Jovanovic
<mind_lessIsHsAsTsEsSsPsA...@.inet.hr> wrote:
> Francesco wrote:
> > Hi
> > I have just received data files ( .mdf and .ldf ) and I need to attach t=hem
> > to a sql express 2005. My machine is WinXP vers. 2002 SP2.
> > I downloaded the varius files (.NET 2, sql 2005, sql management studio
> > express) and installation was ok. No errors. No warnings
> > I am trying now to attach the data from management studio console (Datab=ase
> > - Attach).
> > But when adding .mdf file location I receive the following message:
> > "Failed to retrieve data.. CREATE FILE encounted operating system error =5
> > while attempting to open/create... Error 5123"
> > Do you miss anything? Any idea?
> > Thank you for your =A0suggestions.
> Google says this is "access denied":
> operating system error 5 !!!- Hide quoted text -
> - Show quoted text -
To explain, SQL Management Studio is trying to look for a file where
you do not have permissions. This can be caused by (simple) NT file
permissions or (not so simple) something else is holding the .mdf
file. The latter problem is usually some type of anti-virus software
trying to scan the .mdf and .ldf files.
If you've double-checked the directory permissions, you may want to
use Sysinternals Process Explorer (which is a free download from
Microsoft) and search for handles on the .mdf - that will tell you if
something else strange is going on.|||Make sure SQL Management Studio is running as admin. Setting full
permissions on the database file alone wasn't sufficient for me. Sign on as
admin in Win XP. If using Vista, right click on the SQL Studio application
link and select Run as Administrator. Then you will be able to attach a
database from anywhere in the file system.

Attach an sql express edition database file to Sql Developer Edition instanse

Hi i have two version of SQL server express (with Visual Studio 2005) and developer edition i am trying to access an sql database file -created by the express edition integrated with Visual studio- using a developer edition instance can i just attach it and access it. and can i use BI and reporting services on that fileHi,

files created are by SQL Server Express are full featured data files. You can do everything with them that you do with those created by the othwer editions of SQL Server 2k5.

HTH; Jens K. Suessmeyer.

http://www.sqlserver2005.de

Attach a Database from multiple computers? (SQL Server Express 2005)

Can multiple computers,running SQL Server Express 2005, simultaneously
attach to a single database file, hosted on a networked drive? Eg
does one instance of Express lock the database when it is attached?
I am replacing Access db calls in a program and it access a db on a
shared location. I would rather not try to get the client to set up a
network enabled Express server!
"David" <dm_fw@.sbcglobal.net> wrote in message
news:6uo2i2528b3ju7vp1bqbm7hi8d8ft3fe7r@.4ax.com...
> Can multiple computers,running SQL Server Express 2005, simultaneously
> attach to a single database file, hosted on a networked drive?
No. A SQL Server instance requires exclusive access to its database files.
And moreover attaching database files on a network is not supported.

>Eg
> does one instance of Express lock the database when it is attached?
> I am replacing Access db calls in a program and it access a db on a
> shared location. I would rather not try to get the client to set up a
> network enabled Express server!
Well, that's just the way SQL Server works.
David
|||"David" <dm_fw@.sbcglobal.net> wrote in message
news:6uo2i2528b3ju7vp1bqbm7hi8d8ft3fe7r@.4ax.com...
> I am replacing Access db calls in a program and it access a db on a
> shared location. I would rather not try to get the client to set up a
> network enabled Express server!
Then you are using the wrong product. What on earth would be the point of
replacing Jet with just another file sharing program?
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx

Attach a Database from multiple computers? (SQL Server Express 2005)

Can multiple computers,running SQL Server Express 2005, simultaneously
attach to a single database file, hosted on a networked drive? Eg
does one instance of Express lock the database when it is attached?
I am replacing Access db calls in a program and it access a db on a
shared location. I would rather not try to get the client to set up a
network enabled Express server!"David" <dm_fw@.sbcglobal.net> wrote in message
news:6uo2i2528b3ju7vp1bqbm7hi8d8ft3fe7r@.4ax.com...
> Can multiple computers,running SQL Server Express 2005, simultaneously
> attach to a single database file, hosted on a networked drive?
No. A SQL Server instance requires exclusive access to its database files.
And moreover attaching database files on a network is not supported.
>Eg
> does one instance of Express lock the database when it is attached?
> I am replacing Access db calls in a program and it access a db on a
> shared location. I would rather not try to get the client to set up a
> network enabled Express server!
Well, that's just the way SQL Server works.
David|||"David" <dm_fw@.sbcglobal.net> wrote in message
news:6uo2i2528b3ju7vp1bqbm7hi8d8ft3fe7r@.4ax.com...
> I am replacing Access db calls in a program and it access a db on a
> shared location. I would rather not try to get the client to set up a
> network enabled Express server!
Then you are using the wrong product. What on earth would be the point of
replacing Jet with just another file sharing program?
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--

Attach a Database from multiple computers? (SQL Server Express 2005)

Can multiple computers,running SQL Server Express 2005, simultaneously
attach to a single database file, hosted on a networked drive? Eg
does one instance of Express lock the database when it is attached?
I am replacing Access db calls in a program and it access a db on a
shared location. I would rather not try to get the client to set up a
network enabled Express server!"David" <dm_fw@.sbcglobal.net> wrote in message
news:6uo2i2528b3ju7vp1bqbm7hi8d8ft3fe7r@.
4ax.com...
> Can multiple computers,running SQL Server Express 2005, simultaneously
> attach to a single database file, hosted on a networked drive?
No. A SQL Server instance requires exclusive access to its database files.
And moreover attaching database files on a network is not supported.

>Eg
> does one instance of Express lock the database when it is attached?
> I am replacing Access db calls in a program and it access a db on a
> shared location. I would rather not try to get the client to set up a
> network enabled Express server!
Well, that's just the way SQL Server works.
David|||"David" <dm_fw@.sbcglobal.net> wrote in message
news:6uo2i2528b3ju7vp1bqbm7hi8d8ft3fe7r@.
4ax.com...
> I am replacing Access db calls in a program and it access a db on a
> shared location. I would rather not try to get the client to set up a
> network enabled Express server!
Then you are using the wrong product. What on earth would be the point of
replacing Jet with just another file sharing program?
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--

Thursday, March 22, 2012

At my wits' end: LIKE

(SQL Server 2005, express edition)

I have a list of table names that I need to translate according to a
naming convention. I'm doing this using pattern matching in a LIKE
clause.

In one specific case I get no match where I believe that there should
be one. I must be missing something obvious here, but what?

I have boiled it down to this example (the real one is more complex):

Matching on the first four characters I get a match:

select 'yes'
where 'TBAAA243_D_AFTBEL' like 'TBAA%';

--
yes

(1 row(s) affected)

That is fine, just as I would have expected. But if I try to match
only on the first 3 characters, I get this:

select 'yes'
where 'TBAAA243_D_AFTBEL' like 'TBA%';

(0 row(s) affected)

I have also tried the same on enterprise edition and get the same
strange result. Language is set to us_english

What am I missing here?

Any help appreciated, before I tear out the very last of my remaining
hair

Bo BrunsgaardHave you applied any service packs? If not, try installing Express SP2
(http://www.microsoft.com/downloads/...displaylang=en).
I get the correct results on my SP2 Developer Edition instance:

select 'yes'
where 'TBAAA243_D_AFTBEL' like 'TBA%';

--
yes

(1 row(s) affected)

--
Hope this helps.

Dan Guzman
SQL Server MVP

<bbcworldtour@.hotmail.comwrote in message
news:1176718533.092593.280820@.b75g2000hsg.googlegr oups.com...

Quote:

Originally Posted by

(SQL Server 2005, express edition)
>
I have a list of table names that I need to translate according to a
naming convention. I'm doing this using pattern matching in a LIKE
clause.
>
In one specific case I get no match where I believe that there should
be one. I must be missing something obvious here, but what?
>
I have boiled it down to this example (the real one is more complex):
>
Matching on the first four characters I get a match:
>
select 'yes'
where 'TBAAA243_D_AFTBEL' like 'TBAA%';
>
--
yes
>
(1 row(s) affected)
>
>
That is fine, just as I would have expected. But if I try to match
only on the first 3 characters, I get this:
>
select 'yes'
where 'TBAAA243_D_AFTBEL' like 'TBA%';
>
(0 row(s) affected)
>
I have also tried the same on enterprise edition and get the same
strange result. Language is set to us_english
>
What am I missing here?
>
Any help appreciated, before I tear out the very last of my remaining
hair
>
Bo Brunsgaard
>

|||On 16 Apr., 13:46, "Dan Guzman" <guzma...@.nospam-online.sbcglobal.net>
wrote:

Quote:

Originally Posted by

Have you applied any service packs? If not, try installing Express SP2
(http://www.microsoft.com/downloads/...711d5d-725...).
I get the correct results on my SP2 Developer Edition instance:


I upgraded to SP2, but the problem persisted. It turns out that it is
hidden deep inside the finer points of the database collation. I
thought this was kind of interesting in a low-intense way, so here's
the story:

Our databases are running a collation of Danish_Norwegian_CS_AS (we
are a Danish company).

In Danish we have three special phonemes that are represented in
writing as the letters , and . These three letters are
alphabetically placed as the last three letters of the alphabet.

The last one turns out to the culprit (if it doesn't show up proper
imagine an upper-cased A with a small circle superimposed on it).

Using the letter for the phoneme [] is a fairly recent addition to
Danish (around 1950's). Traditionally it was written as "AA". For
instance, my surname can be written as either "Brunsgrd" or
"Brunsgaard", but is still considered the same name.

So in Danish, "AA" can be either the traditional writing of the
phoneme [] OR just two "A"s which happen to be consecutive.

Danish_Norwegian_CS_AS collation recognizes "AA" as "". This is
usually real neat for sorting. Consider the lastnames "grd" and
"Aagaard" - these should be sorted together at the end of a list, and
using any Danish_Norwegian collation will ensure just that.

Consider:

create table taDanishDemo
(
nameInDanish varchar(30)
collate Danish_Norwegian_CS_AS

, nameInEnglish varchar(30)
collate Latin1_General_CS_AS
)
;

Let us insert a couple of rows which contain a case of consecutive
"A"s:

insert
into taDanishDemo (nameInDanish,nameInEnglish)
select 'TBAAA','TBAAA'
union all
select 'TBABA','TBABA'
;

Retrieving the rows ordered will now yield different results depending
on whether we order on the Danish or the Latin1 collated column:

select nameInEnglish
from taDanishDemo
order by nameInEnglish;

nameInEnglish
----------
TBAAA
TBABA

Under Latin1 collation the "AA" is considered just two concecutive
"A"'s and ordered at the beginning of the list.
But, under Danish collation, the "AA" is considered the traditional
writing of [], and placed at the end of the list:

select nameInDanish
from taDanishDemo
order by nameInDanish;

nameInDanish
----------
TBABA
TBAAA

So far, so good.

What threw me completely is that this also affect how the string "AA"
is interpreted by the LIKE operator.

select nameInDanish
from taDanishDemo
where nameInDanish like 'TBA%'

nameInDanish
----------
TBABA

The row containing "TBAAA" isn't returned Trying to match "AA" with an
"A" plus a wildcard will yield no match under Danish collation, since
SQL Serve interprets this as trying to match "" with "A"!

But under Latin1 collation "AA" does match "A" and a wildcard, as "AA"
is just two "A"'s

select nameInEnglish
from taDanishDemo
where nameInEnglish like 'TBA%'

nameInEnglish
----------
TBAAA
TBABA

I'm still not really sure whether this is a useful feature, an
unintended side effect or a bug :-)

Bo Brunsgaard|||Our databases are running a collation of Danish_Norwegian_CS_AS (we

Quote:

Originally Posted by

are a Danish company).


I'm glad you were able to identify the root cause. I briefly considered a
possible collation issue but didn't think that would explain your symptoms
since I didn't know that collation rules considered consecutive characters.
Thanks a lot for the detailed analysis.

--
Hope this helps.

Dan Guzman
SQL Server MVP

<bbcworldtour@.hotmail.comwrote in message
news:1176883896.875730.239770@.n76g2000hsh.googlegr oups.com...
On 16 Apr., 13:46, "Dan Guzman" <guzma...@.nospam-online.sbcglobal.net>
wrote:

Quote:

Originally Posted by

Have you applied any service packs? If not, try installing Express SP2
(http://www.microsoft.com/downloads/...1711d5d-725...).
I get the correct results on my SP2 Developer Edition instance:


I upgraded to SP2, but the problem persisted. It turns out that it is
hidden deep inside the finer points of the database collation. I
thought this was kind of interesting in a low-intense way, so here's
the story:

Our databases are running a collation of Danish_Norwegian_CS_AS (we
are a Danish company).

In Danish we have three special phonemes that are represented in
writing as the letters , and . These three letters are
alphabetically placed as the last three letters of the alphabet.

The last one turns out to the culprit (if it doesn't show up proper
imagine an upper-cased A with a small circle superimposed on it).

Using the letter for the phoneme [] is a fairly recent addition to
Danish (around 1950's). Traditionally it was written as "AA". For
instance, my surname can be written as either "Brunsgrd" or
"Brunsgaard", but is still considered the same name.

So in Danish, "AA" can be either the traditional writing of the
phoneme [] OR just two "A"s which happen to be consecutive.

Danish_Norwegian_CS_AS collation recognizes "AA" as "". This is
usually real neat for sorting. Consider the lastnames "grd" and
"Aagaard" - these should be sorted together at the end of a list, and
using any Danish_Norwegian collation will ensure just that.

Consider:

create table taDanishDemo
(
nameInDanish varchar(30)
collate Danish_Norwegian_CS_AS

, nameInEnglish varchar(30)
collate Latin1_General_CS_AS
)
;

Let us insert a couple of rows which contain a case of consecutive
"A"s:

insert
into taDanishDemo (nameInDanish,nameInEnglish)
select 'TBAAA','TBAAA'
union all
select 'TBABA','TBABA'
;

Retrieving the rows ordered will now yield different results depending
on whether we order on the Danish or the Latin1 collated column:

select nameInEnglish
from taDanishDemo
order by nameInEnglish;

nameInEnglish
----------
TBAAA
TBABA

Under Latin1 collation the "AA" is considered just two concecutive
"A"'s and ordered at the beginning of the list.
But, under Danish collation, the "AA" is considered the traditional
writing of [], and placed at the end of the list:

select nameInDanish
from taDanishDemo
order by nameInDanish;

nameInDanish
----------
TBABA
TBAAA

So far, so good.

What threw me completely is that this also affect how the string "AA"
is interpreted by the LIKE operator.

select nameInDanish
from taDanishDemo
where nameInDanish like 'TBA%'

nameInDanish
----------
TBABA

The row containing "TBAAA" isn't returned Trying to match "AA" with an
"A" plus a wildcard will yield no match under Danish collation, since
SQL Serve interprets this as trying to match "" with "A"!

But under Latin1 collation "AA" does match "A" and a wildcard, as "AA"
is just two "A"'s

select nameInEnglish
from taDanishDemo
where nameInEnglish like 'TBA%'

nameInEnglish
----------
TBAAA
TBABA

I'm still not really sure whether this is a useful feature, an
unintended side effect or a bug :-)

Bo Brunsgaard

Saturday, February 25, 2012

Assembly Clash between June and July CTP in VS.NET/SQL Express

Hi! How do I upgrade the assemblies in a databases between the Framework that came in VS.NET June CTP and VS.NET July CTP. I've created a fairly extensive database in the former which I'd like to use in the later. All of the non-CLR stuff seems to be accessible just fine. Unfortunately I no longer have the June CTP installed and the assemblies are running into versioning problems. I'd be happy to delete the offending assemblies if only I knew how. Any advice would be greatly appreciated. Thanks...

BTW, I tried to install XM and do an export but it also doesn't run with the July CTP. Aaaaaarrrrrgggghhhh....me too!
When I depoly a Sql Server Project in vs2005, It not work:
Common Language Runtime(CLR) v2.0.50215 not installed properly. The CLR is required to use SQL/CLR features.

|||Could you please explain what versioning problems you are facing? A series of steps you took and the related error messages would be helpful.

Thanks,
-Vineet.|||This means your .NET Framework installation didnt occur successfully. Try uninstalling and reinstalling just CLR.

Thanks,
-Vineet|||

My sql express was installed with the installation of vs2005 beta 2 ( .NetFramework build 50712), I don't know why it requires the build 50215.
Can I switch sql express to 50712 ?

|||

I have a simmiliar problem with sql.

The june CTP of SQL Server wont install with july CTP of VS2005 TS. I found out that they are using different versions of .NET 2.0.

Now what i had a laugh with was the fact that sql express that ships with VS2005 TS july CTP is from SQL June CTP. The visual studio installer automatically installs it just fine, but if you try to install it manually you get an error for an incompatible version of .net framework and vs :S

|||

Yes, the last compatible version of SQL Server and VS for CLR Integration features was June CTP. The next compatible version would be september CTP.
You can use all other features of SQL Express besides CLR integration in VS CTPs in between.

Thanks,
-Vineet.

|||Thanks for your reply! I was hoping it would be sooner but what can you do....

ASPNETDB.MDF, My Own Database and Deployment

This question has been asked before, with vague responses

I'm using Visual Web Developer 2005 Express, SQL Server 2005 Express and SQL Server Management Studio Express.

When I create an application with Login controls, VWD automaticlly creates a ASPENTDB.MDF security database. I also create my own database for my application e.g. abc.mdf. In other words, I have two databases. However, my hosting company supports only one database. What do I (we) do?

I have seen articles on:aspnet_regsql . Does this create a new database with all the security features of ASPNETDB.MDF built into my new database i.e. abc.mdf?

(A) If yes, how do you run it with SQL Server Managment Studio Express? It sounds silly, but I need instructions here please ... Also, do you run this against abc.mdf or do you use it create abc.mdf?

(B) If not, how do you achieve a single database scenario?

I'm sure this is a very common deployment question, which is very confusing for most of us hobbyists that want to deploy their web applications

As I understand, by default the data for a application will be stored in the database (ASPENTDB.MDF ) automaticlly created by VWD--you can change your connection string to connect other databases and the data will be only put into 1 database. To understand how your website using the database, you can take a look at :

http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx

If you want to maneger the database in Management Studio, you can detach the database from your application (right click it in Server Explorer), then attach it in Management Studio. You can refer to this article:

http://msdn2.microsoft.com/en-us/library/ms187858.aspx

|||

Thank you for the response. I have seen the first URL previously and have some questions on running theaspnet_regsql.exe utility

1. I do NOT have the full blown SQL Server 2005 version on my development machine (nor do I have it in my LAN). Do I need to have this in order for the aspnet_regsql utility to work?

2. I still want to develop and test locally and when satsified upload to the web hoster. If aspnet_regsql creates a full SQL Server 2005 database version for me locally, how do I manage it using VWD locally, because VWD works with the SQL Server 2005 Express version?

3. By running aspnet-regsql, does it fundamentally change VWD from using SQL Server 2005 Express thereafter for other new sites, projects and solutions on the same development machine? I do not want this to be the case

4. Can I undo or reverse the effects of running aspnet_regsql?

Cheers

ASPNETDB.mdf Resolved

Hi,

I thought I had this corrected, but in fact don't. According to http://msdn2.microsoft.com/en-us/library/ms228037.aspx

SQL Express is supposed to automatically generate a copy of ASPNETDB.mdf in the App_Data folder of the Express edition development suites (I'm using Visual Web Developer 2005).

In my case, it doesn't, and I can't figure out how to trigger it manually. I've read every post I can find, especially http://forums.microsoft.com/msdn/showpost.aspx?postid=98346&siteid=1

However, that mainly applies to deploying a database that already exists. I have already tried deleting the files as suggested and they do reappear in the appropriate folder, but I'm still not getting the ASPNETDB.mdf file in my apps.

Any help on this would be greatly appreciated. I've had a post up on the Visual Web Developer forum, but folk are staying away in droves. Also tried uninstall and reinstall all the way down to IIS 5.1

biobot

You install the database by executing Aspnet_regsql.exe
in your %windir%\Microsoft.NET\Framework\<Your.Net Framework version> folder

You can find installation instructions and other information in the following article:

How To: Use Role Manager in ASP.Net 2.0

http://msdn2.microsoft.com/en-us/library/ms998314.aspx

-Sue

|||

Sue,

Thank you! It took some improvising, but I am now getting the aspnetdb.mdf auto-generating as is should. (There are some differences between the SQLEXPRESS Management Suite and Enterprise Manager, apparently).

I never would have thought to look up how to use Role manager to solve this problem!!?

Also, it is great to get a response in complete, contextually relevant sentences!

Best regards,

Larry

|||Open Visual Web Developer Express (VWD). Open the website in VWD. Click on the 'Website' menu. At the bottom of the website menu is ASP.Net configuration, open it. It opens ‘Asp.Net Website Administration Tool’. Under the 'Security' tab add a user.

Done; ASPNETDB.mdf is up and configured for your website|||Doesn't work in a shared environment

Friday, February 24, 2012

ASPNETDB.mdf

Hi,

I thought I had this corrected, but in fact don't. According to http://msdn2.microsoft.com/en-us/library/ms228037.aspx

SQL Express is supposed to automatically generate a copy of ASPNETDB.mdf in the App_Data folder of the Express edition development suites (I'm using Visual Web Developer 2005).

In my case, it doesn't, and I can't figure out how to trigger it manually. I've read every post I can find, especially http://forums.microsoft.com/msdn/showpost.aspx?postid=98346&siteid=1

However, that mainly applies to deploying a database that already exists. I have already tried deleting the files as suggested and they do reappear in the appropriate folder, but I'm still not getting the ASPNETDB.mdf file in my apps.

Any help on this would be greatly appreciated. I've had a post up on the Visual Web Developer forum, but folk are staying away in droves. Also tried uninstall and reinstall all the way down to IIS 5.1

biobot

You install the database by executing Aspnet_regsql.exe
in your %windir%\Microsoft.NET\Framework\<Your.Net Framework version> folder

You can find installation instructions and other information in the following article:

How To: Use Role Manager in ASP.Net 2.0

http://msdn2.microsoft.com/en-us/library/ms998314.aspx

-Sue

|||

Sue,

Thank you! It took some improvising, but I am now getting the aspnetdb.mdf auto-generating as is should. (There are some differences between the SQLEXPRESS Management Suite and Enterprise Manager, apparently).

I never would have thought to look up how to use Role manager to solve this problem!!?

Also, it is great to get a response in complete, contextually relevant sentences!

Best regards,

Larry

ASPNETDB migration

I created a website using Visual web developer express edition (including SQL Express). No the user management section of the site (the login/logout database) was created automatically and SQL Server express was installed at my computer under the instance name of SQLExpress. I uploaded it to my web host and he hooked up the ASPNETDB for me. Now the problem is that ASPNETDB has an id password and I was given theMSSQL Server IP. How do I configure my website to accommodate that? Any help will be extremely useful!!!

you need to modify the connection string in web.config

<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="server=server ip;database=ASPNETDB;uid=youUsername;pwd=yourpassword"
providerName="System.Data.SqlClient"/>

</connectionStrings>

|||

WOW! Thats it! Thanks a bunch. One more thing. I am also using the same database to display some data(have added some tables into it manually). What should I put in the connection string to make the connection to the database? Also, can I use a MySQL database instead? If yes, what will be the connection string?

Thanks for your help.

|||

if you don't want to use the same name "LocalSqlServer", then you can add another connection with the same connectionString
like:

<add name="yourConnName" connectionString="server=server ip;database=ASPNETDB;uid=youUsername;pwd=yourpassword"
providerName="System.Data.SqlClient"/>

I am not sure if you can use MySQL as a configuration Database, but you can use it for application database.

Honestly, I didn't use it before. to get the exact connection string for MySQL, try to add a coonection from the wizard and see how vs2005 creates it in web.config

aspnetdb connection could not establish but database correctly created.

I installed netframework 2.0 Visual Web developer and MSSQL 2005 express edition with SQL Server management express.

I have got this configuration: 2*256 mb ram Intel Pentium 3.2Ghz Windows XP HUN SP2 latest version.

server name: localhost\SQLEXPRESS
Authentication: Windows Authentication

I run aspnet_regsql.exe and the setup wizard created aspnetdb see here, Microsoft sql server management studio can see the database:
MSSQL server management express & aspnetdb

But! When I run to the asp.net web application administration tool in Provider Configuration and choose
AspNetSqlProvider only 1
then I clickSelect a single provider for all site management data link -> then test

The Tool write this:
Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web SiteAdministration tool, use the aspnet_regsql command-line utility tocreate and configure the database, and then return to this tool to setthe provider.

Hi,

You application does not "know" where your database is. It is trying to find it in App_Data folder of your application. If it is not there you can specify its locaton by using connection string in web.config like this:

<connectionStrings>
<clear/>
<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
</connectionStrings>

|||

<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings>
<clear/>
<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
</connectionStrings>

<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.

Visual Basic options:
Set strict="true" to disallow all data type conversions
where data loss can occur.
Set explicit="true" to force declaration of all variables.
-->
<compilation debug="true" strict="false" explicit="true"/>
<pages>
<namespaces>
<clear/>
<add namespace="System"/>
<add namespace="System.Collections"/>
<add namespace="System.Collections.Specialized"/>
<add namespace="System.Configuration"/>
<add namespace="System.Text"/>
<add namespace="System.Text.RegularExpressions"/>
<add namespace="System.Web"/>
<add namespace="System.Web.Caching"/>
<add namespace="System.Web.SessionState"/>
<add namespace="System.Web.Security"/>
<add namespace="System.Web.Profile"/>
<add namespace="System.Web.UI"/>
<add namespace="System.Web.UI.WebControls"/>
<add namespace="System.Web.UI.WebControls.WebParts"/>
<add namespace="System.Web.UI.HtmlControls"/>
</namespaces>
</pages>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>

I paste But doesn't work.Sad modify the text or not? When I run the page createuserwizard

Kiszolgálóhiba t?rtént az alkalmazásban: ?/Website".Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.Leírás: Nem kezelt kivétel k?vetkezett be az aktuális webes kérelem végrehajtása során. A hibára és az azt okozó kódrészletre vonatkozó adatok az alábbi veremkivonatban találhatók.Hiba t?rtént az SQLExpress adatbázisfájl automatikus létrehozásakor:A kapcsolódási karakterlánc az alkalmazás App_Data k?nyvtárában található adatbázishelyet használó helyi SQL Server Express példányt ad meg. A szolgáltató megkísérelte automatikusan létrehozni az alkalmazás szolgáltatási adatbázisát, mert a szolgáltató megállapította, hogy az adatbázis nem létezik. A k?vetkez? konfigurálási k?vetelmények megléte szükséges ahhoz, hogy az alkalmazás szolgáltatási adatbázisának létezése sikeresen ellen?rizhet? legyen, és hogy az alkalmazás szolgáltatási adatbázisa automatikusan létrehozható legyen: 1. Ha még nem létezik az alkalmazás App_Data k?nyvtára, a webkiszolgálói fióknak olvasási és írási hozzáféréssel kell rendelkeznie az alkalmazás k?nyvtárához. Ez azért szükséges, mert a webkiszolgálói fiók automatikusan létre fogja hozni az App_Data k?nyvtárat, ha az még nem létezik. 2. Ha már létezik az alkalmazás App_Data k?nyvtára, a webkiszolgálói fióknak csak az alkalmazás App_Data k?nyvtárához van szüksége olvasási és írási hozzáférésre. Ez azért szükséges, mert a webkiszolgálói fiók megkísérli ellen?rizni, hogy az alkalmazás App_Data k?nyvtárában már létezik-e az SQL Server Express adatbázis. Ha visszavonja a webkiszolgálói fióktól az olvasási engedélyt az App_Data k?nyvtárhoz, a szolgáltató nem fogja tudni helyesen megállapítani, hogy már létezik-e az SQL Server Express adatbázis. Ez hibát okoz, amikor a szolgáltató megpróbálja még egyszer létrehozni a már létez? adatbázis másodpéldányát. Az írási hozzáférés azért szükséges, mert az új adatbázis létrehozásához a webkiszolgálói fiók hitelesít? adatait kell használni. 3. A számítógépen telepítve kell lennie az SQL Server Express programnak. 4. A webkiszolgálói fiók folyamatidentitásának helyi felhasználói profillal kell rendelkeznie. A mind a számítógéphez, mind a tartományi fiókokhoz készített helyi felhasználói profil létrehozásáról az információs fájl tartalmaz további tudnivalókat.Forráshiba:Az aktuális webes kérelem végrehajtása nem kezelt kivételt okozott. A kivétel okára és helyére vonatkozó adatok az alábbi veremkivonatban találhatók.Veremkivonat:[SqlException (0x80131904): Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735027 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +130 System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +27 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +47 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +67[HttpException (0x80004005): Nem lehet csatlakozni az SQL Server adatbázishoz.] System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +122 System.Web.Management.SqlServices.SetupApplicationServices(String server, String user, String password, Boolean trusted, String connectionString, String database, String dbFileName, SqlFeatures features, Boolean install) +89 System.Web.Management.SqlServices.Install(String database, String dbFileName, String connectionString) +26 System.Web.DataAccess.SqlConnectionHelper.CreateMdfFile(String fullFileName, String dataDir, String connectionString) +388Verzióinformáció: Microsoft .NET-keretrendszer verziója:2.0.50727.42; ASP.NET verziója:2.0.50727.42
|||

I don't understand I try to make an other database in app_data new_item anotherdatabase.mdf and I have got this message:
Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.
I reinstall Confused everything maybe next time work normal.

|||

Where is located aspnetdb.mdf?

|||

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\here

But I try to put them into the App_Data and doesn't work.
I install Windows Longhorn Beta (server 2008) and sites runingI try the same in my notebook windows XP HUN and workso I don't know what is the problem ,but NOW run everythingSmile and I don't care.