Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Thursday, March 29, 2012

Advice on security model for XML Web Services for many users in Active Directory role

I am working on the security model for an application that will be used by 100s of users with a dedicated SQL 2005 database for this application and access via SQL XML Web Services.

The client has asked to make it "open" during alpha testing such that anyone can access the web services without having to set them up first. Is there a way to do this? The best I can figure is to use mixed mode security and hard code a login and password. Any method using Windows authentication would require that I add every user at a minimum to the database.

In production, all users will have an active directory role specified that determines if they should have access to the web services or not. However, it is my understanding that to use Windows authentication, I would still need to add each individual user at a minimum as a Login to the SQL Server, and under best practices also as database users with permissions granted to the endpoint.

Am I correct in the above, or is there a more efficient way to achieve these results?

Thanks

-L

Your post seems to have been moved to this forum, as I have not seen it before. Could you please let me know where you posted this originally?

If the individual users are all belonging to a Windows group, you could just grant connection permissions to that group. But I am not familiar with XML Web Services, so I cannot say whether this is the best course of action.

Have you checked the following link?

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

I'd suggest to also post in the XML forum: SQL Server XML

Thanks
Laurentiu

sql

Tuesday, March 27, 2012

Advice on Data Warehouse & Web Reporting

I'm about to embark on re-writing a database & bespoke web reporting
application for our call centre & would like a little advice please.
Currently the database has 10 tables containing summaried (<=1 record
per staff member per day) data from different legacy systems,
populated by DTS. There is an 11th table that has staff data in which
is used to link the others together as many have different primary
keys. After the data has been linked together an aggregated table (1
record per person per day) is created once a day.
Currently our intranet site is configured to run a number of stored
procedures that return KPI data from the aggregated table into
datasets which are then rendered in the form of datagrids. Users are
either allowed to specify the parameters for these stored procedures
or they are pre-determined for them depending on who they are (eg
agents in the call centre all see a MTD report for themselves only).
The aim of the re-write is to
(a) cut down on admin when KPI definitions change
(b) make the setup much more generic so that it could be transported
to other areas of the business or even to different companies with
minimum rework
(c) upgrade from SQL 2000 to SQL 2005
(d) tidy the webpages a little & maybe add some gauge type controls
I'm unsure about 2 things -
(1) Should I totally re-design things & use Analysis Services instead
or would I find no benefit as everyone is only given one view of the
truth (ie no slicing & dicing depending upon preference)? I know very
little about this service so it would be a challenge & from what I've
read I'm not so sure whether it would be appropriate for all of the
staff querying the database constantly anyway(there are over 500 of
them & currently the stored procedures use nested temp tables to
calculate everything that needs to be shown on the webpages). I guess
that I couldn't fill a datagrid with their data using this method
either but I'm sure that someone will be able to keep me right.
(2) Should I dump the datagrids in favour of Reporting Services? This
was originally not used as our IT department could get it installed
properly on the SQL 2000 server & the datagrid solution was found to
be both adequate & easy to setup. We have Crystal Reports in the
company also but licence costs are likely to be a problem.
Hope I haven't upset anyone by crossposting the question - I'm just
after a balanced view before I start work & the queries fit with a few
different ng's.
TIA
SteveI think that AS is more important; more critical-- than RS.
there are other tools like RS on the market.
but AS leads the market by a wide margin.
Does that mean it's EASY? no. Does it mean it's SIMPLE? no.
I would reccomend taking a month off of work; immersing yourself in
SSAS and coming back to work to scrap all your existing DB work.
10 million relational developers CAN be wrong and they are.
It's better to build a solution for non technical people-- SSAS is best
utilized using OWC - Office Web Components- and non-technical people...
All of your relational mess just sounds overly complicated.
-Aaron
C4rtm4N wrote:
> I'm about to embark on re-writing a database & bespoke web reporting
> application for our call centre & would like a little advice please.
> Currently the database has 10 tables containing summaried (<=1 record
> per staff member per day) data from different legacy systems,
> populated by DTS. There is an 11th table that has staff data in which
> is used to link the others together as many have different primary
> keys. After the data has been linked together an aggregated table (1
> record per person per day) is created once a day.
> Currently our intranet site is configured to run a number of stored
> procedures that return KPI data from the aggregated table into
> datasets which are then rendered in the form of datagrids. Users are
> either allowed to specify the parameters for these stored procedures
> or they are pre-determined for them depending on who they are (eg
> agents in the call centre all see a MTD report for themselves only).
> The aim of the re-write is to
> (a) cut down on admin when KPI definitions change
> (b) make the setup much more generic so that it could be transported
> to other areas of the business or even to different companies with
> minimum rework
> (c) upgrade from SQL 2000 to SQL 2005
> (d) tidy the webpages a little & maybe add some gauge type controls
> I'm unsure about 2 things -
> (1) Should I totally re-design things & use Analysis Services instead
> or would I find no benefit as everyone is only given one view of the
> truth (ie no slicing & dicing depending upon preference)? I know very
> little about this service so it would be a challenge & from what I've
> read I'm not so sure whether it would be appropriate for all of the
> staff querying the database constantly anyway(there are over 500 of
> them & currently the stored procedures use nested temp tables to
> calculate everything that needs to be shown on the webpages). I guess
> that I couldn't fill a datagrid with their data using this method
> either but I'm sure that someone will be able to keep me right.
> (2) Should I dump the datagrids in favour of Reporting Services? This
> was originally not used as our IT department could get it installed
> properly on the SQL 2000 server & the datagrid solution was found to
> be both adequate & easy to setup. We have Crystal Reports in the
> company also but licence costs are likely to be a problem.
> Hope I haven't upset anyone by crossposting the question - I'm just
> after a balanced view before I start work & the queries fit with a few
> different ng's.
> TIA
> Steve

Advice on Data Warehouse & Web Reporting

I'm about to embark on re-writing a database & bespoke web reporting
application for our call centre & would like a little advice please.
Currently the database has 10 tables containing summaried (<=1 record
per staff member per day) data from different legacy systems,
populated by DTS. There is an 11th table that has staff data in which
is used to link the others together as many have different primary
keys. After the data has been linked together an aggregated table (1
record per person per day) is created once a day.
Currently our intranet site is configured to run a number of stored
procedures that return KPI data from the aggregated table into
datasets which are then rendered in the form of datagrids. Users are
either allowed to specify the parameters for these stored procedures
or they are pre-determined for them depending on who they are (eg
agents in the call centre all see a MTD report for themselves only).
The aim of the re-write is to
(a) cut down on admin when KPI definitions change
(b) make the setup much more generic so that it could be transported
to other areas of the business or even to different companies with
minimum rework
(c) upgrade from SQL 2000 to SQL 2005
(d) tidy the webpages a little & maybe add some gauge type controls
I'm unsure about 2 things -
(1) Should I totally re-design things & use Analysis Services instead
or would I find no benefit as everyone is only given one view of the
truth (ie no slicing & dicing depending upon preference)? I know very
little about this service so it would be a challenge & from what I've
read I'm not so sure whether it would be appropriate for all of the
staff querying the database constantly anyway(there are over 500 of
them & currently the stored procedures use nested temp tables to
calculate everything that needs to be shown on the webpages). I guess
that I couldn't fill a datagrid with their data using this method
either but I'm sure that someone will be able to keep me right.
(2) Should I dump the datagrids in favour of Reporting Services? This
was originally not used as our IT department could get it installed
properly on the SQL 2000 server & the datagrid solution was found to
be both adequate & easy to setup. We have Crystal Reports in the
company also but licence costs are likely to be a problem.
Hope I haven't upset anyone by crossposting the question - I'm just
after a balanced view before I start work & the queries fit with a few
different ng's.
TIA
Steve
I think that AS is more important; more critical-- than RS.
there are other tools like RS on the market.
but AS leads the market by a wide margin.
Does that mean it's EASY? no. Does it mean it's SIMPLE? no.
I would reccomend taking a month off of work; immersing yourself in
SSAS and coming back to work to scrap all your existing DB work.
10 million relational developers CAN be wrong and they are.
It's better to build a solution for non technical people-- SSAS is best
utilized using OWC - Office Web Components- and non-technical people...
All of your relational mess just sounds overly complicated.
-Aaron
C4rtm4N wrote:
> I'm about to embark on re-writing a database & bespoke web reporting
> application for our call centre & would like a little advice please.
> Currently the database has 10 tables containing summaried (<=1 record
> per staff member per day) data from different legacy systems,
> populated by DTS. There is an 11th table that has staff data in which
> is used to link the others together as many have different primary
> keys. After the data has been linked together an aggregated table (1
> record per person per day) is created once a day.
> Currently our intranet site is configured to run a number of stored
> procedures that return KPI data from the aggregated table into
> datasets which are then rendered in the form of datagrids. Users are
> either allowed to specify the parameters for these stored procedures
> or they are pre-determined for them depending on who they are (eg
> agents in the call centre all see a MTD report for themselves only).
> The aim of the re-write is to
> (a) cut down on admin when KPI definitions change
> (b) make the setup much more generic so that it could be transported
> to other areas of the business or even to different companies with
> minimum rework
> (c) upgrade from SQL 2000 to SQL 2005
> (d) tidy the webpages a little & maybe add some gauge type controls
> I'm unsure about 2 things -
> (1) Should I totally re-design things & use Analysis Services instead
> or would I find no benefit as everyone is only given one view of the
> truth (ie no slicing & dicing depending upon preference)? I know very
> little about this service so it would be a challenge & from what I've
> read I'm not so sure whether it would be appropriate for all of the
> staff querying the database constantly anyway(there are over 500 of
> them & currently the stored procedures use nested temp tables to
> calculate everything that needs to be shown on the webpages). I guess
> that I couldn't fill a datagrid with their data using this method
> either but I'm sure that someone will be able to keep me right.
> (2) Should I dump the datagrids in favour of Reporting Services? This
> was originally not used as our IT department could get it installed
> properly on the SQL 2000 server & the datagrid solution was found to
> be both adequate & easy to setup. We have Crystal Reports in the
> company also but licence costs are likely to be a problem.
> Hope I haven't upset anyone by crossposting the question - I'm just
> after a balanced view before I start work & the queries fit with a few
> different ng's.
> TIA
> Steve

Advice on Data Warehouse & Web Reporting

I'm about to embark on re-writing a database & bespoke web reporting
application for our call centre & would like a little advice please.
Currently the database has 10 tables containing summaried (<=1 record
per staff member per day) data from different legacy systems,
populated by DTS. There is an 11th table that has staff data in which
is used to link the others together as many have different primary
keys. After the data has been linked together an aggregated table (1
record per person per day) is created once a day.
Currently our intranet site is configured to run a number of stored
procedures that return KPI data from the aggregated table into
datasets which are then rendered in the form of datagrids. Users are
either allowed to specify the parameters for these stored procedures
or they are pre-determined for them depending on who they are (eg
agents in the call centre all see a MTD report for themselves only).
The aim of the re-write is to
(a) cut down on admin when KPI definitions change
(b) make the setup much more generic so that it could be transported
to other areas of the business or even to different companies with
minimum rework
(c) upgrade from SQL 2000 to SQL 2005
(d) tidy the webpages a little & maybe add some gauge type controls
I'm unsure about 2 things -
(1) Should I totally re-design things & use Analysis Services instead
or would I find no benefit as everyone is only given one view of the
truth (ie no slicing & dicing depending upon preference)? I know very
little about this service so it would be a challenge & from what I've
read I'm not so sure whether it would be appropriate for all of the
staff querying the database constantly anyway(there are over 500 of
them & currently the stored procedures use nested temp tables to
calculate everything that needs to be shown on the webpages). I guess
that I couldn't fill a datagrid with their data using this method
either but I'm sure that someone will be able to keep me right.
(2) Should I dump the datagrids in favour of Reporting Services? This
was originally not used as our IT department could get it installed
properly on the SQL 2000 server & the datagrid solution was found to
be both adequate & easy to setup. We have Crystal Reports in the
company also but licence costs are likely to be a problem.
Hope I haven't upset anyone by crossposting the question - I'm just
after a balanced view before I start work & the queries fit with a few
different ng's.
TIA
SteveI think that AS is more important; more critical-- than RS.
there are other tools like RS on the market.
but AS leads the market by a wide margin.
Does that mean it's EASY? no. Does it mean it's SIMPLE? no.
I would reccomend taking a month off of work; immersing yourself in
SSAS and coming back to work to scrap all your existing DB work.
10 million relational developers CAN be wrong and they are.
It's better to build a solution for non technical people-- SSAS is best
utilized using OWC - Office Web Components- and non-technical people...
All of your relational mess just sounds overly complicated.
-Aaron
C4rtm4N wrote:
> I'm about to embark on re-writing a database & bespoke web reporting
> application for our call centre & would like a little advice please.
> Currently the database has 10 tables containing summaried (<=1 record
> per staff member per day) data from different legacy systems,
> populated by DTS. There is an 11th table that has staff data in which
> is used to link the others together as many have different primary
> keys. After the data has been linked together an aggregated table (1
> record per person per day) is created once a day.
> Currently our intranet site is configured to run a number of stored
> procedures that return KPI data from the aggregated table into
> datasets which are then rendered in the form of datagrids. Users are
> either allowed to specify the parameters for these stored procedures
> or they are pre-determined for them depending on who they are (eg
> agents in the call centre all see a MTD report for themselves only).
> The aim of the re-write is to
> (a) cut down on admin when KPI definitions change
> (b) make the setup much more generic so that it could be transported
> to other areas of the business or even to different companies with
> minimum rework
> (c) upgrade from SQL 2000 to SQL 2005
> (d) tidy the webpages a little & maybe add some gauge type controls
> I'm unsure about 2 things -
> (1) Should I totally re-design things & use Analysis Services instead
> or would I find no benefit as everyone is only given one view of the
> truth (ie no slicing & dicing depending upon preference)? I know very
> little about this service so it would be a challenge & from what I've
> read I'm not so sure whether it would be appropriate for all of the
> staff querying the database constantly anyway(there are over 500 of
> them & currently the stored procedures use nested temp tables to
> calculate everything that needs to be shown on the webpages). I guess
> that I couldn't fill a datagrid with their data using this method
> either but I'm sure that someone will be able to keep me right.
> (2) Should I dump the datagrids in favour of Reporting Services? This
> was originally not used as our IT department could get it installed
> properly on the SQL 2000 server & the datagrid solution was found to
> be both adequate & easy to setup. We have Crystal Reports in the
> company also but licence costs are likely to be a problem.
> Hope I haven't upset anyone by crossposting the question - I'm just
> after a balanced view before I start work & the queries fit with a few
> different ng's.
> TIA
> Steve

advice normalization

I have a web app which is used to do normal insert/update of employee info. Connected to each employee that is entered is some data that is imported from an outside source for each employee. The question I have is currently my database is very normalized and importing data from this outside source will be quite a pain because of this. Is it bad practice to denormalize a specific table if no user will every insert/update it beside DTS?

Why do you feel that normalization will make data importation more difficult?
Normalization should make the process somewhat easier -- it helpsguarantee data integrity, so you won't have to put excessive amounts ofvalidation code into your importation routines. I would notrecommend denormalizing to make this process "easier". Dataintegrity is the most important factor, and is the reason we usedatabases instead of flat file systems!
Can you post some more information about your schema and the data you're trying to import?

|||No Denormalization is used in OLPT(online transaction processing) to improve performance. Run a search for Composite index in SQL Server BOL(books online). A Composite index can take 16 Columns with a size limit of 900 bytes. Hope this helps.|||No. OLTP databases should NEVER be denormalized when dataintegrity is important! Use of denormalization for performanceshould be limited to OLAP and reporting scenarios in which the data canbe re-built from a trusted source. I would never riskdenormalizing a transactional database for the sake ofperformance. Even the best performance will be utterly useless iftransactions are lost due to data integrity issues.
I'm unsure of what a composite index has to do with this topic, but thanks for throwing it out there.

|||OLTP(online transaction processing) is the general term for none analytical use of the database. Denormalization in SQL Server 2000 and below can be achieved through a Composite Index. A Composite index is a way of life in SQL Server 7.0 and below without built in DRI(declarative referential integrity) And the table in question is being used by a process not people so the access can be scheduled.|||I'm not sure how you've arrived at the conclusion that creating acomposite index is akin to denormalizing a table. Given thatindexes are physical, not logical parts of the schema, they are notconsidered in discussions of normalization. I'd recommend thatyou readthis, and other articles on the Database Debunkings website to dispell that notion.
But even if that were the case, it would not apply to thissituation. The OP is concerned that data importation is going tobe difficult due to the normalization of the database. But as Iassume you're aware, DML operations cannot be performed onindexes. Only on tables (and indirectly on tables via views andUDFs). Furthermore, large composite indexes will slow downimportation -- not speed it up. Therefore, creating large indexeswill serve to hinder -- not help -- the OP's importation efforts.

|||

AdamMachanic wrote:

I'm not sure how you've arrived at the conclusion that creating a composite index is akin to denormalizing a table. Given that indexes are physical, not logical parts of the schema, they are not considered in discussions of normalization.



Indexes are not considered because indexes are from vendors and Normalization is ANSI SQL but there are so many vendor implementations that makes the database better. In SQL Server 2005 it is taken to the next level with index column include. Try the link below for index covering used by Microsoft consulting and is considered good practice by the industry. While you are at it check the appendix of the book below to see why E.F.Code called it normalization. If it is not in the PPT online it became Normalization because Nixon have normalized relationship with China.

http://www.sql-server-performance.com/covering_indexes.asp

http://wings.buffalo.edu/mgmt/courses/mgtsand/data.html

|||It doesn't matter if something is a vendor extension or defined by theANSI Standard -- SQL and the ANSI Standard have absolutely nothing todo with normalization. As a matter of fact, I just searched thecomplete text of the SQL-99 standard and a form of the word 'normalize'appears only once -- in reference to normalization of datetimedatatypes!
What the Relational Model is concerned with is the distinction betweenthe logical and the physical. Tables are logical -- and thereforesubject to the rules of logical normalization. Indexes arephysical -- they have no bearing upon the logical schema.

|||I have ANSI 2003 and the person will take what meets their existing needs.|||

Caddre wrote:

I have ANSI 2003 and the person will take what meets their existing needs.


Where is normalization defined in the SQL 2003 standard?

|||We will not be having this conversion if you have used SQL Server 6.5 and below when SQL Server and Normalization are not in one sentence. What is Normalization when queries are taking hours to complete.|||What difficulties did you have with normalization in SQL Server 6.5?

Advice Needed: Where to put ADO Code

I need some advice on a project that I am working on...

First, here is what I am trying to achieve: A Web Form with two controls: A DropDownList with two items added at design time (Fruits and Vegetables) and an empty ListBox. When the user chooses a "category" from the DropDownList, the ListBox will be populated with a list of either "Fruits" or "Vegetables" retrieved from a SQL database. (Note: Since the data in the SQL database must be converted and formatted programatically, simply databinding the ListBox will not work here.)

I believe that I can do this with the following code (stolen from an MSDN article):

'Create ADO.NET objects.Private myConnAs SqlConnectionPrivate myCmdAs SqlCommandPrivate myReaderAs SqlDataReaderPrivate resultsAs String'Create a Connection object. myConn =New SqlConnection("Initial Catalog=Northwind;" & _"Data Source=localhost;Integrated Security=SSPI;")'Create a Command object. myCmd = myConn.CreateCommand myCmd.CommandText ="SELECT FirstName, LastName FROM Employees"'Open the connection. myConn.Open() myReader = myCmd.ExecuteReader()'Concatenate the query result into a string.Do While myReader.Read() results = results & myReader.GetString(0) & vbTab & _ myReader.GetString(1) & vbLfLoop'Display results. MsgBox(results)'Close the reader and the database connection. myReader.Close() myConn.Close()

Now here is the part that I am not sure about: Is the FormLoad event the best place to put this code? If I do, is this not a lot of overhead (creating, opening and closing a connection) everytime there is a page refresh/PostBack? Would I be better off putting this code in the DropDownList SelectedIndexChanged event? Although that seems like it could make the process of selecting a category take a fairly long time.

Finally, if the is a better way of doing this, I am certainly open to suggestions.

All advice is greatly appreciated.

hello,

you may like to read "ASP.Net Tutorial - If Not Page.IsPostBack" article at,

http://aspnet101.com/aspnet101/tutorials.aspx?id=3

ALSO,

i'd like to suggest you to read this too,

1) "Examining the Data Access Application Block" at,

http://aspnet.4guysfromrolla.com/articles/070203-1.aspx

2) "Working with the Enterprise Library's Data Access Application Block" at ,

http://aspnet.4guysfromrolla.com/articles/030905-1.aspx

regards,

Niraj sikotara.

Advice Needed on Large Scale DataBases

We are in the process of developing a web indexing project similar to
http://www.grub.org/ . We will have a database that is going to contain
about 5 billion records. Currently I am split between MS SQL and My SQL for
this project. Some of the issues we are going to have is storage size. Based
on our math, our data base will be about 100 GB in size, is there a file
size limit with MS SQL (I heard some where there is a 2GB limit or was that
2 TB limit). A better design is a split data base but for now we would like
to use a single db.
Jay
Good luck with MySQL and 5 billion rows<g>. SQL Server does not have a
limit that you suggested except in it's free version (MSDE). THere are many
SQL Servers out there with 2TB or more of data. Even though 100GB is not
that large these days for SQL Server I can't stress enough that you do your
homework first and ensure you have a properly designed db schema and
application.
Andrew J. Kelly SQL MVP
"Jay Janarthanan" <jay@.objectcube.com> wrote in message
news:e8N7AKl2EHA.1452@.TK2MSFTNGP11.phx.gbl...
> We are in the process of developing a web indexing project similar to
> http://www.grub.org/ . We will have a database that is going to contain
> about 5 billion records. Currently I am split between MS SQL and My SQL
> for this project. Some of the issues we are going to have is storage size.
> Based on our math, our data base will be about 100 GB in size, is there a
> file size limit with MS SQL (I heard some where there is a 2GB limit or
> was that 2 TB limit). A better design is a split data base but for now we
> would like to use a single db.
> Jay
>
|||Thanks Andrew. There is only one Table that is going to contain the 5B rows,
the rest of the tables are small in size.
I am more concerned about the HW requirements.
Jay
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:OwmvZXl2EHA.924@.TK2MSFTNGP14.phx.gbl...
> Good luck with MySQL and 5 billion rows<g>. SQL Server does not have a
> limit that you suggested except in it's free version (MSDE). THere are
> many SQL Servers out there with 2TB or more of data. Even though 100GB is
> not that large these days for SQL Server I can't stress enough that you do
> your homework first and ensure you have a properly designed db schema and
> application.
> --
> Andrew J. Kelly SQL MVP
>
> "Jay Janarthanan" <jay@.objectcube.com> wrote in message
> news:e8N7AKl2EHA.1452@.TK2MSFTNGP11.phx.gbl...
>
|||Jay Janarthanan wrote:[vbcol=seagreen]
> Thanks Andrew. There is only one Table that is going to contain the
> 5B rows, the rest of the tables are small in size.
> I am more concerned about the HW requirements.
> Jay
>
>
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
> news:OwmvZXl2EHA.924@.TK2MSFTNGP14.phx.gbl...
Hardware is easy. Lots of CPU, lots of fast drives, and lots of
memory...
If you put that large table on its own RAID 10 array if it gets writtent
to a lot, or a fast RAID 5 array if it is mostly read-only (batches at
night and small updates during the day are fine), you shold be ok. Use a
lot of drives in the array for best performance and put that array on
its own channel.
Regarding the hardware, you'll need to do some homework about the size
of the table and how frequently it gets accessed to determine if you'll
need the improved memory allowance of SQL Server 2000 EE. If you mostly
accessing single rows and have the necessary indexing in place, you may
find that memory is not a big concern and a fast 2-cpu system may
suffice. 100BG is not that large for SQL Server as Andrew mentioned. But
given that large table table, you probably want to make sure it's
isolated from the other data on its own drive subsystem. Drive are
cheap, though. You could throw 10 fast drives in a RAID 5 array for a
couple thousand and then use that array for backing up if the database
was idle at night. RAID 10 (1+0) is a little more expensive in terms of
drives, but has the best write and read performance. RAID 5 is the worst
for writing, but fast at reading, and the cheapest redundant solution.
David Gugick
Imceda Software
www.imceda.com
|||"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:OwmvZXl2EHA.924@.TK2MSFTNGP14.phx.gbl...
> Good luck with MySQL and 5 billion rows<g>.
Well, to fair, the largest MySQL db I've heard of has 10 billion rows...

>
|||You will want to isolate that table and its non-clustered indexes across as
many physical disk spindles as possible. Also, consider creating two
seperate File Groups, one for the Clustered Index and one for the
non-clustered indexes. In each File Group, create as many physical files as
you have CPUs and independent disks. If you have enough disk counts, keep
the files from the Clustered Index seperated from the files of the
non-clustered indexes, but certainly use multiple files per file group, even
if you are limited by number of physical disks.
Also, create at least 2 log files of equal size and absolutely place these
on dedicated disks.
As far as capacity is concerned, the database size must be not be greater
than 1,048,515 TB, number of File Groups must not exceed 256 per database,
files per databse 32,767, data and log file sizes can not be larger than 32
TB each.
I do not think you will have a size problem; however, the row count will be
sufficient enough to warrant thoughtful database design, file layout, and
indexing strategy. You will also need to consider an appropriate Candidate
Key for the Cluster Index, absolutely DO NOT SET any surrogate Primary Key
as the clustered index, as is the default. This is usually the worst
possible candidate only superseded by not having a clustered index defined
at all.
The 2 GB limitation is for MSDE only.
Sincerely,
Anthony Thomas

"Greg D. Moore (Strider)" <mooregr_deleteth1s@.greenms.com> wrote in message
news:2aQsd.37569$1u.35532@.twister.nyroc.rr.com...
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:OwmvZXl2EHA.924@.TK2MSFTNGP14.phx.gbl...
> Good luck with MySQL and 5 billion rows<g>.
Well, to fair, the largest MySQL db I've heard of has 10 billion rows...

>
|||Anthony,
I find your advice about clustered index and placement interesting, can you
point me to any good articles which covers this topic or even a book?
Thanks,
Saptagiri Tangudu
PNT Marketing Services
"AnthonyThomas" wrote:

> You will want to isolate that table and its non-clustered indexes across as
> many physical disk spindles as possible. Also, consider creating two
> seperate File Groups, one for the Clustered Index and one for the
> non-clustered indexes. In each File Group, create as many physical files as
> you have CPUs and independent disks. If you have enough disk counts, keep
> the files from the Clustered Index seperated from the files of the
> non-clustered indexes, but certainly use multiple files per file group, even
> if you are limited by number of physical disks.
> Also, create at least 2 log files of equal size and absolutely place these
> on dedicated disks.
> As far as capacity is concerned, the database size must be not be greater
> than 1,048,515 TB, number of File Groups must not exceed 256 per database,
> files per databse 32,767, data and log file sizes can not be larger than 32
> TB each.
> I do not think you will have a size problem; however, the row count will be
> sufficient enough to warrant thoughtful database design, file layout, and
> indexing strategy. You will also need to consider an appropriate Candidate
> Key for the Cluster Index, absolutely DO NOT SET any surrogate Primary Key
> as the clustered index, as is the default. This is usually the worst
> possible candidate only superseded by not having a clustered index defined
> at all.
> The 2 GB limitation is for MSDE only.
> Sincerely,
>
> Anthony Thomas
>
> --
> "Greg D. Moore (Strider)" <mooregr_deleteth1s@.greenms.com> wrote in message
> news:2aQsd.37569$1u.35532@.twister.nyroc.rr.com...
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
> news:OwmvZXl2EHA.924@.TK2MSFTNGP14.phx.gbl...
>
> Well, to fair, the largest MySQL db I've heard of has 10 billion rows...
>
>

Advice Needed on Large Scale DataBases

We are in the process of developing a web indexing project similar to
http://www.grub.org/ . We will have a database that is going to contain
about 5 billion records. Currently I am split between MS SQL and My SQL for
this project. Some of the issues we are going to have is storage size. Based
on our math, our data base will be about 100 GB in size, is there a file
size limit with MS SQL (I heard some where there is a 2GB limit or was that
2 TB limit). A better design is a split data base but for now we would like
to use a single db.
JayGood luck with MySQL and 5 billion rows<g>. SQL Server does not have a
limit that you suggested except in it's free version (MSDE). THere are many
SQL Servers out there with 2TB or more of data. Even though 100GB is not
that large these days for SQL Server I can't stress enough that you do your
homework first and ensure you have a properly designed db schema and
application.
--
Andrew J. Kelly SQL MVP
"Jay Janarthanan" <jay@.objectcube.com> wrote in message
news:e8N7AKl2EHA.1452@.TK2MSFTNGP11.phx.gbl...
> We are in the process of developing a web indexing project similar to
> http://www.grub.org/ . We will have a database that is going to contain
> about 5 billion records. Currently I am split between MS SQL and My SQL
> for this project. Some of the issues we are going to have is storage size.
> Based on our math, our data base will be about 100 GB in size, is there a
> file size limit with MS SQL (I heard some where there is a 2GB limit or
> was that 2 TB limit). A better design is a split data base but for now we
> would like to use a single db.
> Jay
>|||Thanks Andrew. There is only one Table that is going to contain the 5B rows,
the rest of the tables are small in size.
I am more concerned about the HW requirements.
Jay
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:OwmvZXl2EHA.924@.TK2MSFTNGP14.phx.gbl...
> Good luck with MySQL and 5 billion rows<g>. SQL Server does not have a
> limit that you suggested except in it's free version (MSDE). THere are
> many SQL Servers out there with 2TB or more of data. Even though 100GB is
> not that large these days for SQL Server I can't stress enough that you do
> your homework first and ensure you have a properly designed db schema and
> application.
> --
> Andrew J. Kelly SQL MVP
>
> "Jay Janarthanan" <jay@.objectcube.com> wrote in message
> news:e8N7AKl2EHA.1452@.TK2MSFTNGP11.phx.gbl...
>> We are in the process of developing a web indexing project similar to
>> http://www.grub.org/ . We will have a database that is going to contain
>> about 5 billion records. Currently I am split between MS SQL and My SQL
>> for this project. Some of the issues we are going to have is storage
>> size. Based on our math, our data base will be about 100 GB in size, is
>> there a file size limit with MS SQL (I heard some where there is a 2GB
>> limit or was that 2 TB limit). A better design is a split data base but
>> for now we would like to use a single db.
>> Jay
>>
>|||Jay Janarthanan wrote:
> Thanks Andrew. There is only one Table that is going to contain the
> 5B rows, the rest of the tables are small in size.
> I am more concerned about the HW requirements.
> Jay
>
>
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
> news:OwmvZXl2EHA.924@.TK2MSFTNGP14.phx.gbl...
>> Good luck with MySQL and 5 billion rows<g>. SQL Server does not
>> have a limit that you suggested except in it's free version (MSDE).
>> THere are many SQL Servers out there with 2TB or more of data. Even
>> though 100GB is not that large these days for SQL Server I can't
>> stress enough that you do your homework first and ensure you have a
>> properly designed db schema and application.
>> --
>> Andrew J. Kelly SQL MVP
>>
>> "Jay Janarthanan" <jay@.objectcube.com> wrote in message
>> news:e8N7AKl2EHA.1452@.TK2MSFTNGP11.phx.gbl...
>> We are in the process of developing a web indexing project similar
>> to http://www.grub.org/ . We will have a database that is going to
>> contain about 5 billion records. Currently I am split between MS
>> SQL and My SQL for this project. Some of the issues we are going to
>> have is storage size. Based on our math, our data base will be
>> about 100 GB in size, is there a file size limit with MS SQL (I
>> heard some where there is a 2GB limit or was that 2 TB limit). A
>> better design is a split data base but for now we would like to use
>> a single db. Jay
Hardware is easy. Lots of CPU, lots of fast drives, and lots of
memory...
If you put that large table on its own RAID 10 array if it gets writtent
to a lot, or a fast RAID 5 array if it is mostly read-only (batches at
night and small updates during the day are fine), you shold be ok. Use a
lot of drives in the array for best performance and put that array on
its own channel.
Regarding the hardware, you'll need to do some homework about the size
of the table and how frequently it gets accessed to determine if you'll
need the improved memory allowance of SQL Server 2000 EE. If you mostly
accessing single rows and have the necessary indexing in place, you may
find that memory is not a big concern and a fast 2-cpu system may
suffice. 100BG is not that large for SQL Server as Andrew mentioned. But
given that large table table, you probably want to make sure it's
isolated from the other data on its own drive subsystem. Drive are
cheap, though. You could throw 10 fast drives in a RAID 5 array for a
couple thousand and then use that array for backing up if the database
was idle at night. RAID 10 (1+0) is a little more expensive in terms of
drives, but has the best write and read performance. RAID 5 is the worst
for writing, but fast at reading, and the cheapest redundant solution.
David Gugick
Imceda Software
www.imceda.com|||"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:OwmvZXl2EHA.924@.TK2MSFTNGP14.phx.gbl...
> Good luck with MySQL and 5 billion rows<g>.
Well, to fair, the largest MySQL db I've heard of has 10 billion rows...
>|||You will want to isolate that table and its non-clustered indexes across as
many physical disk spindles as possible. Also, consider creating two
seperate File Groups, one for the Clustered Index and one for the
non-clustered indexes. In each File Group, create as many physical files as
you have CPUs and independent disks. If you have enough disk counts, keep
the files from the Clustered Index seperated from the files of the
non-clustered indexes, but certainly use multiple files per file group, even
if you are limited by number of physical disks.
Also, create at least 2 log files of equal size and absolutely place these
on dedicated disks.
As far as capacity is concerned, the database size must be not be greater
than 1,048,515 TB, number of File Groups must not exceed 256 per database,
files per databse 32,767, data and log file sizes can not be larger than 32
TB each.
I do not think you will have a size problem; however, the row count will be
sufficient enough to warrant thoughtful database design, file layout, and
indexing strategy. You will also need to consider an appropriate Candidate
Key for the Cluster Index, absolutely DO NOT SET any surrogate Primary Key
as the clustered index, as is the default. This is usually the worst
possible candidate only superseded by not having a clustered index defined
at all.
The 2 GB limitation is for MSDE only.
Sincerely,
Anthony Thomas
"Greg D. Moore (Strider)" <mooregr_deleteth1s@.greenms.com> wrote in message
news:2aQsd.37569$1u.35532@.twister.nyroc.rr.com...
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:OwmvZXl2EHA.924@.TK2MSFTNGP14.phx.gbl...
> Good luck with MySQL and 5 billion rows<g>.
Well, to fair, the largest MySQL db I've heard of has 10 billion rows...
>|||Anthony,
I find your advice about clustered index and placement interesting, can you
point me to any good articles which covers this topic or even a book'
Thanks,
Saptagiri Tangudu
PNT Marketing Services
"AnthonyThomas" wrote:
> You will want to isolate that table and its non-clustered indexes across as
> many physical disk spindles as possible. Also, consider creating two
> seperate File Groups, one for the Clustered Index and one for the
> non-clustered indexes. In each File Group, create as many physical files as
> you have CPUs and independent disks. If you have enough disk counts, keep
> the files from the Clustered Index seperated from the files of the
> non-clustered indexes, but certainly use multiple files per file group, even
> if you are limited by number of physical disks.
> Also, create at least 2 log files of equal size and absolutely place these
> on dedicated disks.
> As far as capacity is concerned, the database size must be not be greater
> than 1,048,515 TB, number of File Groups must not exceed 256 per database,
> files per databse 32,767, data and log file sizes can not be larger than 32
> TB each.
> I do not think you will have a size problem; however, the row count will be
> sufficient enough to warrant thoughtful database design, file layout, and
> indexing strategy. You will also need to consider an appropriate Candidate
> Key for the Cluster Index, absolutely DO NOT SET any surrogate Primary Key
> as the clustered index, as is the default. This is usually the worst
> possible candidate only superseded by not having a clustered index defined
> at all.
> The 2 GB limitation is for MSDE only.
> Sincerely,
>
> Anthony Thomas
>
> --
> "Greg D. Moore (Strider)" <mooregr_deleteth1s@.greenms.com> wrote in message
> news:2aQsd.37569$1u.35532@.twister.nyroc.rr.com...
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
> news:OwmvZXl2EHA.924@.TK2MSFTNGP14.phx.gbl...
> > Good luck with MySQL and 5 billion rows<g>.
>
> Well, to fair, the largest MySQL db I've heard of has 10 billion rows...
> >
>
>sql

Advice needed - Regarding data transfer between databases on seperate servers

Hello everyone,

Here's my situation...

I'm running a web service which involves 51 seperate servers and databases.

There are fifty licensee servers (One for each US state) and one corporate server.

Each night I need to upload sales and membership data from the licensee's databases to the corporate database to compile reports.

The application platform I'm using is ASP.NET 2.0 and the the database is SQL2005 express.

I want this process to be run automatically, so I believe it's a scheduled windows service I need to setup up in .NET to make the data transfers.

If anyone has already set something up like this, or knows the steps to take? I would love to have your input.

Thanks in advance,

Robert

Did you mean 50 Databases on same server or 50 different servers?

You could set up a DTS package and schedule it to run at a particular time every day. You dont need to do anything with .NET. This can be done completely at the backend.

|||

ndinakar:

Did you mean 50 Databases on same server or 50 different servers?

You could set up a DTS package and schedule it to run at a particular time every day. You dont need to do anything with .NET. This can be done completely at the backend.

This is correct, note that SQLAgent service has to be up & running inorder to have your DTS (in SQL Server 2000) or SSIS (in SQL Server 2005) packages executed on time.

If this service was not started (stopped), any scheduled tasks in SQL Server will not work.

Conclusion: Make sure this SQLAgent service is always up & running in all your database servers (check them after batching your OS or restarting it).

One of the bad thing about this way is, you can not generate reports at anytime .. you have to wait (say till next day) in order to see the reports for all states.

How to overcome this is by using replication (for example), by replicating the data you need from source tables (in diffrent servers) into ONE server (e.g. main branch) so you can generate the reports from all 50 data sources at any time and updated;

Just a suggestion:
If the amount of data is not that much, you can export the data (say in Excel format) then send them by email to your main branch.
This might save some traffic (bandwidth) for you, but on the another hand you need to imported to SQL Server before generating the reports.
One more good thing about this way is, you will always have a copy in your email for all 50 databases.

There are many ways to do this, actullay depends on the case and how important to get the report on anytime and how large the data is.

Good luck.

|||

Hi Guys,

Thanks for the responses!

Nethi - Yes thats right - There will be 50 seperate licensee databases, which run on 50 seperate licensee servers. Each night I need to retrieve data from each of 50 seperate databases and upload it to a database on the corporate server to run reports the next day. (51 seperate servers/databases involved)

The sales data I'll be uploading nightly will be minimal, because i'll only be capturing sales that were made that day (12 am till 11:59:59 pm the licensee's server time) The membership data will be a larger file, because I need to upload all records every night, which will overwrite the prior membership data records. So in this case there will be many rows, but the actual data being uploaded from each row is minimal.

Tell me - Using DTS...

Can I fully specify what data needs to be uploaded? (Conditions such as record creation time, etc)
The servers may be in different time zones - Would this cause problems for DTS regarding capture periods?
Using DTS, will the uploads be secure?
If a scheduled data transfer fails for some reason or another, does DTS have a feature to report the failure, and what would be involved in capturing the data that wasn't transfered as scheduled? Is it complicated, difficult and time consuming?

Thanks again for your input and advice

Robert

|||

>>>Can I fully specify what data needs to be uploaded? (Conditions such as record creation time, etc)

You can use a mix of script in DTS - VB Script/T-SQL. You can call stored procedures. Google for DTS and read up some articles to get some info.

>>>The servers may be in different time zones - Would this cause problems for DTS regarding capture periods?

The DTS will run from the server its created on, on the schedule its scheduled to run. You can schedule it according to souce server timezone or target server timezone.

>>>Using DTS, will the uploads be secure?

DTS will use either Windows Authentication or SQL authentication. You can set up either way.


>>>If a scheduled data transfer fails for some reason or another, does DTS have a feature to report the failure, and what would be involved in capturing the data that wasn't transfered as scheduled? Is it complicated, difficult and time consuming?

You call the DTS package from a scheduled job. The job has additional options of reporting - email/pager and different options for success/failure.

|||

As much as I know Sql Server 2005 Express does not support DTS.

sql

Thursday, March 22, 2012

AdventureWorks, invalid object name error

Hi, I will start step by step:

1. a new web site with VS 2005.

2. I added a sqldatasouce and connect with AdventureWorks sample database ,which comes with sql server 2005 developer edition, selected by drop-down list. [ server name:(local) ]

3. Test connection. It is OK.

4. Saved as 'AdventureWorksConnectionString'.

5. Some columns are selected in the 'product' table.

6. At the end while testing query with 'test query' button it gives:

"There was an error executing the query. Please check the syntax of the command and if present, the types and values of parameters and ensure the are correct.

Invalid object name 'Product'. "

7. However when I choice NorthWind database sample I installed externally, there is no problem.Moreover, when I choice AWBuildVersion table in the AdventureWorks, and it's columns, there is also no problem.

8. I compared NorthWind and AdventureWorks security properties in the SQL server managment studio, but can't find any differences.

9. I have been searching all the web since two days.

10. Thanks.

can you paste the SQL command that fails...

|||

There are two problems.

The AdventureWorks database uses a "Schema.Table" naming convention that the SQLDataSource Wizard doesn't pickup.

Table Names are Case-Sensitive in the AdventureWorks database.

Workaround:

Instead of "Specify columns from table or view", select "Specify a custom SQL statement..."

On the next screen, use the "Query Builder" to generate the SQL statement. It will pickup the schema name.

PS: After I post this message, I'm going to move this thread to the SQL database forum. I think it's more appropriate there.

|||

Yeah, it works... Thank you very much... But,I couldn't figure out why this happened to me, because I have started to read"Addison Wesley ASP NET .2.0 Illustrated". In that book, it is theprocedure how to implement AdventureWorks database in Chapter 2, and does normention any info of "Schema.Table" and SQLDataSouce relation. Ihave tried some method to accomplish that with "Specify columns from tableor view" method:

Source Code of"Specify columns from table or view" method which gives error:

<asp:SqlDataSource ID="SqlDataSource3" runat="server"ConnectionString="<%$ ConnectionStrings:AdventureWorksConnectionString%>"
ProviderName="<%$ConnectionStrings:AdventureWorksConnectionString.ProviderName %>"
SelectCommand="SELECT [ProductID], [Name], [ProductNumber], [ListPrice],[Color], [SafetyStockLevel], [StandardCost], [Size] FROM[Product]">
</asp:SqlDataSource>


Source Code of "Specify a custom SQL statement..."and applying "Query Builder" method which gives NO error:

<asp:SqlDataSource ID="SqlDataSource3" runat="server"ConnectionString="<%$ ConnectionStrings:AdventureWorksConnectionString%>"
SelectCommand="SELECT ProductID, Name, ProductNumber, ListPrice, Color,SafetyStockLevel, StandardCost, Size FROMProduction.Product">
</asp:SqlDataSource>

What I could try as a beginner to get a validoutput is changing[Product] as Production.Product.Of course, it gives the same 'invalid object name' error.

As I told you before, AWBuildVersion tablegives no error with "Specify columns from table or view" method:

<asp:SqlDataSource ID="SqlDataSource3" runat="server"ConnectionString="<%$ ConnectionStrings:AdventureWorksConnectionString%>"
ProviderName="<%$ ConnectionStrings:AdventureWorksConnectionString.ProviderName%>"
SelectCommand="SELECT [SystemInformationID], [Database Version] ASDatabase_Version, [VersionDate], [ModifiedDate] FROM [AWBuildVersion]">
</asp:SqlDataSource>

I have understood from your note theonly way to implement "Schema.Table" s is use the "QueryBuilder", right?

And for your consideration here is Stack Trace:
------
SqlException (0x80131904): Invalid object name 'Product'.]

System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +177

System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +68

System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +199

System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2406

System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +31

System.Data.SqlClient.SqlDataReader.get_MetaData() +62

System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +294

System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1038

System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +314

System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +20

System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +107

System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +10

System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +7

System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +139

System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +140

System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83

System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1657

System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +13

System.Web.UI.WebControls.DataBoundControl.PerformSelect() +140

System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +68

System.Web.UI.WebControls.GridView.DataBind() +5

System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +61

System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +67

System.Web.UI.Control.EnsureChildControls() +97

System.Web.UI.Control.PreRenderRecursiveInternal() +50

System.Web.UI.Control.PreRenderRecursiveInternal() +171

System.Web.UI.Control.PreRenderRecursiveInternal() +171

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5731

------
 Again, Thank you very much to help and save my time.

sql

Tuesday, March 20, 2012

Adventure works database, I can't connect to the database

Database not found !

My web.config file has this bit of code:

<connectionStrings>

<add name="AppConnectionString1" connectionString="Data Source=&quot;.\SQLEXPRESS&quot;;AttachDbFilename=&quot;C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf&quot;;Integrated Security=True"

providerName="System.Data.SqlClient" />

</connectionStrings>

But........................... the is no "AdventureWorks_Data.mdf" in that folder ?

And the database is installed in the right place !

help !

Where is the AdventureWorks_Data.mdf file located? AttachDbFilename must point to the location of the mdf file. It sounds like you have the wrong connection string. If you're not putting the database into the Data folder, then you need to change your connection string to point to the correct location.

Regards,

Mike Wachal
SQL Express team

-
Mark the best posts as Answers!

|||

Did this resolve the issue?

Mike

|||

Hmmm

I've downloaded and installed the Adventure works database

I follow the instructions give here

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

but this command here:

exec sp_attach_db @.dbname=N'AdventureWorks', @.filename1=N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf', @.filename2=N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_log.ldf'

results in this error:

unable to open physical file,................................................. the system can't find the specified file.

The things is....................... i can't find a "AdventureWorks_Data.mdf" file.

|||

When you downloaded and installed the AdventureWorks sample, you were probably asked for a directory to install to, that's where the database should be. If you don't recall where it went, try searching your hard drive for it. (Start | Search and then look for "AdventrueWorks*")

Once you know where it is, you can either change the path in the command above, or you can move it to the Data directory for the instanse of SQL that you want to attach it to. If search doesn't find the file, that probably means it either didn't get installed, or it was deleted. Try installing again. You may have to uninstall the sample from Add/Remove Programs before you can install it again.

Mike

|||

I basically have the same problem; however, I do have the: AdventureWorks_Data.mdf and AdventureWorks_log.ldf files in the proper directory. But I do a 'search' and do not see the 'AdventureWorks' db file.

I run the script:

exec sp_attach_db @.dbname=N'AdventureWorks', @.filename1=N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf', @.filename2=N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_log.ldf'

and get:

Msg 1813, Level 16, State 2, Line 1

Could not open new database 'AdventureWorks'. CREATE DATABASE is aborted.

Msg 602, Level 21, State 50, Line 1

Could not find row in sysindexes for database ID 9, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.

Thanks for any help in advance...

Adventure works database, I can't connect to the database

Database not found !

My web.config file has this bit of code:

<connectionStrings>

<add name="AppConnectionString1" connectionString="Data Source=&quot;.\SQLEXPRESS&quot;;AttachDbFilename=&quot;C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf&quot;;Integrated Security=True"

providerName="System.Data.SqlClient" />

</connectionStrings>

But........................... the is no "AdventureWorks_Data.mdf" in that folder ?

And the database is installed in the right place !

help !

Where is the AdventureWorks_Data.mdf file located? AttachDbFilename must point to the location of the mdf file. It sounds like you have the wrong connection string. If you're not putting the database into the Data folder, then you need to change your connection string to point to the correct location.

Regards,

Mike Wachal
SQL Express team

-
Mark the best posts as Answers!

|||

Did this resolve the issue?

Mike

|||

Hmmm

I've downloaded and installed the Adventure works database

I follow the instructions give here

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

but this command here:

exec sp_attach_db @.dbname=N'AdventureWorks', @.filename1=N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf', @.filename2=N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_log.ldf'

results in this error:

unable to open physical file,................................................. the system can't find the specified file.

The things is....................... i can't find a "AdventureWorks_Data.mdf" file.

|||

When you downloaded and installed the AdventureWorks sample, you were probably asked for a directory to install to, that's where the database should be. If you don't recall where it went, try searching your hard drive for it. (Start | Search and then look for "AdventrueWorks*")

Once you know where it is, you can either change the path in the command above, or you can move it to the Data directory for the instanse of SQL that you want to attach it to. If search doesn't find the file, that probably means it either didn't get installed, or it was deleted. Try installing again. You may have to uninstall the sample from Add/Remove Programs before you can install it again.

Mike

|||

I basically have the same problem; however, I do have the: AdventureWorks_Data.mdf and AdventureWorks_log.ldf files in the proper directory. But I do a 'search' and do not see the 'AdventureWorks' db file.

I run the script:

exec sp_attach_db @.dbname=N'AdventureWorks', @.filename1=N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf', @.filename2=N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_log.ldf'

and get:

Msg 1813, Level 16, State 2, Line 1

Could not open new database 'AdventureWorks'. CREATE DATABASE is aborted.

Msg 602, Level 21, State 50, Line 1

Could not find row in sysindexes for database ID 9, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.

Thanks for any help in advance...

Monday, March 19, 2012

Advanced SQL tutorials in Problem/Answer format

I'd like some challenging practice with SQL; general SQL-92 or MS specific (sql server or access).
There's a million sources on the Web, but most are like reference manuals. I already have MSDN with my VS 6.0 and .Net, as well as help files for 3 different versions of Access. I'm looking for something set up more like assignments or challenges. I found a couple sites like this:
SqlZoo.net and SQLCourse.com

SqlZoo has too many mistakes and vague questions. SQLCourse is pretty good, but no advanced stuff (some multiple Joins, subqueries, calculated fields and such). I like the idea of having the same related tables that you keep solving different problems with. This is more like a real-world situation. I would think that there would be a lot of question/answer tutorials for the MS supplied sample db's (Northwind, Pubs, etc.), but I haven't found any.

These forums are full of good questions posed by people, but they always concern unfamiliar data sources and I have to slog through the posts with my slow dial-up connection. I would rather do one big download and work at the problems offline.
Any suggestions?if you want the same related tables that you keep solving different problems with, your best bet is to search for the more common databases like northwind and sakila, perhaps by throwing several of their tables names into a search

if you want advanced question/answers, i humbly offer my own (the actual articles are on the techtarget.com site)

see http://r937.com/sqlate.cfm|||Thanks. There's a lot of good questions in one spot; I can easily download a bunch of those pages. Since the questions are all at the top of the pages, I can read them without seeing the answers. You helped save me a lot of searching time. If I do find some Northwind-based question tutes, I'll post the link.
Thanks again.|||Ahh, I find I learn more than enough from here :p
Just subscribe to SQL/Access threads that you are interested in.
I've knocked up a test database purely for solving problems on here -
trying to recreate peoples problems and see if I can solve them.

It's often a really good way to learn when you're given an unfamiliar problem, because you try and break it down into a generic solution (which means you can use it again later!).

There's my 2 cents. :cool:

Advanced Search box

ConfusedHi, Using Visual Web Developer and SQL Express, (coding in Csharp) I want to add a

advanced search facility to my site. Problem is I do not know how to begin.

The website is a business directory and displays company names and services that they provide.

Here is where I am at...

So far I have made one query whichallows users to search the database by "town" such as if they enter "London" in the text box, it returns the relevant records into a gridview.

Rather than have a seperate text box for each query, I want to provide an advanced search box option so users can define their search and query the database by various criterias, such as geography, sector, name, number of employees in companies etc.

I have seen compact advanced search boxes on many sites!.

Replies greatly appreciated.

prontonet

You can use a query with multiple search criterials, and 'disable' a search criterial when the input parameter is null. For example:

USE Northwind
DECLARE @.EId int, @.CId varchar(20)
SET @.EID=6
SELECT *
FROM Orders
WHERE EmployeeID=isnull(@.EId,EmployeeID)
AND CustomerID=isnull(@.CId,CustomerID)

Here we make a trick by using ISNULL function to return the self value of a field if the parameter is null. So in your code, just pass null values to the parameters when corresponding textbox is empty.

|||

Mnay Thanks for your reply. Can you give me another example - somehow not quite

following it yet??

|||Sorry I'm not not clear. Can you explain more about the example you want?|||

easiest way to explain is to give an example of what I would like a user to be able to do

Say I have 1000 companies in my database, then I want to give the user multiple search options

to retrieve only the data they need but in a compact way - As opposed to making a seperate text box for each search criteria which takes up a lot of space on the web page.

Ideally I want the user to be able to select or tick (from a dropdown or (checkbox) which

critieria they are searching by and then enter just enter any text into single box and just hit the search button.

I have included example criterias below...

Search Criteria 1 (By town)

Search Criteria 2 (by Industry sector)

Search Criteria 3 (by number of employees in company

Search Criteria 4 (company ID)

There could be more, also Ideally I would want them also to be able to filter the search further so they can for example select - "companies in "London" with "100+ employees", and that trade in the "technology sector"

I almost understand your example put maybe if you could put it into the above context

that would help. once again I am using visual web developer and Csharp.

Thanks

|||

Im really looking forward to an answer to this. Im stuck on the same thing......

Some1 plz help !!! With an example......

|||

OK, let's look at a simple example. Suppose we have a table as following in database:

CREATE TABLE Companies(ComID int PRIMARY KEY, town nvarchar(100),
IndustrySector nvarchar(50),NumOfEmployees int)

And we have 4 TextBoxes in application used for inputting search criterials. Then we can use such code:

using (SqlConnection conn = new SqlConnection(@."Data Source=.\IORI2000;Integrated Security=SSPI;Database=tempdb"))
{
conn.Open();
SqlCommand cmd = new SqlCommand("SELECT * FROM Companies WHERE town=isnull(@.town,town)AND Industrysector=isnull(@.zInSec,Industrysector)AND NumOfEmployees>=@.NOE AND ComID=isnull(@.ComID,ComID)", conn);

cmd.Parameters.Add("@.town", SqlDbType.NVarChar, 100);
cmd.Parameters.Add("@.zInSec", SqlDbType.NVarChar, 50);
cmd.Parameters.Add("@.NOE", SqlDbType.Int);
cmd.Parameters.Add("@.ComID", SqlDbType.Int);
if (textBox1.Text.Length == 0)
cmd.Parameters["@.town"].Value = DBNull.Value;
else
cmd.Parameters["@.town"].Value = textBox1.Text;
if (textBox2.Text.Length == 0)
cmd.Parameters["@.zInSec"].Value = DBNull.Value;
else
cmd.Parameters["@.zInSec"].Value = textBox2.Text;

cmd.Parameters["@.NOE"].Value = textBox3.Text.Length == 0 ? 0 : Int32.Parse(textBox3.Text);
if (textBox4.Text.Length == 0)
cmd.Parameters["@.ComID"].Value = DBNull.Value;
else
cmd.Parameters["@.ComID"].Value = Int32.Parse(textBox4.Text);

SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
sda.Fill(dt);
label1.Text= dt.Rows.Count.ToString();
}

|||Thanks so much. How can I use this same example to search more then one column based on a single textbox.|||

That's something you need to implement from your code. For example you can validate the input text of a textbox so that the search criterals are delimited by some chars (such as ';' in connection string), and then split the text into a string array. In this case I prefer dynamic SQL built from concatenated basic SELECT command and WHERE clause. Ok let's take a look at how to build dynamic SQL command:

using (SqlConnection conn= new SqlConnection(ConfigurationManager.ConnectionStrings["myConn"].ToString()))
{
conn.Open();
string qstring = "SELECT * FROM Orders WHERE";

string[] sa = TextBox2.Text.Split('#');
if (sa.Length == 0)
Response.Write("No correct search criterials!");
else
foreach (string s in sa)
qstring += s+" AND ";
qstring=qstring.Remove(qstring.Length - 4);
SqlCommand cmd = new SqlCommand(qstring, conn);

//add your code

}

But keep in mind: dynamic SQL without using Parameters may suffer from SQL Injection. We should always use parameterized query.

Advanced schema design question for Experts. Please help. Thanks

QUESTIONs:What schema is the best for high speed search for a classified web application?

Is our schema design looks OK? It is a STAR schema and will be used for OLTP type app. Is this OK? or Are we missing something?Please let me know if you need more diagramatic description.

BACKGROUND:Our group is making a classified website (like classified.yahoo.com) where people can place online ad to sell items.like cars, computers, electronics etc. Users will fill out webform for each category(car or computers) with allattributes of the item forsell to post an add.

Main 3 operations the web users will perform:Quick Searching(most frequent): category=car, subcategory=sedan, country=USA city=LosAngeles Zip=empty

Advanced Search(less frequent): User can include all fields\attributes or then can user a subset to query to do advanced search like :

category=car, subcategory=sedan, country=USA, city=Los Angeles, Year= in(00, 03), transmission=Auto, engine=V6, Maker=Honda, Model=Accord, color=Red and Price < 10000

category=car, subcategory=SUV, country=USA, city=NY, Year= in(99, 00, 03), transmission=Auto, Maker=Toyota, and Price between 11000 and 14500

Insert(least frequent): By filling out web form. For Car, the form will have different dimensions\attributes (year, make, model, transmission, mileage, color, price etc)

Current Schema design:Set of core dimension\lookup tables: stores core\common attributes for lookups eg. status={open, new, expired}, country={USA, Canada, India,...}

One custom Lookup table: for all custom attribute lookup: transmission{auto, manual}, engine type{V4, V6} for car, processor{PII, PIII, PIV), RAM(512MB, 1GB, 2GB} for Computer & so

3 Fact Tables:Main fact\Pivot table that stores all sell common attributes eg. price, title, year_made, post_date, expire_date, user_name, description etc.One fact table to store custom string, int, float, date field values of ads.One fact table to store custom dropdown field selection values

Concerns and issues:Looking at the schema, it seems to be a STAR schema with multiple fact tables where all core lookup tables connected to the main Pivot table andcustom lookup table connected to the 2nd and 3rd fact table.

Quick search only queries the Pivot fact table. While Advanced search query requires to join 3 fact tables. Both query requires to join 3 fact tables with alldimension tables(15 to 20 each having avg of 20 values) to get the look up names so that users sees text instead of ids. Search speed is the Main concerns. Insertion\update speed doesn't matter that much as that is less frequently done.

jennifer7290 wrote:

QUESTIONs:What schema is the best for high speed search for a classified web application?


Is our schema design looks OK? It is a STAR schema and will be used for OLTP type app. Is this OK? or Are we missing something?Please let me know if you need more diagramatic description.



Your model ("3 fact tables") is quite possibly the worst way to do this.
Let's think about it:
- You know what you're selling - Cars, Computers, etc.
- You know what attributes those entities have (Engine Type, Processor Type, etc).
- Users search for entities, not attributes ("give me everything witha V6 and a P4").
So why go with such non-orthagonal design? Subclass your entities:
Ads := ( Ad_Num, Ad_Type, Price, Start_Date, ...)
Ad_Type IN ('Auto', 'Computer', 'Boat', 'Service', ...)
Auto_Ad_Attributes := ( Ad_Num, Engine_Size, Color, ...)
Computer_Ad_Attributes := ( Ad_Num, Processor_Speed, ...)
...
Go with EAV and flush your data integrity down the drain and watch how absurdly slow your clasified system runs when people start using it.

|||Alex,
Thanks for reading it. What is orthogonal design concept? Is it database term or OOP term?
What is EAV stands for? How can I see some example design of your proposed approach or some tutorials, books will be really helpful.
Again, our emphasis is to track all classified information in a webbased tool with requirement of complex, dynamic query with HIGH speed in search.
Hope to hear from you.
Regards|||

I did google on it. It sounds like a bad design approach to me. The reasons are too many entities, so too many joins can't be avoided like the STAR schema.
How does your EAV performs better than STAR for classified system for a system with 20 metadata\entity\lookup tables??
HOW DOES YOUR MODEL PROVIDE HIGH SPPED IN SEARCH? Query speed depends on number of joins which can be done through denormalization.
In my case I actually have 1 fact table and 2 mapping intersect table (I mentioned as fact table).
Please see the link below:
Regards

http://ycmi.med.yale.edu/nadkarni/eav_CR_contents.htm
Drawbacks of EAV/CR

  • Considerable up-front programming (wheel reinvention) is needed to do the tasks that a conventional architecture would do automatically. However, such programming needs to be done only once, and availability of generic EAV tools could remove this limitation.
  • EAV design is less efficient than a conventional structure for retrieving data in bulk on numerous objects at a time. (For object-at-a-time retrieval, such as through a Web-based browsing interface, the volume of data is small enough that the difference is not noticeable.)
  • Performing complex attribute-centric queries is both significantly less efficient as well as technically more difficult. This needs a query generator. However, most queries on scientific databases are relatively straightforward, and directed toward specific objects of interest.
  • For schemas that are relatively static and/or simple (e.g., databases for business applications, such as inventory or accounting), the overhead of EAV design exceeds its advantages.
  • If particular classes of data will be used across multiple databases in different domains, and/or there is a large amount of existing code that manipulates them, it should probably be left in its original conventional form. This is the reason why we have chosen to store bibliographic citations (that are not in external databases) conventionally. We similarly store certain genetics-related data conventionally because of a large body of code (from other databases previously created by our group, such as PhenoDB ) that performs computations such as Hardy-Weinberg frequencies and tests of significance.|||


    jennifer7290 wrote:

    Alex,
    Thanks for reading it. What is orthogonal design concept? Is it database term or OOP term?
    What is EAV stands for? How can I see some example design of your proposed approach or some tutorials, books will be really helpful.

    Again, our emphasis is to track all classified information in a webbased tool with requirement of complex, dynamic query with HIGH speed in search.
    Hope to hear from you.
    Regards

    EAV = Entity-Attribute Value, a totally unstructured design that involves Entities defined with Attribute/Value pairs:
    EAV := (Entity, Attribute, Value)
    { 'CAR#342', 'Engine', 'V6' }
    { 'CAR#342', 'Color', 'Red' }
    { 'PC#4555', 'CPU', 'Pentium 4' }
    { 'PC#998', 'OS', 'Windows' }

    This is effectively what you are doing with your "fact" tables, except you have three "fact" tables for some reason I really don't understand.

    The design I mentioned is a very basic one. You have a table containing your base entities (advertisements) and tables containing subclass-specific attributes like Engine, Color, etc. You then make views for each type of entitiy:

    Automobile_Ads :=
    SELECT AD.Ad_Num, AD.title, AD.year_made, AD.post_date,
    AD.expire_date, AD.user_name, AD.description , ...,
    AUTO.Make, AUTO.Model, AUTO.Miles, ...,
    FROM Advertisements AD
    INNER JOIN Automobile_Advertisement_Attributes AUTO
    ON AD.Ad_Num = A.Ad_Num

    Find me all Ford Makes with a v6:
    SELECT Make FROM Automobile_Ads WHERE Make='Ford' AND Engine='V6'

    You would be very saddened to see how complex (and rediculously slow) such a query would be in an EAV table.

    It's a very easy design to do: figure out all the entities (what you will allow ads for), then figure out all of the attributes of those entities. For each entity, create an attributes table as desribed above and a view described above.

    |||

    jennifer7290 wrote:

    I did google on it. It sounds like a bad design approach to me. The reasons are too many entities, so too many joins can't be avoided like the STAR schema.
    How does your EAV performs better than STAR for classified system for a system with 20 metadata\entity\lookup tables??


    This is what happens when I POST before I READ. I misunderstood your design as EAV ... now that I read it again, I am a little lost ... could you elaborate by showing some tables ?
  • Tuesday, March 6, 2012

    AdomdConnection Error

    Hi~

    I write a web service by using ADOMD.

    When I excute the program under debug mode in my computer for testing,it's ok.

    But when I establish this web in the server,and browse(In Server) it to use, the error is happened.

    follow is my code & error messahe

    Code Snippet


    <WebMethod()> _
    Public Function Test2() As String
    Dim UserIdPwd As String = "Data Source = olapdw;Catalog = STATION;"
    Dim advwrksConnection As New AdomdConnection(UserIdPwd)
    Dim tmp

    advwrksConnection.Open()
    tmp = advwrksConnection.Database.ToString + advwrksConnection.Cubes.Count.ToString + advwrksConnection.ConnectionString
    advwrksConnection.Dispose()
    Return tmp

    End Function

    Microsoft.AnalysisServices.AdomdClient.AdomdErrorResponseException: Either the user, NT AUTHORITY\NETWORK SERVICE, does not have access to the STATION database, or the database does not exist.
    at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.XmlaClientProvider.Microsoft.AnalysisServices.AdomdClient.AdomdConnection.IXmlaClientProviderEx.Discover(String requestType, IDictionary restrictions, InlineErrorHandlingType inlineErrorHandling, Boolean sendNamespaceCompatibility)
    at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.XmlaClientProvider.Microsoft.AnalysisServices.AdomdClient.AdomdConnection.IXmlaClientProviderEx.GetPropertyFromServer(String propName, Boolean sendNSCompatibility)
    at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.get_Database()
    at Service.Test2() in C:\Inetpub\wwwroot\Service\App_Code\ASAdminService.vb:line 709

    Could some tell me why? or how to check?

    Thanks~

    This is the same issue as your AMO question:

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2032042&SiteID=1

    The web service is running under an account that does not have rights to access SSAS, you need to either run the web service under a different account which does have rights to the cube or grant access in SSAS to the account which the web service is currently running under.

    If SSAS and IIS are on different machines, the setting up a domain account for the web service and giving it access is probably the way to go. If they are on the same machine your could put the NETWORK SERVICE account in a role in SSAS so that it has rights to access the cubes.

    |||

    Thanks for your answer~

    The problem has already resolved.

    adomd.net cache server object

    Hi All,

    I have a bit of a dilemma regarding how to cache the server object so I don't have to reconnect all the time.

    I have a web service which serves AS2005 data, and whenever the cube schema changes (or sometimes just after a process), the server object doesn't return the cubes collection, and I end up having to restart IIS or the app to clear the application obj and start again. Obviously this is not the best. Is there anyway I can detect for schema changes in the server object, and serve up a fresh obj if there has been?

    I'm using the following code:

    Code Snippet

    Dim server As OlapServer.Server = Me.Application.Get(cubeServerStorageKey)
    If (server Is Nothing) Then

    Dim cubeServer As String = System.Configuration.ConfigurationManager.AppSettings.Get("Analysis Server")
    If (String.IsNullOrEmpty(cubeServer)) Then _
    cubeServer = "."

    Dim cubeServerTimeoutSeconds As String = System.Configuration.ConfigurationManager.AppSettings.Get("Cube Timeout")

    server = New OlapServer.Server(cubeServer, Me.RequestData.Database, Int32.Parse(cubeServerTimeoutSeconds))
    server.Connect()

    Me.Application.Set(cubeServerStorageKey, server)
    End If

    Return server

    hello,

    could you please clarify a bit. I believe adomd.net does not have an OlapServer class in it (nor does AMO). So, can you please provide relevant code (i guess of how the OlapServer object returns you the cubes collection, since from the problem description you mention that this is where the problem occurs), because without that code it is hard to tell what the problem might be or how to solve it.

    thanks a lot,

    |||

    Well why would you want to cache such a connection? 100ms routine is hardly worthy of cache. Chaching the return dataset I can see, but connection? Sorry if I misunderstood.

    Also, you can use .NET's cache methods to specify an exact timeout for a cached object.

    ADODB.Connection error 800a0e7a

    I am getting the following error, when I try to run my ASP Web pages on an NT4 server has anyone got any Ideas ?

    ADODB.Connection error '800a0e7a'

    Provider cannot be found. It may not be properly installed.

    I have installed every service pack and rebooted even reregistering .dlls

    Anyone got any Ideas ?If your problem is like mine, you are getting this error because your MDAC got hosed.
    I was un-installing something seemingly harmless and before I knew it I saw a flurry of mdac dlls being deleted.
    After that, SQLServer7's Enterprise Manager and other VB6 database apps started failing with this error.
    I re-installed the MDAC (26) and it (thankfully) fixed the problem.
    Hope this helps.|||I agree - reinstall your mdac. You can try to reregister the individual dll that is causing the problem - but that may only be a partial fix.

    Saturday, February 25, 2012

    ADO.NET works, but data to/from database is truncated

    I am using MSDE in a web application. The ADO.NET works, updating the
    database correctly. The only thing is when I use the dataset, and when I
    check the data in the database using server explorer the data is truncated. I
    tried using the various ntext, nvarchar and setting the length to somthing
    like a 100, but the data string is still to short somewhere. Only when this
    comes to the dataset, and data in the database is this true. What can I do?
    Thanks.
    Spencer
    hi Spencer,
    Spencer H. Prue wrote:
    > I am using MSDE in a web application. The ADO.NET works, updating the
    > database correctly. The only thing is when I use the dataset, and
    > when I check the data in the database using server explorer the data
    > is truncated. I tried using the various ntext, nvarchar and setting
    > the length to somthing like a 100, but the data string is still to
    > short somewhere. Only when this comes to the dataset, and data in the
    > database is this true. What can I do? Thanks.
    did you manually set the datatype size?
    check it's settings..
    and probably you'll have better luck asking in the .Net heirarchy newsgroups
    Andrea Montanari (Microsoft MVP - SQL Server)
    http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
    DbaMgr2k ver 0.10.0 - DbaMgr ver 0.56.0
    (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
    interface)
    -- remove DMO to reply
    |||"Andrea Montanari" wrote:

    > hi Spencer,
    > Spencer H. Prue wrote:
    > did you manually set the datatype size?
    > check it's settings..
    > and probably you'll have better luck asking in the .Net heirarchy newsgroups
    > --
    > Andrea Montanari (Microsoft MVP - SQL Server)
    > http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
    > DbaMgr2k ver 0.10.0 - DbaMgr ver 0.56.0
    > (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
    > interface)
    > -- remove DMO to reply
    >
    >
    Did you say .NET hierarchy group. I couldn't find that group can you give me
    the full name for the group?
    |||microsoft.public.dotnet.framework.adonet
    "Spencer H. Prue" <SpencerHPrue@.discussions.microsoft.com> wrote in message
    news:5E484369-BCA3-4527-96A7-281CE91B01EE@.microsoft.com...
    >
    > "Andrea Montanari" wrote:
    > Did you say .NET hierarchy group. I couldn't find that group can you give
    > me
    > the full name for the group?

    Friday, February 24, 2012

    ADO.NET connection to SQL fails

    Hello,
    I'm putting together an ASP.NET web form (using VB.NET) and the DB I'm trying to do an insert to can't validate my login. I've verified that the account does have permissions to access the SQL DB and that everything is granted as far as the INSERT, UPDATE
    , etc...
    I have my SQL Server (SQL2K) set up for mixed authentication (both SQL and Windows).
    I've tried all the suggestions from the "connectionstrings.com" website and I'm still getting errors stating that the login failed.
    Here is a copy of the error:
    Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
    The above error is happening when I use the connection string of:
    "server=MyServer;Initial Catalog=MyDatabase;Integrated Security=TRUE"
    I get the same thing when I use "Integrated Security=SSPI" as well.
    Here is the error I get when I try to use a user id:
    Login failed for user '{user name}'.
    The funny thing about it is that the user name specified above is the DBO and it is still rejected.
    One last question; have you ever wanted to give up with computers and go back to pen and paper?
    Any futher suggestions would be really great! I really appreciate it...
    Dale
    DBO is not a login, it is a user.
    Try connecting with sa (and the sa password). I am guessing that you =
    will have better results.
    NOTE: You should probably create a login that you will use to connect to =
    the database from your web app. If you are planning on using stored =
    procedures (a good idea, by the way) they will not need any permissions =
    in the database (other than "execute" on the stored procedures used by =
    your app).
    --=20
    Keith
    "Dale" <anonymous@.discussions.microsoft.com> wrote in message =
    news:1025EFC0-546F-4F76-96CD-75B12AA30E03@.microsoft.com...
    > Hello,=20
    >=20
    > I'm putting together an ASP.NET web form (using VB.NET) and the DB I'm =
    trying to do an insert to can't validate my login. I've verified that =
    the account does have permissions to access the SQL DB and that =
    everything is granted as far as the INSERT, UPDATE, etc...=20
    >=20
    > I have my SQL Server (SQL2K) set up for mixed authentication (both SQL =
    and Windows).=20
    >=20
    > I've tried all the suggestions from the "connectionstrings.com" =
    website and I'm still getting errors stating that the login failed.=20
    >=20
    > Here is a copy of the error:=20
    > Login failed for user '(null)'. Reason: Not associated with a trusted =
    SQL Server connection.=20
    >=20
    > The above error is happening when I use the connection string of:=20
    > "server=3DMyServer;Initial Catalog=3DMyDatabase;Integrated =
    Security=3DTRUE"=20
    >=20
    > I get the same thing when I use "Integrated Security=3DSSPI" as well.=20
    >=20
    > Here is the error I get when I try to use a user id:=20
    > Login failed for user '{user name}'.=20
    >=20
    > The funny thing about it is that the user name specified above is the =
    DBO and it is still rejected.=20
    >=20
    > One last question; have you ever wanted to give up with computers and =
    go back to pen and paper? =20
    >=20
    > Any futher suggestions would be really great! I really appreciate =
    it...=20
    >=20
    > Dale
    |||The login failed for user NULL indicates that the account that is
    attempting to make the connection is unknown to SQL Server. Look at the IIS
    configuration to verify that the user that IIS is using has a login at the
    SQL Server. If you are using anonymous access and the IIS machine is on a
    separate machine the NT authentication will generate the Login failed for
    user NULL.
    I would look at articles:
    PRB: ASP/ODBC/SQL Server Error 0x80040E4D "Login Failed for User '(Null)'"
    http://support.microsoft.com/?id=307002
    INF: Authentication Methods for Connections to SQL Server in Active Server
    Pages
    http://support.microsoft.com/?id=247931
    Rand
    This posting is provided "as is" with no warranties and confers no rights.
    |||The problem you are having may be related to how you've configured
    your asp.net application. The app may in fact be attempting to connect
    using the aspnet process model account unless you've configured IIS to
    use impersonation. There's a pretty good "asp.net security best
    practices" whitepaper that bears reading:
    http://www.microsoft.com/downloads/r...eleaseID=44047
    Your machine.config file has the settings you are using in the
    <processModel> section -- the default is to have userName="machine",
    which means that the aspnet windows account is being used.
    In the meantime, try enabling the aspnet windows login in SQLS and
    give it the necessary database access. This should work with the
    integrated security=sspi setting in your connection string.
    --Mary
    On Fri, 16 Apr 2004 10:06:03 -0700, "Dale"
    <anonymous@.discussions.microsoft.com> wrote:

    >Hello,
    >I'm putting together an ASP.NET web form (using VB.NET) and the DB I'm trying to do an insert to can't validate my login. I've verified that the account does have permissions to access the SQL DB and that everything is granted as far as the INSERT, UPDAT
    E, etc...
    >I have my SQL Server (SQL2K) set up for mixed authentication (both SQL and Windows).
    >I've tried all the suggestions from the "connectionstrings.com" website and I'm still getting errors stating that the login failed.
    >Here is a copy of the error:
    >Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
    >The above error is happening when I use the connection string of:
    >"server=MyServer;Initial Catalog=MyDatabase;Integrated Security=TRUE"
    >I get the same thing when I use "Integrated Security=SSPI" as well.
    >Here is the error I get when I try to use a user id:
    >Login failed for user '{user name}'.
    >The funny thing about it is that the user name specified above is the DBO and it is still rejected.
    >One last question; have you ever wanted to give up with computers and go back to pen and paper?
    >Any futher suggestions would be really great! I really appreciate it...
    >Dale