Showing posts with label everybody. Show all posts
Showing posts with label everybody. Show all posts

Friday, March 23, 2012

how can I open a .mdf aspnetDB DataBase ?

Hello everybody,

I am working with SqlExpress and MSSQL Server Management Studio Express and do not manage to open the aspnetDB .mdf database in which I am storing all data about my users.

I woulds like to open it and to be able to request it in order to check some strange things.

Actually, I'm experiencing an isssue with that database since the request just below gives me two results for only one user:

SELECT Member.Password, Member.PasswordAnswerFROM aspnet_MemberShip Member, aspnet_Users UsersWHERE Member.UserId=Users.UserIdAND Users.UserName='Admin'

Using this request returns me a user whom password is clear and an identical user whom password is hashed whereas I set PasswordFormat="Clear" in my Web.Config

Could you explain me how I may proceed please?

Thanx for your help

If you still have your project open, it could be that the project has a lock on the database file. Close your project in order to use MS SSMS express.

Otherwise, you can right-click the ASPNET.MDF database file and choose 'Open'. This will allow you to navigate the database using the Server Explorer tab, much like you would with SSMS.

Your problem lies in your SQL, however. UserId is the only Unique column in the default Users table because it is the primary key. This means that the UserName is NOT unique, and could be duplicated.

Use System.Web.Security.Membership.Provider to get a reference to the app's default membership provider, and use that to do what you need. (See the System.Web.Security.MembershipProvider class for available functions.)

|||

Thanx for your answer ps2goat,

I finally used VisualStudio Servers's Explorer to do so and was able to see all the information stored in the .mdf file.

This raises some questions about the issue I was dealing about above, but at the time, it is a solution for that precise problem ;)

In fact, I had two identical usernames in the database, one with a password saved in clear and the other hashed and, as you tell it, with a different unique ID.

I believe this comes from the fact that I used this .mdf file in more than 3 versions of the current prooject, making of it some kind of mess where it becomes to difficult to find what you're looking for.

Thanks for your help.

|||

You can just use visual studio directly to navigate through it. Also you can get that into sql express or any other db and reconstruct all the db.

Wednesday, March 21, 2012

How can I make tempdb to its original size?

Hi, everybody!
I installed MS SQL Server 2000, and add two files to tempdb.
And now I want to make tempdb to its original size by removing two files
which had beed added.
How can I do it?http://www.support.microsoft.com/?id=307487
Andrew J. Kelly
SQL Server MVP
"Kim Keuk Tae" <zyuuzika@.korea.com> wrote in message
news:uF0WdC1cDHA.2572@.TK2MSFTNGP11.phx.gbl...
>
> Hi, everybody!
> I installed MS SQL Server 2000, and add two files to tempdb.
> And now I want to make tempdb to its original size by removing two files
> which had beed added.
> How can I do it?
>
>

Friday, March 9, 2012

How can I increase the maximum number of parallel connections when exporting to Oracle via

Hi to everybody,
When exporting to Oracle from SQL Server using Import/Export Wizard,
I've discovered that SQL Server only creates 4 simultaneous
connections to Oracle. Obviously this fact prevents SQL Server from
exporting the tables in a parallel way. Instead, the tables are forced
to wait until one of the 4 connections gets free to export and due to
this fact the performance of the export operation suffers from an
enormous slow down.
Even though I create new connections in the DTS Designer (up to 20),
SQL Server 2K continues only using the same 4 ones which makes me
suspect that there must be a hidden option somewhere to change this.
Is there any way in SQL Server 2K to increase the number of maximum
simultaneous connections to Oracle?
Thank your from beforehand for reading my post.
Greetings,
David GrantBy default, DTS executes only 4 tasks concurrently. Check how to change this
at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dtsdsgnr/dtsdsgnr2_60mp.asp
(the last option on the General tab of package properties).
--
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
"David Grant" <icebold54@.hotmail.com> wrote in message
news:18503386.0504181032.2b96883c@.posting.google.com...
> Hi to everybody,
> When exporting to Oracle from SQL Server using Import/Export Wizard,
> I've discovered that SQL Server only creates 4 simultaneous
> connections to Oracle. Obviously this fact prevents SQL Server from
> exporting the tables in a parallel way. Instead, the tables are forced
> to wait until one of the 4 connections gets free to export and due to
> this fact the performance of the export operation suffers from an
> enormous slow down.
>
> Even though I create new connections in the DTS Designer (up to 20),
> SQL Server 2K continues only using the same 4 ones which makes me
> suspect that there must be a hidden option somewhere to change this.
> Is there any way in SQL Server 2K to increase the number of maximum
> simultaneous connections to Oracle?
>
> Thank your from beforehand for reading my post.
> Greetings,
> David Grant|||In addition to Dejan's excellent advice, note that you will need to look at how optimal hiking the tasks in parallel actually is.
If you are running on a 4 way then hiking this value to 20 would not be a good thing and you would see a lot of context switches as
things come in and off the processors. I would start with CPU Count -1
Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - SQL Server 2005 Integration Services.
www.Konesans.com
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si> wrote in message news:%23RTgwCFRFHA.204@.TK2MSFTNGP15.phx.gbl...
> By default, DTS executes only 4 tasks concurrently. Check how to change this
> at
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dtsdsgnr/dtsdsgnr2_60mp.asp
> (the last option on the General tab of package properties).
> --
> Dejan Sarka, SQL Server MVP
> Associate Mentor
> www.SolidQualityLearning.com
> "David Grant" <icebold54@.hotmail.com> wrote in message
> news:18503386.0504181032.2b96883c@.posting.google.com...
>> Hi to everybody,
>> When exporting to Oracle from SQL Server using Import/Export Wizard,
>> I've discovered that SQL Server only creates 4 simultaneous
>> connections to Oracle. Obviously this fact prevents SQL Server from
>> exporting the tables in a parallel way. Instead, the tables are forced
>> to wait until one of the 4 connections gets free to export and due to
>> this fact the performance of the export operation suffers from an
>> enormous slow down.
>>
>> Even though I create new connections in the DTS Designer (up to 20),
>> SQL Server 2K continues only using the same 4 ones which makes me
>> suspect that there must be a hidden option somewhere to change this.
>> Is there any way in SQL Server 2K to increase the number of maximum
>> simultaneous connections to Oracle?
>>
>> Thank your from beforehand for reading my post.
>> Greetings,
>> David Grant
>

How can I increase the maximum number of parallel connections when exporting to Oracle via

Hi to everybody,
When exporting to Oracle from SQL Server using Import/Export Wizard,
I've discovered that SQL Server only creates 4 simultaneous
connections to Oracle. Obviously this fact prevents SQL Server from
exporting the tables in a parallel way. Instead, the tables are forced
to wait until one of the 4 connections gets free to export and due to
this fact the performance of the export operation suffers from an
enormous slow down.
Even though I create new connections in the DTS Designer (up to 20),
SQL Server 2K continues only using the same 4 ones which makes me
suspect that there must be a hidden option somewhere to change this.
Is there any way in SQL Server 2K to increase the number of maximum
simultaneous connections to Oracle?
Thank your from beforehand for reading my post.
Greetings,
David Grant
By default, DTS executes only 4 tasks concurrently. Check how to change this
at
http://msdn.microsoft.com/library/de...sgnr2_60mp.asp
(the last option on the General tab of package properties).
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
"David Grant" <icebold54@.hotmail.com> wrote in message
news:18503386.0504181032.2b96883c@.posting.google.c om...
> Hi to everybody,
> When exporting to Oracle from SQL Server using Import/Export Wizard,
> I've discovered that SQL Server only creates 4 simultaneous
> connections to Oracle. Obviously this fact prevents SQL Server from
> exporting the tables in a parallel way. Instead, the tables are forced
> to wait until one of the 4 connections gets free to export and due to
> this fact the performance of the export operation suffers from an
> enormous slow down.
>
> Even though I create new connections in the DTS Designer (up to 20),
> SQL Server 2K continues only using the same 4 ones which makes me
> suspect that there must be a hidden option somewhere to change this.
> Is there any way in SQL Server 2K to increase the number of maximum
> simultaneous connections to Oracle?
>
> Thank your from beforehand for reading my post.
> Greetings,
> David Grant
|||In addition to Dejan's excellent advice, note that you will need to look at how optimal hiking the tasks in parallel actually is.
If you are running on a 4 way then hiking this value to 20 would not be a good thing and you would see a lot of context switches as
things come in and off the processors. I would start with CPU Count -1

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - SQL Server 2005 Integration Services.
www.Konesans.com
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si > wrote in message news:%23RTgwCFRFHA.204@.TK2MSFTNGP15.phx.gbl...
> By default, DTS executes only 4 tasks concurrently. Check how to change this
> at
> http://msdn.microsoft.com/library/de...sgnr2_60mp.asp
> (the last option on the General tab of package properties).
> --
> Dejan Sarka, SQL Server MVP
> Associate Mentor
> www.SolidQualityLearning.com
> "David Grant" <icebold54@.hotmail.com> wrote in message
> news:18503386.0504181032.2b96883c@.posting.google.c om...
>

How can I increase the maximum number of parallel connections when exporting to Oracle via

Hi to everybody,
When exporting to Oracle from SQL Server using Import/Export Wizard,
I've discovered that SQL Server only creates 4 simultaneous
connections to Oracle. Obviously this fact prevents SQL Server from
exporting the tables in a parallel way. Instead, the tables are forced
to wait until one of the 4 connections gets free to export and due to
this fact the performance of the export operation suffers from an
enormous slow down.
Even though I create new connections in the DTS Designer (up to 20),
SQL Server 2K continues only using the same 4 ones which makes me
suspect that there must be a hidden option somewhere to change this.
Is there any way in SQL Server 2K to increase the number of maximum
simultaneous connections to Oracle?
Thank your from beforehand for reading my post.
Greetings,
David Grant
By default, DTS executes only 4 tasks concurrently. Check how to change this
at
http://msdn.microsoft.com/library/de...sgnr2_60mp.asp
(the last option on the General tab of package properties).
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
"David Grant" <icebold54@.hotmail.com> wrote in message
news:18503386.0504181032.2b96883c@.posting.google.c om...
> Hi to everybody,
> When exporting to Oracle from SQL Server using Import/Export Wizard,
> I've discovered that SQL Server only creates 4 simultaneous
> connections to Oracle. Obviously this fact prevents SQL Server from
> exporting the tables in a parallel way. Instead, the tables are forced
> to wait until one of the 4 connections gets free to export and due to
> this fact the performance of the export operation suffers from an
> enormous slow down.
>
> Even though I create new connections in the DTS Designer (up to 20),
> SQL Server 2K continues only using the same 4 ones which makes me
> suspect that there must be a hidden option somewhere to change this.
> Is there any way in SQL Server 2K to increase the number of maximum
> simultaneous connections to Oracle?
>
> Thank your from beforehand for reading my post.
> Greetings,
> David Grant
|||In addition to Dejan's excellent advice, note that you will need to look at how optimal hiking the tasks in parallel actually is.
If you are running on a 4 way then hiking this value to 20 would not be a good thing and you would see a lot of context switches as
things come in and off the processors. I would start with CPU Count -1

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - SQL Server 2005 Integration Services.
www.Konesans.com
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si > wrote in message news:%23RTgwCFRFHA.204@.TK2MSFTNGP15.phx.gbl...
> By default, DTS executes only 4 tasks concurrently. Check how to change this
> at
> http://msdn.microsoft.com/library/de...sgnr2_60mp.asp
> (the last option on the General tab of package properties).
> --
> Dejan Sarka, SQL Server MVP
> Associate Mentor
> www.SolidQualityLearning.com
> "David Grant" <icebold54@.hotmail.com> wrote in message
> news:18503386.0504181032.2b96883c@.posting.google.c om...
>

How can I increase the maximum number of parallel connections when exporting to Oracle

Hi to everybody,
When exporting to Oracle from SQL Server using Import/Export Wizard,
I've discovered that SQL Server only creates 4 simultaneous
connections to Oracle. Obviously this fact prevents SQL Server from
exporting the tables in a parallel way. Instead, the tables are forced
to wait until one of the 4 connections gets free to export and due to
this fact the performance of the export operation suffers from an
enormous slow down.
Even though I create new connections in the DTS Designer (up to 20),
SQL Server 2K continues only using the same 4 ones which makes me
suspect that there must be a hidden option somewhere to change this.
Is there any way in SQL Server 2K to increase the number of maximum
simultaneous connections to Oracle?
Thank your from beforehand for reading my post.
Greetings,
David GrantBy default, DTS executes only 4 tasks concurrently. Check how to change this
at
2_60mp.asp" target="_blank">http://msdn.microsoft.com/library/d... />
2_60mp.asp
(the last option on the General tab of package properties).
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
"David Grant" <icebold54@.hotmail.com> wrote in message
news:18503386.0504181032.2b96883c@.posting.google.com...
> Hi to everybody,
> When exporting to Oracle from SQL Server using Import/Export Wizard,
> I've discovered that SQL Server only creates 4 simultaneous
> connections to Oracle. Obviously this fact prevents SQL Server from
> exporting the tables in a parallel way. Instead, the tables are forced
> to wait until one of the 4 connections gets free to export and due to
> this fact the performance of the export operation suffers from an
> enormous slow down.
>
> Even though I create new connections in the DTS Designer (up to 20),
> SQL Server 2K continues only using the same 4 ones which makes me
> suspect that there must be a hidden option somewhere to change this.
> Is there any way in SQL Server 2K to increase the number of maximum
> simultaneous connections to Oracle?
>
> Thank your from beforehand for reading my post.
> Greetings,
> David Grant|||In addition to Dejan's excellent advice, note that you will need to look at
how optimal hiking the tasks in parallel actually is.
If you are running on a 4 way then hiking this value to 20 would not be a go
od thing and you would see a lot of context switches as
things come in and off the processors. I would start with CPU Count -1
Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - SQL Server 2005 Integration Services.
www.Konesans.com
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si> wrote in message news:%23R
TgwCFRFHA.204@.TK2MSFTNGP15.phx.gbl...
> By default, DTS executes only 4 tasks concurrently. Check how to change th
is
> at
> nr2_60mp.asp" target="_blank">http://msdn.microsoft.com/library/d...>
nr2_60mp.asp
> (the last option on the General tab of package properties).
> --
> Dejan Sarka, SQL Server MVP
> Associate Mentor
> www.SolidQualityLearning.com
> "David Grant" <icebold54@.hotmail.com> wrote in message
> news:18503386.0504181032.2b96883c@.posting.google.com...
>

Monday, February 27, 2012

How can I get the username from an application?

Hi everybody,

Here the environment is application in 3 layers.
So the user in his client machine, access the application in an application server that sends the request to my sql server database server.
My problem is: when I run sp_who from Query Analyzer, I see the host name that is pre-defined inside code application. But, actually, I need to know the user who is requesting the transactio so I can know right the person who is slowing my database performance...
Do you know, any function, procedure or anything else that I can use in the application code in order to provide the user or the host name from the client machine???
I hope some answers...

Thank you all,Look up NILADIC functions in Books Online.|||host_name()|||Hi all,

I have this doubt: may I apply SP3a in my SQL Server production database while it is operational?
I mean, may I do this version upgrade while the databases are online and users continue accessing the databases normally?
My actual version is 8.00.194 (no SP applied), and I am planning to apply SP3a.

Thank you in advance,|||No, when applying sp3a to a server that is currently at RTM (what you load from the CD) will require a reboot of Windows. There will be a brief service interruption while the machine reboots.

-PatP|||host_name()Will host_name() help in a three tier environment? I would expect it to return the name of the middleware server.

-PatP|||So this function host_name() doesn't help me, because I need to see the client host name during sp_who...
Does someone can explain a solution for this?

Thanks,|||The easiest way is to have your middleware set the hostname (http://support.microsoft.com/default.aspx?scid=kb;en-us;140301) equal to however it identifies the caller (user name, account number, etc). There are other ways to do this, but they get ugly very quickly and each solution is VERY specific to the installation/application involved.

-PatP

Sunday, February 19, 2012

How can I get a row count of CTE recordset?

Hi everybody,
I want to get a row count of temporary CTE recordset.
My query is like this:

With SQLPaging As
(
Select Row_number() Over (Order by Row_num) as RowNumber,
Row_num,
Column_A,
Column_B From OriginalTable
)
Select * from SQLPaging Where RowNumber between 21 and 30

Let's assume SQLPaging definition contains 1,000 rows.

If I use @.@.rowcount, it returns only 10. I.e. number of actual rows per page.
What I want is that I want to know row count of SQLPaging CTE without extra counting query.
I think SQLServer already knows how many rows CTE definition contains.
The reason that I don't want to use extra counting query is that if SQLPaging definition has row performance query (like wild card(%) character search), extra row counting query takes simillar amount of loads. (Select count(*) from SQLPaging)

Is there any way of getting actual CTE definition row count?

Thanks.


Try using count(*) over()

With SQLPaging As
(
Select Row_number() Over (Order by Row_num) as RowNumber,
count(*) over() as MaxNum, --<<<<
Row_num,
Column_A,
Column_B From OriginalTable
)
Select * from SQLPaging Where RowNumber between 21 and 30

|||Yes, use Mark's answer - it's most definitely the one you want.

The great thing about this is that you won't find yourself having a massive performance hit from doing it this way. It will do it in the same pass.

Rob|||Cool! Thanks guys. I really appreciate it. :)

How can I find out which filegroup a table belongs to?

Hi, everybody!
I made a database which has two filegroups. One is primary filegroup, and
the other is named FG_01.
I set FG_01 as default filegroup so that every table should be created on
it.
But I found today that a developer had created tables on primary filegroup.
I want to move these tables from primary filegroup to FG_01 filegroup.
But there are so many tables that it is difficult to find out which tables
are on primary filegroup.
How can I find out which filegroups a table belongs to by means of query?
Any advice would be appreciated.Hello Kim !
Try to use the undocumented Procedure to fugure out the Filegroups:
sp_objectfilegroup @.objid
HTH, Jens Süßmeyer.