Showing posts with label create. Show all posts
Showing posts with label create. Show all posts

Wednesday, March 28, 2012

Installing, creating database, updating schema?

Hi there,

I have a database on my test machine that will need to be installed on users
machines. I would like to create the database with the given schema on the
users machine and also with some suitable default values in the tables. I
note that although I can script the schema so that re-creating the structure
of the database is simple on the users machine, I cannot script the contents
of the tables also (automatically). What I would like to do is take some
kind of "snapshot", save it as a script and then run this script in my
installer. Are there any tools available to do this?

Secondly and related to the above: if I subsequently make changes to the
database schema (adding or removing columns, altering, adding or removing
stored procedures etc.), how do I roll out those changes to a customer? Do
I need to hand code an "upgrade" script, or is there a tool that will
produce a "difference between" script I can run on the customers machine?

Thanks for any tips you can give me about this.

RobinRobin Tucker (idontwanttobespammedanymore@.reallyidont.com) writes:
> I have a database on my test machine that will need to be installed on
> users machines. I would like to create the database with the given
> schema on the users machine and also with some suitable default values
> in the tables. I note that although I can script the schema so that
> re-creating the structure of the database is simple on the users
> machine, I cannot script the contents of the tables also
> (automatically). What I would like to do is take some kind of
> "snapshot", save it as a script and then run this script in my
> installer. Are there any tools available to do this?

SQL Server MVP Vyas Kondreddi has a tool that generates INSERT statements
from a table: http://vyaskn.tripod.com/code.htm#inserts

> Secondly and related to the above: if I subsequently make changes to the
> database schema (adding or removing columns, altering, adding or
> removing stored procedures etc.), how do I roll out those changes to a
> customer? Do I need to hand code an "upgrade" script, or is there a
> tool that will produce a "difference between" script I can run on the
> customers machine?

There are several paths to take. Many people use a third-party tool that
compares two databases and then generates a script. Very popular is
SQL Compare from Red Gate. I have not used this tool myself, though.

A better approach in my opinion, is to have all code under source control.
In this case, your development database is not your master, but the
version-control system is. A basic version-control system will not
provide any update scripts for you, as a version-control system is a
general container for all sorts of code. What you do is that when you
ship, you set a label, and then you can later inquire the VCS for
changes since that label. There are plenty of VCS on the market. Very
popular among Microsoft customers is Visual SourceSafe which is part
of Visual Studio. VSS is not a very good for serious configuraton
management, but it's easy to get started with, and works perfectly OK for
smaller groups.

There are a couple of third-party tools that are specialized for doing
version control on SQL Server. Typically, they sit on top of SourceSafe
or some other generic VCS. Unfortunately, I don't recall any names right
now.

In our shop we use VSS, together with a toolset that includes tools for
loading stored procedures (with a lot of bells and whistles, like
automatic insert of SET NOCOUNT ON, WITH ENCRYPTION (on request),
automatic GRANT, a preprocessor). We also have a tool that builds
update scripts from the checkins in SourceSafe. The tool also maintains
its own tables in the target databases, so that we know in which state
each database is in. This toolset is available as freeware on
http://www.abaris.se/abaperls/. (I uploaded the latest version of it,
just the other day, by the way.)

Judging from your question, you may be best off with something like
SQL Compare in the short run. But if more people get involved with
your work, you should definitely consider to move to a version-
control system. There are a few things to keep in mind with updating
from a model database:

o A development may contain junk code and junk tables from tests and
experiments.
o A table change may be as simple as adding a nullable column, but it
can also be very complex if you are making a major restructiring. A
tool probably needs some help in this case.
o If you have preloaded data that you want to deploy, you need a tool
where you selectively can migrate data.

The way we handle pre-loaded data by the way, is to enter the data in
Excel books, and then we have a tool that generates INSERT files from
the the Excel files. The files does not contain any INSERT statements,
but calls to stored procedures which inserts or updates. The reason we
use Excel is that some of our files are quite complex. and we have
different settings for different customers.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Very interesting. Thanks for your comprehensive reply. I think I will need
to study this question at some length before deciding which approach to
take.

Robin

"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns9595F230624F5Yazorman@.127.0.0.1...
> Robin Tucker (idontwanttobespammedanymore@.reallyidont.com) writes:
>> I have a database on my test machine that will need to be installed on
>> users machines. I would like to create the database with the given
>> schema on the users machine and also with some suitable default values
>> in the tables. I note that although I can script the schema so that
>> re-creating the structure of the database is simple on the users
>> machine, I cannot script the contents of the tables also
>> (automatically). What I would like to do is take some kind of
>> "snapshot", save it as a script and then run this script in my
>> installer. Are there any tools available to do this?
> SQL Server MVP Vyas Kondreddi has a tool that generates INSERT statements
> from a table: http://vyaskn.tripod.com/code.htm#inserts
>> Secondly and related to the above: if I subsequently make changes to the
>> database schema (adding or removing columns, altering, adding or
>> removing stored procedures etc.), how do I roll out those changes to a
>> customer? Do I need to hand code an "upgrade" script, or is there a
>> tool that will produce a "difference between" script I can run on the
>> customers machine?
> There are several paths to take. Many people use a third-party tool that
> compares two databases and then generates a script. Very popular is
> SQL Compare from Red Gate. I have not used this tool myself, though.
> A better approach in my opinion, is to have all code under source control.
> In this case, your development database is not your master, but the
> version-control system is. A basic version-control system will not
> provide any update scripts for you, as a version-control system is a
> general container for all sorts of code. What you do is that when you
> ship, you set a label, and then you can later inquire the VCS for
> changes since that label. There are plenty of VCS on the market. Very
> popular among Microsoft customers is Visual SourceSafe which is part
> of Visual Studio. VSS is not a very good for serious configuraton
> management, but it's easy to get started with, and works perfectly OK for
> smaller groups.
> There are a couple of third-party tools that are specialized for doing
> version control on SQL Server. Typically, they sit on top of SourceSafe
> or some other generic VCS. Unfortunately, I don't recall any names right
> now.
> In our shop we use VSS, together with a toolset that includes tools for
> loading stored procedures (with a lot of bells and whistles, like
> automatic insert of SET NOCOUNT ON, WITH ENCRYPTION (on request),
> automatic GRANT, a preprocessor). We also have a tool that builds
> update scripts from the checkins in SourceSafe. The tool also maintains
> its own tables in the target databases, so that we know in which state
> each database is in. This toolset is available as freeware on
> http://www.abaris.se/abaperls/. (I uploaded the latest version of it,
> just the other day, by the way.)
> Judging from your question, you may be best off with something like
> SQL Compare in the short run. But if more people get involved with
> your work, you should definitely consider to move to a version-
> control system. There are a few things to keep in mind with updating
> from a model database:
> o A development may contain junk code and junk tables from tests and
> experiments.
> o A table change may be as simple as adding a nullable column, but it
> can also be very complex if you are making a major restructiring. A
> tool probably needs some help in this case.
> o If you have preloaded data that you want to deploy, you need a tool
> where you selectively can migrate data.
> The way we handle pre-loaded data by the way, is to enter the data in
> Excel books, and then we have a tool that generates INSERT files from
> the the Excel files. The files does not contain any INSERT statements,
> but calls to stored procedures which inserts or updates. The reason we
> use Excel is that some of our files are quite complex. and we have
> different settings for different customers.
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techin.../2000/books.asp|||I would recommend you have a look at Innovartis DB Ghost at
http://www.innovartis.co.uk/ It is designed specifically for your
requirement i.e. automated database change management, generation of
upgrade scripts, build verification, database synchronization,
deployment of changes, integration with version control system, handles
schema & data.

John McGrath
SQL Server DBA MCSE

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!sql

Monday, March 26, 2012

Installing sqlxml for a .NET app

Hi,
I have created a .NET client application that uses the managed SQLXML
components. I now need to create a installer for my app. I wnat to a void
having to run sqlxml.msi separatly. Is there an easy way to avoid this?
Is there a merge module I can use? if not what files ect. do I need to
include?
Thanks
Steven EvansWe only package SqlXml in msi's and there are no seperatate mergeable
installers.
"Steven Evans" <Steven Evans@.discussions.microsoft.com> wrote in message
news:348E0FD8-3158-4AD8-A577-EF7F4E872D06@.microsoft.com...
> Hi,
> I have created a .NET client application that uses the managed SQLXML
> components. I now need to create a installer for my app. I wnat to a
> void
> having to run sqlxml.msi separatly. Is there an easy way to avoid this?
> Is there a merge module I can use? if not what files ect. do I need to
> include?
> Thanks
> Steven Evans

Installing sqlxml for a .NET app

Hi,
I have created a .NET client application that uses the managed SQLXML
components. I now need to create a installer for my app. I wnat to a void
having to run sqlxml.msi separatly. Is there an easy way to avoid this?
Is there a merge module I can use? if not what files ect. do I need to
include?
Thanks
Steven Evans
We only package SqlXml in msi's and there are no seperatate mergeable
installers.
"Steven Evans" <Steven Evans@.discussions.microsoft.com> wrote in message
news:348E0FD8-3158-4AD8-A577-EF7F4E872D06@.microsoft.com...
> Hi,
> I have created a .NET client application that uses the managed SQLXML
> components. I now need to create a installer for my app. I wnat to a
> void
> having to run sqlxml.msi separatly. Is there an easy way to avoid this?
> Is there a merge module I can use? if not what files ect. do I need to
> include?
> Thanks
> Steven Evans
sql

Wednesday, March 21, 2012

Installing Sql Server and Visual Basic .NET

Browsing the Sql server installation cd I found that I need to create a
domain name. What will be the difference with WORKGROUP network? Do I need to
change from workgroup to domain name?> Browsing the Sql server installation cd I found that I need to create a
> domain name.
? Could you be more specific? Where did you "find" this?|||Urraca wrote:
> Browsing the Sql server installation cd I found that I need to create
> a domain name. What will be the difference with WORKGROUP network? Do
> I need to change from workgroup to domain name?
No. A workgroup is fine for SQL Server installation.
--
David Gugick
Imceda Software
www.imceda.com|||You may want to search for "Authentication Modes" in BOL for a
discussion of how authentication can be configured in SQL Server.
Joe Webb
SQL Server MVP
~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811
I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)
On Wed, 4 May 2005 09:10:10 -0700, Urraca
<chiriqui9844(removethis)@.msn.com> wrote:
>Browsing the Sql server installation cd I found that I need to create a
>domain name. What will be the difference with WORKGROUP network? Do I need to
>change from workgroup to domain name?

Installing Sql Server and Visual Basic .NET

Browsing the Sql server installation cd I found that I need to create a
domain name. What will be the difference with WORKGROUP network? Do I need to
change from workgroup to domain name?
> Browsing the Sql server installation cd I found that I need to create a
> domain name.
? Could you be more specific? Where did you "find" this?
|||Urraca wrote:
> Browsing the Sql server installation cd I found that I need to create
> a domain name. What will be the difference with WORKGROUP network? Do
> I need to change from workgroup to domain name?
No. A workgroup is fine for SQL Server installation.
David Gugick
Imceda Software
www.imceda.com
|||You may want to search for "Authentication Modes" in BOL for a
discussion of how authentication can be configured in SQL Server.
Joe Webb
SQL Server MVP
~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg...l/-/0972688811
I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)
On Wed, 4 May 2005 09:10:10 -0700, Urraca
<chiriqui9844(removethis)@.msn.com> wrote:

>Browsing the Sql server installation cd I found that I need to create a
>domain name. What will be the difference with WORKGROUP network? Do I need to
>change from workgroup to domain name?

Installing Sql Server and Visual Basic .NET

Browsing the Sql server installation cd I found that I need to create a
domain name. What will be the difference with WORKGROUP network? Do I need t
o
change from workgroup to domain name?> Browsing the Sql server installation cd I found that I need to create a
> domain name.
? Could you be more specific? Where did you "find" this?|||Urraca wrote:
> Browsing the Sql server installation cd I found that I need to create
> a domain name. What will be the difference with WORKGROUP network? Do
> I need to change from workgroup to domain name?
No. A workgroup is fine for SQL Server installation.
David Gugick
Imceda Software
www.imceda.com|||You may want to search for "Authentication Modes" in BOL for a
discussion of how authentication can be configured in SQL Server.
Joe Webb
SQL Server MVP
~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/t...il/-/0972688811
I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)
On Wed, 4 May 2005 09:10:10 -0700, Urraca
<chiriqui9844(removethis)@.msn.com> wrote:

>Browsing the Sql server installation cd I found that I need to create a
>domain name. What will be the difference with WORKGROUP network? Do I need
to
>change from workgroup to domain name?sql

Monday, March 19, 2012

Integrated Security in a Workgroup?

The A\ASPNET and B\ASPNET machine accounts are created by IIS (I think) --
at least I know that I did NOT create them. These are the accounts used by
IIS when executing ASP pages. Since these accounts are not created by me I
don't know the passwords -- and I can't just change them in XP because then
IIS will likely fail due to using the old password. Perhaps I can change
the default ASP account used by IIS on both machines -- then I can create
local accounts with the same username and password.
Thanks for the suggestion.
Bill
"Stephen Dybing [MSFT]" <stephd@.online.microsoft.com> wrote in message
news:uOFYrdRuDHA.3144@.tk2msftngp13.phx.gbl...
quote:

> I believe that you do this without specifying the A\ or B\.
> --
> Sincerely,
> Stephen Dybing
> This posting is provided "AS IS" with no warranties, and confers no

rights.
quote:

> Please reply to the newsgroups only, thanks.
> "Bill Cohagan" <bill@.teraXNOSPAMXquest.com> wrote in message
> news:#aPrRKOuDHA.4056@.TK2MSFTNGP11.phx.gbl...
> A\ASPNET
the[QUOTE]
> A
and[QUOTE]
> an
only.[QUOTE]
the[QUOTE]
> SQL
> rights.
>
Kevin
Thanks for the response. Please see my reply to dybing regarding
passwords being problematic.
Bill
"Kevin McDonnell [MSFT]" <kevmc@.online.microsoft.com> wrote in message
news:uN4DrXRuDHA.1360@.cpmsftngxa06.phx.gbl...
quote:

> See if you can make a Trusted Connection using SQL. If the passwords are
> the same, then this should work.
> Use ISQL.exe
> ISQL -SSQLServerNameHere -E -Q"select @.@.version"
> This should return the version of SQL 2000.
> If this works then, we know the security is working, it may be a
> configuration issue with ASP.NET.
>
> Thanks,
> Kevin McDonnell
> Microsoft Corporation
> This posting is provided AS IS with no warranties, and confers no rights.
>
>
|||No, sorry, what I meant was that when you set up the SQL Server permissions,
try it without including the A\ or B\.
Sincerely,
Stephen Dybing
This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to the newsgroups only, thanks.
"Bill Cohagan" <bill@.teraXNOSPAMXquest.com> wrote in message
news:utxj$XduDHA.1596@.TK2MSFTNGP10.phx.gbl...
quote:

> The A\ASPNET and B\ASPNET machine accounts are created by IIS (I think) --
> at least I know that I did NOT create them. These are the accounts used by
> IIS when executing ASP pages. Since these accounts are not created by me I
> don't know the passwords -- and I can't just change them in XP because

then
quote:

> IIS will likely fail due to using the old password. Perhaps I can change
> the default ASP account used by IIS on both machines -- then I can create
> local accounts with the same username and password.
> Thanks for the suggestion.
> Bill
> "Stephen Dybing [MSFT]" <stephd@.online.microsoft.com> wrote in message
> news:uOFYrdRuDHA.3144@.tk2msftngp13.phx.gbl...
> rights.
> the
> and
> only.
> the
the[QUOTE]
>
|||Since I'm using integrated security I must select an existing NT user; thus
I can't specify a user, ASPNET (or whatever), unless that user exists as a
local user on the machine. I can of course create such a user, but then I've
got the password problem I already mentioned. Have I misunderstood your
suggestion?
Bill
"Stephen Dybing [MSFT]" <stephd@.online.microsoft.com> wrote in message
news:%23nPgnyduDHA.2148@.TK2MSFTNGP12.phx.gbl...
quote:

> No, sorry, what I meant was that when you set up the SQL Server

permissions,
quote:

> try it without including the A\ or B\.
> --
> Sincerely,
> Stephen Dybing
> This posting is provided "AS IS" with no warranties, and confers no

rights.
quote:

> Please reply to the newsgroups only, thanks.
> "Bill Cohagan" <bill@.teraXNOSPAMXquest.com> wrote in message
> news:utxj$XduDHA.1596@.TK2MSFTNGP10.phx.gbl...
think) --[QUOTE]
by[QUOTE]
I[QUOTE]
> then
change[QUOTE]
create[QUOTE]
that[QUOTE]
B[QUOTE]
message[QUOTE]
duplicate[QUOTE]
> the
>
|||Hmm, I had assumed, like Kevin mentioned earlier, that if you used those
workgroup users, where the only thing that changed was the name of the
workgroup, it would work. I've done similar sorts of things with accounts
crossing different domains before and figured this would work as well. If
not, then your problem is beyond what I can help with off the top of my
head, and I don't have workgroup machines here that I can test on. Sorry!
Sincerely,
Stephen Dybing
This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to the newsgroups only, thanks.
"Bill Cohagan" <bill@.teraXNOSPAMXquest.com> wrote in message
news:eXwPQHeuDHA.1888@.TK2MSFTNGP10.phx.gbl...
quote:

> Since I'm using integrated security I must select an existing NT user;

thus
quote:

> I can't specify a user, ASPNET (or whatever), unless that user exists as a
> local user on the machine. I can of course create such a user, but then

I've
quote:

> got the password problem I already mentioned. Have I misunderstood your
> suggestion?
> Bill
> "Stephen Dybing [MSFT]" <stephd@.online.microsoft.com> wrote in message
> news:%23nPgnyduDHA.2148@.TK2MSFTNGP12.phx.gbl...
> permissions,
> rights.
> think) --
used[QUOTE]
> by
me[QUOTE]
> I
> change
> create
> that
machine[QUOTE]
> B
purposes[QUOTE]
> message
> duplicate
on[QUOTE]
no[QUOTE]
>
|||Please let me know if you're still having a problem with this and I'll
request a couple of workgroup machines from our lab this week and try it
myself. You can reach me directly by removing the "online." from my posting
address.
Sincerely,
Stephen Dybing
This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to the newsgroups only, thanks.
"Bill Cohagan" <bill@.teraXNOSPAMXquest.com> wrote in message
news:eXwPQHeuDHA.1888@.TK2MSFTNGP10.phx.gbl...
quote:

> Since I'm using integrated security I must select an existing NT user;

thus
quote:

> I can't specify a user, ASPNET (or whatever), unless that user exists as a
> local user on the machine. I can of course create such a user, but then

I've
quote:

> got the password problem I already mentioned. Have I misunderstood your
> suggestion?
> Bill
> "Stephen Dybing [MSFT]" <stephd@.online.microsoft.com> wrote in message
> news:%23nPgnyduDHA.2148@.TK2MSFTNGP12.phx.gbl...
> permissions,
> rights.
> think) --
used[QUOTE]
> by
me[QUOTE]
> I
> change
> create
> that
machine[QUOTE]
> B
purposes[QUOTE]
> message
> duplicate
on[QUOTE]
no[QUOTE]
>
|||OK, I think I've got it working. I discovered (via KB #315158) how to
set the account and password used by IIS via attributes in the
processModel element of the machine.config file. All I needed to do was
1.) Reset the password of the <machine>\ASPNET account to a common value
on both machines.
2.) Edit the machine.config file on both machines to reflect the new
common password.
I'd already added the ASPNET account as a login on the SQL server. Since
now the A\ASPNET and B\ASPNET have common login names AND passwords I
can apparently access the SQL server on machine B via the A\ASPNET
account on machine A. This solves my problem.
Bill
"Bill Cohagan" <bill@.teraXNOSPAMXquest.com> wrote in message
news:eXwPQHeuDHA.1888@.TK2MSFTNGP10.phx.gbl...
quote:

> Since I'm using integrated security I must select an existing NT user;

thus
quote:

> I can't specify a user, ASPNET (or whatever), unless that user exists as a
> local user on the machine. I can of course create such a user, but then

I've
quote:

> got the password problem I already mentioned. Have I misunderstood your
> suggestion?
> Bill
> "Stephen Dybing [MSFT]" <stephd@.online.microsoft.com> wrote in message
> news:%23nPgnyduDHA.2148@.TK2MSFTNGP12.phx.gbl...
> permissions,
> rights.
> think) --
used[QUOTE]
> by
me[QUOTE]
> I
> change
> create
> that
machine[QUOTE]
> B
purposes[QUOTE]
> message
> duplicate
on[QUOTE]
no[QUOTE]
>

Monday, March 12, 2012

integrate report manager in an asp.net application

I thought I can probably find out how the report manager works and create a similar application so that I can define my own things in there.

Looks like there is no sample where I could get a lead. Now I have decided if I can include the report manager in a new aspx page in my application and disable the stuff which is not required by the user to look at it.

I can definitely include the report manager url in the Iframe but how do I disable the stuff from the report manager.

Please help, I am having real hard time.

Thanks in advance.

There is no way that I know of to customize report manager and include its functionality in your own app like you would a control.

Have you looked at the report viewer web control? If you need to integrate report viewing and report export capability in your asp.net application, it is very powerful. You could use this, along with the available Web services in reporting services to build your own version of the report manager in asp.net with most, if not all of the same functionality.

A link to the report viewer control:

http://msdn2.microsoft.com/en-us/library/ms251671(VS.80).aspx

A link to the web services provided by report server:

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

integrate report manager in an asp.net application

I thought I can probably find out how the report manager works and create a similar application so that I can define my own things in there.

Looks like there is no sample where I could get a lead. Now I have decided if I can include the report manager in a new aspx page in my application and disable the stuff which is not required by the user to look at it.

I can definitely include the report manager url in the Iframe but how do I disable the stuff from the report manager.

Please help, I am having real hard time.

Thanks in advance.

There is no way that I know of to customize report manager and include its functionality in your own app like you would a control.

Have you looked at the report viewer web control? If you need to integrate report viewing and report export capability in your asp.net application, it is very powerful. You could use this, along with the available Web services in reporting services to build your own version of the report manager in asp.net with most, if not all of the same functionality.

A link to the report viewer control:

http://msdn2.microsoft.com/en-us/library/ms251671(VS.80).aspx

A link to the web services provided by report server:

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

Integrate changes into MSDE Database?

I have a module that requires modifcation to the database. How do I adopt the following instructuions for use with MSDE?

1. Create a MSSQL structure.
2. Open a query anylizer and copy the CreateDB.SQL file. Run it.

Thanks,
ScottYou should be able to use the osql.exe utility. To run the CreateDB.SQL file, you can go to the Windows command prompt, go to the directory containing the .SQL file, and issue a command such as:


osql -E -i CreateDB.SQL

Terri|||Thanks for responding Terri.

I have created a seperate MSDE for each on the Starter Kits I'm tinkering with. When I run CreateDB, do I need to specify which MSDE?

Scott

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.

Friday, February 24, 2012

Installing SQL Express - XP Home

Hi,

We're creating an installer package for SQL Express 2005 and I'm using the built-in setup project in VS 2005 to create my MSI.

Everything appears to be working well, excpet that on Windows XP Home the SQL Express package is exiting with an error code 70002. I've googled for several days now and simply can't find any help on the 70002 exit code. Can anyone help ?

The command line arguments (I've split them onto seperate lines for clarity) we're passing to "sqlexpr32.exe" are : -

/qn

INSTANCENAME=OurInstance

SAPWD="OurPassword"

ADDLOCAL=SQL_Engine,SQL_Data_Files,Client_Components,Connectivity

SQLBROWSERAUTOSTART=1

SQLACCOUNT="NT AUTHORITY\SYSTEM"

SQLBROWSERACCOUNT="NT AUTHORITY\SYSTEM"

AGTACCOUNT="NT AUTHORITY\SYSTEM"

ASACCOUNT="NT AUTHORITY\SYSTEM"

RSACCOUNT="NT AUTHORITY\SYSTEM"

SECURITYMODE=SQL

DISABLENETWORKPROTOCOLS=0

SQLAUTOSTART=1

Are you getting an error in the logs? Can you search your log folder for the text string "value 3" and post the 10 or so lines above it? This should give a more helpful message.

Thanks,
Sam Lester (MSFT)