Showing posts with label connected. Show all posts
Showing posts with label connected. Show all posts

Wednesday, March 21, 2012

Queries??

I'm confused.

I am creating a interaction application for alton towers available through a website (using asp.net). This website is connected to a database(sql server 2000) containing infomation on different shops, rides, restaurants and facilities at the park.

I have inputted data to my database. The user should be able to do searches such as:
rides (and shops or all) available in a certain area.
rides in a certain area above a certain height rescrictions.
etc

I'm confused. I have used SQL statements before and I know it is possible to retrieve this information from the database, but how should I go about this and how should I be storing this information so that I am able to call it from the front teir.

I have read up on views, stored procedures and triggers and I'm a bit lost. Should I be creating all the possible queries and then store them as a view (or stored procedure) I thought I would just have to write a sql statement but it seems a lot more confusing...

and what about triggers and user defined statements??

PLEASE help, I have a deadline in a week : (

THANK YOUOriginally posted by asbirpam
I have a deadline in a week : (

Not much time for QA, huh...

Use stored procedures

CREATE PROC mySproc99
@.key int
AS
SELECT Col_list* FROM myTable99 WHERE Key = myKey99**
GO

EXEC mySproc99 value
GO

* Supply the columns you need from the table

** Supply the name of the key colmn and the value you need to select...

Good luck...

Come back with more specific info if you need help

Monday, March 12, 2012

quality of service

I have been having what I believe to be quality of service issues with the c
ompany that hosts my company's web site and connected SQL Server database.
The same stored procedure is called from a number of different web pages wit
h identical parameter specs
, etc. (they were all created from the same template web page). Over the pa
st three weeks, this stored procedure has been called more than 20,000 times
by more than 1,000 different end users, and has failed to drop a table it c
reates 70 of these times (a
99.7% successful execution rate), which causes significant problems for the
end user, since the next time this procedure is called, the table already ex
ists. There is seemingly no pattern to these failed executions with regard
to particular end users, o
r to which pages from which they were called. However, there is a pattern i
n the timing. All but 4 of the failed executions occurred clustered around
about 10 very specific time stamps (i.e., 5 of the tables that were not drop
ped were created within a m
inute of 2:27 pm, 15 of the tables that were not dropped were created within
1 minute of 2:27 pm, etc.). The company that hosts my web site and connect
ed SQL Server database insists that the problem is in my scripting and refus
e to look into the issue un
less I pay them $120 per hour to do so. It seems to me that, if this were s
cripting error, it probably would not be succeeding 99.7% of the time, and a
ny failures that did occur would be randomly distributed, not clustered arou
nd specific time stamps. I
t seems to me that this clustering is indicative of slowed or failed SQL Ser
ver responses due to server performance issues. I work in statistics and ha
ve calculated the odds of this time clustering being random, and, even with
the most conservative estim
ates, it works out to be on in a number I don't even know the name for (with
more than 40 zeros). I have included a little information about the stored
procedure below, if you think it is relevant. my question to you is: Does t
his seem likely to be a scr
ipting issue or a server performance issue?
Part of the stored procedure uses the sp_executesql command with a text stri
ng to create a table with the unique name of the end user ID (a unique, rand
omly generated 12 character alphanumeric ID), inserts data into this new tab
le through a loop, then pul
ls a record set from the table, and drops the table (there is a good reason
I need to generate the recordset this way).
Thank you for your help!
SQL SearcherWhy can't you use a temp table? That's what they're there for...
"SQL Searcher" <anonymous@.discussions.microsoft.com> wrote in message
news:FB3A473E-7ED7-4E01-A8F9-95F7ABA12313@.microsoft.com...
> I have been having what I believe to be quality of service issues with the
company that hosts my company's web site and connected SQL Server database.
The same stored procedure is called from a number of different web pages
with identical parameter specs, etc. (they were all created from the same
template web page). Over the past three weeks, this stored procedure has
been called more than 20,000 times by more than 1,000 different end users,
and has failed to drop a table it creates 70 of these times (a 99.7%
successful execution rate), which causes significant problems for the end
user, since the next time this procedure is called, the table already
exists. There is seemingly no pattern to these failed executions with
regard to particular end users, or to which pages from which they were
called. However, there is a pattern in the timing. All but 4 of the failed
executions occurred clustered around about 10 very specific time stamps
(i.e., 5 of the tables that were not dropped were created within a minute of
2:27 pm, 15 of the tables that were not dropped were created within 1 minute
of 2:27 pm, etc.). The company that hosts my web site and connected SQL
Server database insists that the problem is in my scripting and refuse to
look into the issue unless I pay them $120 per hour to do so. It seems to
me that, if this were scripting error, it probably would not be succeeding
99.7% of the time, and any failures that did occur would be randomly
distributed, not clustered around specific time stamps. It seems to me that
this clustering is indicative of slowed or failed SQL Server responses due
to server performance issues. I work in statistics and have calculated the
odds of this time clustering being random, and, even with the most
conservative estimates, it works out to be on in a number I don't even know
the name for (with more than 40 zeros). I have included a little information
about the stored procedure below, if you think it is relevant. my question
to you is: Does this seem likely to be a scripting issue or a server
performance issue?
> Part of the stored procedure uses the sp_executesql command with a text
string to create a table with the unique name of the end user ID (a unique,
randomly generated 12 character alphanumeric ID), inserts data into this new
table through a loop, then pulls a record set from the table, and drops the
table (there is a good reason I need to generate the recordset this way).
> Thank you for your help!
> SQL Searcher|||I tried, and it didn't work for some reason.

quality of service

I have been having what I believe to be quality of service issues with the company that hosts my company's web site and connected SQL Server database. The same stored procedure is called from a number of different web pages with identical parameter specs, etc. (they were all created from the same template web page). Over the past three weeks, this stored procedure has been called more than 20,000 times by more than 1,000 different end users, and has failed to drop a table it creates 70 of these times (a 99.7% successful execution rate), which causes significant problems for the end user, since the next time this procedure is called, the table already exists. There is seemingly no pattern to these failed executions with regard to particular end users, or to which pages from which they were called. However, there is a pattern in the timing. All but 4 of the failed executions occurred clustered around about 10 very specific time stamps (i.e., 5 of the tables that were not dropped were created within a minute of 2:27 pm, 15 of the tables that were not dropped were created within 1 minute of 2:27 pm, etc.). The company that hosts my web site and connected SQL Server database insists that the problem is in my scripting and refuse to look into the issue unless I pay them $120 per hour to do so. It seems to me that, if this were scripting error, it probably would not be succeeding 99.7% of the time, and any failures that did occur would be randomly distributed, not clustered around specific time stamps. It seems to me that this clustering is indicative of slowed or failed SQL Server responses due to server performance issues. I work in statistics and have calculated the odds of this time clustering being random, and, even with the most conservative estimates, it works out to be on in a number I don't even know the name for (with more than 40 zeros). I have included a little information about the stored procedure below, if you think it is relevant. my question to you is: Does this seem likely to be a scripting issue or a server performance issue?
Part of the stored procedure uses the sp_executesql command with a text string to create a table with the unique name of the end user ID (a unique, randomly generated 12 character alphanumeric ID), inserts data into this new table through a loop, then pulls a record set from the table, and drops the table (there is a good reason I need to generate the recordset this way).
Thank you for your help
SQL SearcherWhy can't you use a temp table? That's what they're there for...
"SQL Searcher" <anonymous@.discussions.microsoft.com> wrote in message
news:FB3A473E-7ED7-4E01-A8F9-95F7ABA12313@.microsoft.com...
> I have been having what I believe to be quality of service issues with the
company that hosts my company's web site and connected SQL Server database.
The same stored procedure is called from a number of different web pages
with identical parameter specs, etc. (they were all created from the same
template web page). Over the past three weeks, this stored procedure has
been called more than 20,000 times by more than 1,000 different end users,
and has failed to drop a table it creates 70 of these times (a 99.7%
successful execution rate), which causes significant problems for the end
user, since the next time this procedure is called, the table already
exists. There is seemingly no pattern to these failed executions with
regard to particular end users, or to which pages from which they were
called. However, there is a pattern in the timing. All but 4 of the failed
executions occurred clustered around about 10 very specific time stamps
(i.e., 5 of the tables that were not dropped were created within a minute of
2:27 pm, 15 of the tables that were not dropped were created within 1 minute
of 2:27 pm, etc.). The company that hosts my web site and connected SQL
Server database insists that the problem is in my scripting and refuse to
look into the issue unless I pay them $120 per hour to do so. It seems to
me that, if this were scripting error, it probably would not be succeeding
99.7% of the time, and any failures that did occur would be randomly
distributed, not clustered around specific time stamps. It seems to me that
this clustering is indicative of slowed or failed SQL Server responses due
to server performance issues. I work in statistics and have calculated the
odds of this time clustering being random, and, even with the most
conservative estimates, it works out to be on in a number I don't even know
the name for (with more than 40 zeros). I have included a little information
about the stored procedure below, if you think it is relevant. my question
to you is: Does this seem likely to be a scripting issue or a server
performance issue?
> Part of the stored procedure uses the sp_executesql command with a text
string to create a table with the unique name of the end user ID (a unique,
randomly generated 12 character alphanumeric ID), inserts data into this new
table through a loop, then pulls a record set from the table, and drops the
table (there is a good reason I need to generate the recordset this way).
> Thank you for your help!
> SQL Searcher|||I tried, and it didn't work for some reason.

Friday, March 9, 2012

Qery Analyser - Table Access

Sql Server 2000, Win 2000
Problem accessing tables in SQL Query Analyser:-
? why can't I access the database connected as Jim ?
Created Database [SolutionsNet] - Owner Jim
Created Table [Jim.Customers] Owner Jim
Data base access Jim 'permit'
Table - Companies - permissions Jim > Select . . . [the lot]
Jim Permissions - Table Companies > Select . . . [the lot]
Jim - permit in database role > public, db_owners . . [the lot]
BUT
SQL Query Analyser
Connect as Jim
use SolutionsNet
go
select * from jim.companies
go
Server: Msg 229, Level 14, State 5, Line 1
SELECT permission denied on object 'Companies', database 'SolutionsNet',
owner 'Jim'.
[same if table is just 'companies' withot the prefix]
HOWEVER
Connect as sa
use SolutionsNet
go
select * from jim.companies
go
Fine:- displays the empty table!
? why can't I access the data connected as Jim ?
Jim Bunton
283 968
Jim Bunton wrote:
> Sql Server 2000, Win 2000
> Problem accessing tables in SQL Query Analyser:-
> ? why can't I access the database connected as Jim ?
> Created Database [SolutionsNet] - Owner Jim
> Created Table [Jim.Customers] Owner Jim
> Data base access Jim 'permit'
> Table - Companies - permissions Jim > Select . . . [the lot]
> Jim Permissions - Table Companies > Select . . . [the lot]
> Jim - permit in database role > public, db_owners . . [the lot]
> BUT
> SQL Query Analyser
> Connect as Jim
> use SolutionsNet
> go
> select * from jim.companies
> go
> Server: Msg 229, Level 14, State 5, Line 1
> SELECT permission denied on object 'Companies', database
> 'SolutionsNet', owner 'Jim'.
> [same if table is just 'companies' withot the prefix]
> HOWEVER
> Connect as sa
> use SolutionsNet
> go
> select * from jim.companies
> go
> Fine:- displays the empty table!
> ? why can't I access the data connected as Jim ?
>
> Jim Bunton
> 283 968
Because you created a table called [Jim.Customers]. What you want is a
table called [Jim].[Customers].
David Gugick
Quest Software
www.imceda.com
www.quest.com
|||Hi,
Table name is created as [Jim.Customers].
So you have to use :-
Select * from jim.[Jim.Customers]
Thanks
Hari
SQL Server MVP
"Jim Bunton" <jBunton@.BlueYonder.co.uk> wrote in message
news:4pw1f.77602$iW5.66654@.fe3.news.blueyonder.co. uk...
> Sql Server 2000, Win 2000
> Problem accessing tables in SQL Query Analyser:-
> ? why can't I access the database connected as Jim ?
> Created Database [SolutionsNet] - Owner Jim
> Created Table [Jim.Customers] Owner Jim
> Data base access Jim 'permit'
> Table - Companies - permissions Jim > Select . . . [the lot]
> Jim Permissions - Table Companies > Select . . . [the lot]
> Jim - permit in database role > public, db_owners . . [the lot]
> BUT
> SQL Query Analyser
> Connect as Jim
> use SolutionsNet
> go
> select * from jim.companies
> go
> Server: Msg 229, Level 14, State 5, Line 1
> SELECT permission denied on object 'Companies', database 'SolutionsNet',
> owner 'Jim'.
> [same if table is just 'companies' withot the prefix]
> HOWEVER
> Connect as sa
> use SolutionsNet
> go
> select * from jim.companies
> go
> Fine:- displays the empty table!
> ? why can't I access the data connected as Jim ?
>
> Jim Bunton
> 283 968
>

QA database change take too much time

Hi,
MSSQL 2K, SP4 on XP sp2
While connected to local SQL server, when I click on DatabBase drop down
Combo in Query Analyzer, it takes around 10+ seconds before displaying the
databases to select, however if I connect to another SQL server on my office
LAN, then list appears with no time.
appreciate your help to fix this.
Thanks
Falik
To add on to Kalen;
You might be you have enabled the database option "AUTOCLOSE". THis will
close
the MDF and LDF as soon as the last user logs of the database. Again the MDF
and LDF will be opened once a user logins to the database.
How to check this option is checked:-
1. Enterprise manager -- Databases -- Select the database
2. Right click and select properties -- Choose options
3. Chek whether AUTOCLOSE option is "checked". If yes then remove it
This will ensure that MDF and LDF will never closed as soon as last user
logs off.
Thanks
Hari
"Falik Sher" <faliks@.hotmail.com> wrote in message
news:%23npQHWQFHHA.5104@.TK2MSFTNGP03.phx.gbl...
> Hi,
> MSSQL 2K, SP4 on XP sp2
> While connected to local SQL server, when I click on DatabBase drop down
> Combo in Query Analyzer, it takes around 10+ seconds before displaying the
> databases to select, however if I connect to another SQL server on my
> office LAN, then list appears with no time.
> appreciate your help to fix this.
> Thanks
> Falik
>

QA database change take too much time

Hi,
MSSQL 2K, SP4 on XP sp2
While connected to local SQL server, when I click on DatabBase drop down
Combo in Query Analyzer, it takes around 10+ seconds before displaying the
databases to select, however if I connect to another SQL server on my office
LAN, then list appears with no time.
appreciate your help to fix this.
Thanks
FalikAre the databases set to autoclose on your local SQL Server?
HTH
Kalen Delaney, SQL Server MVP
http://sqlblog.com
"Falik Sher" <faliks@.hotmail.com> wrote in message
news:%23npQHWQFHHA.5104@.TK2MSFTNGP03.phx.gbl...
> Hi,
> MSSQL 2K, SP4 on XP sp2
> While connected to local SQL server, when I click on DatabBase drop down
> Combo in Query Analyzer, it takes around 10+ seconds before displaying the
> databases to select, however if I connect to another SQL server on my
> office LAN, then list appears with no time.
> appreciate your help to fix this.
> Thanks
> Falik
>|||To add on to Kalen;
You might be you have enabled the database option "AUTOCLOSE". THis will
close
the MDF and LDF as soon as the last user logs of the database. Again the MDF
and LDF will be opened once a user logins to the database.
How to check this option is checked:-
1. Enterprise manager -- Databases -- Select the database
2. Right click and select properties -- Choose options
3. Chek whether AUTOCLOSE option is "checked". If yes then remove it
This will ensure that MDF and LDF will never closed as soon as last user
logs off.
Thanks
Hari
"Falik Sher" <faliks@.hotmail.com> wrote in message
news:%23npQHWQFHHA.5104@.TK2MSFTNGP03.phx.gbl...
> Hi,
> MSSQL 2K, SP4 on XP sp2
> While connected to local SQL server, when I click on DatabBase drop down
> Combo in Query Analyzer, it takes around 10+ seconds before displaying the
> databases to select, however if I connect to another SQL server on my
> office LAN, then list appears with no time.
> appreciate your help to fix this.
> Thanks
> Falik
>

QA database change take too much time

Hi,
MSSQL 2K, SP4 on XP sp2
While connected to local SQL server, when I click on DatabBase drop down
Combo in Query Analyzer, it takes around 10+ seconds before displaying the
databases to select, however if I connect to another SQL server on my office
LAN, then list appears with no time.
appreciate your help to fix this.
Thanks
FalikAre the databases set to autoclose on your local SQL Server?
--
HTH
Kalen Delaney, SQL Server MVP
http://sqlblog.com
"Falik Sher" <faliks@.hotmail.com> wrote in message
news:%23npQHWQFHHA.5104@.TK2MSFTNGP03.phx.gbl...
> Hi,
> MSSQL 2K, SP4 on XP sp2
> While connected to local SQL server, when I click on DatabBase drop down
> Combo in Query Analyzer, it takes around 10+ seconds before displaying the
> databases to select, however if I connect to another SQL server on my
> office LAN, then list appears with no time.
> appreciate your help to fix this.
> Thanks
> Falik
>|||To add on to Kalen;
You might be you have enabled the database option "AUTOCLOSE". THis will
close
the MDF and LDF as soon as the last user logs of the database. Again the MDF
and LDF will be opened once a user logins to the database.
How to check this option is checked:-
1. Enterprise manager -- Databases -- Select the database
2. Right click and select properties -- Choose options
3. Chek whether AUTOCLOSE option is "checked". If yes then remove it
This will ensure that MDF and LDF will never closed as soon as last user
logs off.
Thanks
Hari
"Falik Sher" <faliks@.hotmail.com> wrote in message
news:%23npQHWQFHHA.5104@.TK2MSFTNGP03.phx.gbl...
> Hi,
> MSSQL 2K, SP4 on XP sp2
> While connected to local SQL server, when I click on DatabBase drop down
> Combo in Query Analyzer, it takes around 10+ seconds before displaying the
> databases to select, however if I connect to another SQL server on my
> office LAN, then list appears with no time.
> appreciate your help to fix this.
> Thanks
> Falik
>