Showing posts with label table. Show all posts
Showing posts with label table. Show all posts

Friday, March 30, 2012

instances of MSDE

I can install instances of MSDE without any problem. But
for some reasons the password (or the instance) get
corrupted after I try to upsize a table from MS Access to
an existing database in MSDE (I'll stop doing this).
But now I have multiple instances which I would like to
clean up. Does anybody know how to uninstall them?
Thanks
Perry
Hi ,
You can use the following information to uninstall msde.
A)Remove the following registry:
1) Remove the following ID_Number from your MSDE 2.0 instance
HKEY_CLASSES_ROOT\Installer\Products\ID_Number
-- It has key value name 'ProductName' which displays the instance name.
For example, "ProductName" = Microsoft SQL Server Desktop Engine
(MYINSTANCE)
2)If you had patch applied on this MSDE 2.0 instance, you need to remove
ID_Number
for that MSDE 2.0 instance:
HKEY_CLASSES_ROOT\Installer\Patches\ID_Number
3) For MSDE 2.0 Default instance, remove
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer
For MSDE 2.0 named instance, remove
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL
Server\Your_instance_name
4)If you have the following key points to MSDE 2.0 productGUID, then remove
the
InstanceComponentSet.x
For example, HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL
Server\Component
SetInstanceComponentSet.x
-- For example, InstanceComponentSet.1 the has value matching the
productGUID of
sqlrun01.msi.
5)Remove :
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\Uninstall\Produ
ctGUID
-- the Product GUID which refers to your MSDE 2.0 instance.
6)Remove the Sql server service key:
For MSDE 2.0 default instance, remove
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\MSSQLServer
For MSDE 2.0 named instance, remove
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\MSSQL$Your_Instance_Nam
e
7)Remove the Sql server agent service key:
For MSDE 2.0 default instance, remove
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\SQLServerAgent
For MSDE 2.0 named instance, remove
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\SQLAgent$Your_Instance_
Name
B)Remove the MSDE 2.0 instance data and program install directory:
For example, G:\Program Files\Microsoft SQL
Server\MSSQL$Your_instanceName\data
For example, G:\Program Files\Microsoft SQL
Server\MSSQL$Your_instanceName\binn
Now rerun the msde setup from the command prompt
Girish Sundaram
This posting is provided "AS IS" with no warranties, and confers no rights.

Instance Failure: SqlDataSource

I'm trying to populate a DropDownList with data from an SQL table (called StrataPlans). I'm getting an instance failure from the following code:

<

asp:SqlDataSourceID="dataSource"runat="server"ConnectionString="Server=BEN-TOSH\\SQLEXPRESS; TRUSTED_CONNECTION=YES; database=OSMSQL"SelectCommand="SELECT * FROM StrataPlans"ProviderName="System.Data.SqlClient"SelectCommandType="Text"/>

<asp:DropDownListID="spList"DataSourceID="dataSource"runat="server"/>

I've tested the connectionstring/select query in another of my applications and it works ok...can anyone point me in the right direction as to how to resolve this?

Thanks

Hmm,

That seems odd; an instance failure would be with creating the obect I would think. Could you provide the details of the error message?

Monday, March 12, 2012

Integers & dynamic allocation

Here is what I am trying to do...
I want to goup "members" togethers in a "group."

A table for members and a table for groups.

each containing coluns...

but inside Groups I would like a column that contains ID numbers for the members that be long to that group.

Being that members can belong to multiple groups - I can not use a GroupID in Members - if so I also need a way of it modular.

Obvisiously I am not a very good DB programmer - but I want the least amount of empty/unused space in my tables.

Hope this makes senseyou need a third table (tblMemberGroups) that contains two columns

MemberID and GroupID

this table allow any member to belong to any number of groups and give you a normalized database structure (no wasted space).

you would need to create joins between all 3 tables to determine group membership

members -> tblMemberGroups -> groups

Integer, varchar and IN

In my database I have a table called "users" with a varchar-field that holds categori-id's commaseparated, collected from my other table "category". I do this to control access for my users, some users are only allowed access to some categories. I would like to run a statement sort of like this:select categoryname
from category
where catid in (select categories from user where userid = 12)Naturally, because catid and the field categories have different datatypes I get the error "Syntax error converting the varchar value '340, 344, 356' to a column of data type int."

Is there any way I can bypass this keeping the commaseparated values and without making a new normalized table instead?

(same question is also posted at sql-server-performance.com forums)Originally posted by Frettmaestro
Is there any way I can bypass this keeping the commaseparated values and without making a new normalized table instead?there are several ways, all of them, um, how do i put this, less than elegant
(same question is also posted at sql-server-performance.com forums) i'd be interested in hearing about any more clever solutions than mine:select C.categoryname
from user U
inner
join category C
on instr(','+C.catid',', ','+U.categories+',') > 0
where U.userid = 12the concatenation of a comma in front of and behind the fields is so that you will find the first or last category in the list

and of course the search string is delimited by commas, so that you don't accidentally find 12 inside 312|||Thanx alot for the contribution...are you a vb/asp-developer? This syntax is alot like asp/vb but unfortunately there is no such thing as "instr" in sql. I have used InStr alot in my asp-scripting but "IN" and "LIKE" are the only keywords I can think of that does close to the same thing allthough I cannot make them work. It's not a big deal to make the extra table actually...it was really more out of curiosity I was asking...|||vb/asp? me? heh, no way, not even close

my mistake, change INSTR to CHARINDEX|||but yeah, create a normalized table

for one thing, your queries won't do table scans and can start using indexes

:cool:|||This is the final version and it worked like a charm allthough I think I will go with the normalized table as you are recomending.select C.category
from user U
inner
join category C
on CHARINDEX(',' + CAST(C.catid AS varchar(20)) + ',', U.categories) > 0
where U.userid = 12It really doesn't make that big difference because this will probably only be used by 3-4 users maybe a couple of times a week, but still I prefer to create quality stuff instead of shit when I can. But thanx alot buddy for all your help, I might be back to bother you again real soon :D|||you have to put commas around U.categories too, otherwise you won't find the first or last item

;)

Friday, March 9, 2012

Integer field question

Hi
I need to create a table with an integer column that stores 2-byte
numbers in the range 0..65535, and forms part of the table's primary
key. Which data type should I pick?
I'm torn between:
(1) smallint - right size, but this is a signed type. So if a user
does a query for col > 60000, it won't work ..
(2) int - can hold number range correctly, but this is 4 bytes. I
could end up with 2 rows which are unique according to the primary
key, but having the same value for the first 2 bytes. Could fix with
an additional table constraint, but I wonder if there is a neater
way..
Can anyone recommend the best method to do this ?
thanks,
Neil
I don't think there's any simple way to do it. Int with a check constraint
to limit to numbers <= 65535 will solve it databasewise, but perhaps the
check constraint is not necessary if the middle-tier or GUI limits input to
2 bytes anyway?
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
|||On 3 Mar, 09:39, "Paul Ibison" <Paul.Ibi...@.Pygmalion.Com> wrote:
> I don't think there's any simple way to do it. Int with a check constraint
> to limit to numbers <= 65535 will solve it databasewise, but perhaps the
> check constraint is not necessary if the middle-tier or GUI limits input to
> 2 bytes anyway?
> Cheers,
> Paul Ibison SQL Server MVP,www.replicationanswers.com
OK, thanks for the answer. Yes, the GUI will validate user input.
I will go for the "int" option.

Integer field question

Hi
I need to create a table with an integer column that stores 2-byte
numbers in the range 0..65535, and forms part of the table's primary
key. Which data type should I pick?
I'm torn between:
(1) smallint - right size, but this is a signed type. So if a user
does a query for col > 60000, it won't work ..
(2) int - can hold number range correctly, but this is 4 bytes. I
could end up with 2 rows which are unique according to the primary
key, but having the same value for the first 2 bytes. Could fix with
an additional table constraint, but I wonder if there is a neater
way..
Can anyone recommend the best method to do this ?
thanks,
NeilI don't think there's any simple way to do it. Int with a check constraint
to limit to numbers <= 65535 will solve it databasewise, but perhaps the
check constraint is not necessary if the middle-tier or GUI limits input to
2 bytes anyway?
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com|||On 3 Mar, 09:39, "Paul Ibison" <Paul.Ibi...@.Pygmalion.Com> wrote:
> I don't think there's any simple way to do it. Int with a check constraint
> to limit to numbers <= 65535 will solve it databasewise, but perhaps the
> check constraint is not necessary if the middle-tier or GUI limits input t
o
> 2 bytes anyway?
> Cheers,
> Paul Ibison SQL Server MVP,www.replicationanswers.com
OK, thanks for the answer. Yes, the GUI will validate user input.
I will go for the "int" option.

Integer field question

Hi
I need to create a table with an integer column that stores 2-byte
numbers in the range 0..65535, and forms part of the table's primary
key. Which data type should I pick?
I'm torn between:
(1) smallint - right size, but this is a signed type. So if a user
does a query for col > 60000, it won't work ..
(2) int - can hold number range correctly, but this is 4 bytes. I
could end up with 2 rows which are unique according to the primary
key, but having the same value for the first 2 bytes. Could fix with
an additional table constraint, but I wonder if there is a neater
way..
Can anyone recommend the best method to do this ?
thanks,
NeilI don't think there's any simple way to do it. Int with a check constraint
to limit to numbers <= 65535 will solve it databasewise, but perhaps the
check constraint is not necessary if the middle-tier or GUI limits input to
2 bytes anyway?
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com|||On 3 Mar, 09:39, "Paul Ibison" <Paul.Ibi...@.Pygmalion.Com> wrote:
> I don't think there's any simple way to do it. Int with a check constraint
> to limit to numbers <= 65535 will solve it databasewise, but perhaps the
> check constraint is not necessary if the middle-tier or GUI limits input to
> 2 bytes anyway?
> Cheers,
> Paul Ibison SQL Server MVP,www.replicationanswers.com
OK, thanks for the answer. Yes, the GUI will validate user input.
I will go for the "int" option.