Showing posts with label views. Show all posts
Showing posts with label views. Show all posts

Sunday, March 25, 2012

Can not create views, tables etc * URGENT*

Hi,

I am not getting option as 'new view' and 'new table' when I right
click on
views and tables option in VisualStudio.net IDE server explorer
sqlservers database to create new objects.

Looks like some setup issue in my database.

Thanks for your help in advance.

Rgds
CVCV (chaitu_m7@.yahoo.co.in) writes:
> I am not getting option as 'new view' and 'new table' when I right
> click on
> views and tables option in VisualStudio.net IDE server explorer
> sqlservers database to create new objects.
> Looks like some setup issue in my database.

Does this happen in every database, including tempdb? How do you connect
to the server? I don't use VS .Net to access SQL Server normally, so I
don't have much idea what it could be, but one possibility is that the
you don't have rights to create new objects in the database in question.

Personally, I prefer to use Query Analyzer to create tables, using
the CREATE TABLE statement, and this is also what I recommend in general.
In the long run, you are more effective with this than using a graphic
tool. Also, this is the only option if you want to put you tables under
source control - which you should.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.aspsql

Can not copy view

I have a replication job that can not replicate a view. Any ideas? I am
assuming the replication job relicates views that are associated with the
tables. Is there a way to only replicate the table and not the view?
I'm not sure I follow this Do you get an error when replicating the view?
If so, please can you post it up. If you just want to replicate the table
and not the view, sp_dropsubscription and sp_droparticle should do it for
you eg
sp_dropsubscription @.publication = 'northwindxxx'
, @.article = 'regionview'
, @.subscriber = 'pll-lt-16'
sp_droparticle @.publication = 'northwindxxx'
, @.article = 'regionview'
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)1

Wednesday, March 7, 2012

Can I use SQL Express for a large website?

I run a tutorial website with average 50,000 page views per day and hoping to
grow this number to 100,000 per day in next 1 year. Currently, I use MS
Access database and lot of caching in the web site for performance reasons.
Can I use SQL 2005 Express for such a good traffic web site? Does SQL 2005
express support that much hits? I can continue to use lot of caching to avoid
too many hits to database.
Sounds like a good fit., but it is difficult to talk about specific numbers
or metrics. Sql Express should outperform anything you are able to do with
Access. Sql Express will only utilize a single processor and 1gb of ram.
Databases are limited to 4gb in size.
-A
"ToJo" <ToJo@.discussions.microsoft.com> wrote in message
news:C32CCA39-1E40-4862-AE8C-57833F50459F@.microsoft.com...
> I run a tutorial website with average 50,000 page views per day and hoping
to
> grow this number to 100,000 per day in next 1 year. Currently, I use MS
> Access database and lot of caching in the web site for performance
reasons.
> Can I use SQL 2005 Express for such a good traffic web site? Does SQL 2005
> express support that much hits? I can continue to use lot of caching to
avoid
> too many hits to database.

Friday, February 24, 2012

can I specify timout for views/sp?

Hi,
I have some queries in my sql 2000 server that need a long timout (>60
sec.). Is there a way to specify a timeout for a view or stored procedure
that returns a recordset?
Will the ADO Connection.CommandTimeout solve my problem (can I set this just
before executing the query)? MSDN tells me in Q190606 to use an
asynchrounous query for executing long time queries (because of a bug in the
Connection.CommandTimeout property), but my component is running in an ASP
application, so a timer to check the execution status is not really easy to
implement.
Thanks for your time,
SvenSven,
According to this KB note http://tinyurl.com/j23d you may need to use the
Command.CommandTimeout instead of the Connection.CommandTimeout. It says
"the Command object does not pickup the Connection's CommandTimeout
setting."
This is specific to a command issued from your application. There is no way
to set a timeout for a specific view or stored procedure.
Russell Fields
"Sven Erik Matzen" <sven.matzen@.dontspamme.com> wrote in message
news:ODf1KEyWDHA.1680@.tk2msftngp13.phx.gbl...
> Hi,
> I have some queries in my sql 2000 server that need a long timout (>60
> sec.). Is there a way to specify a timeout for a view or stored procedure
> that returns a recordset?
> Will the ADO Connection.CommandTimeout solve my problem (can I set this
just
> before executing the query)? MSDN tells me in Q190606 to use an
> asynchrounous query for executing long time queries (because of a bug in
the
> Connection.CommandTimeout property), but my component is running in an ASP
> application, so a timer to check the execution status is not really easy
to
> implement.
> Thanks for your time,
> Sven
>|||Will the Connection.CommandTimeout work when using the Recordset object with
the connection? I currently don't have a command object.
"Russell Fields" <rlfields@.sprynet.com> wrote in message
news:#1TfuC2WDHA.1384@.TK2MSFTNGP10.phx.gbl...
> Sven,
> According to this KB note http://tinyurl.com/j23d you may need to use the
> Command.CommandTimeout instead of the Connection.CommandTimeout. It says
> "the Command object does not pickup the Connection's CommandTimeout
> setting."
> This is specific to a command issued from your application. There is no
way
> to set a timeout for a specific view or stored procedure.
> Russell Fields
> "Sven Erik Matzen" <sven.matzen@.dontspamme.com> wrote in message
> news:ODf1KEyWDHA.1680@.tk2msftngp13.phx.gbl...
> > Hi,
> >
> > I have some queries in my sql 2000 server that need a long timout (>60
> > sec.). Is there a way to specify a timeout for a view or stored
procedure
> > that returns a recordset?
> >
> > Will the ADO Connection.CommandTimeout solve my problem (can I set this
> just
> > before executing the query)? MSDN tells me in Q190606 to use an
> > asynchrounous query for executing long time queries (because of a bug in
> the
> > Connection.CommandTimeout property), but my component is running in an
ASP
> > application, so a timer to check the execution status is not really easy
> to
> > implement.
> >
> > Thanks for your time,
> > Sven
> >
> >
>

Sunday, February 19, 2012

Can I show my SQL Server Views on a Web Page

Can i show my view data on a web page is it possible.How can i show the data if it is too large.You can select from views just like tables. You might want to look at paging in the GridView control.

Sunday, February 12, 2012

can i make one query out of these two?

i have two views. the first finds related images for products, but only if the image is the primary image. here it is:

CREATE VIEW images AS
SELECT
p.product_id,
pI.productImage_title as productImage_title
FROM
dbo.products p INNER JOIN
dbo.productImages pI ON p.product_id = pI.product_id
WHERE pI.productImage_primary = 1

the second view gets all the products, and uses the first view to find an image, if there is one:

SELECT
p.product_id as product_id,
p.product_partNumber as part_number,
p.product_name as product_name,
i.productImage_title as small_image,
FROM
dbo.products p LEFT OUTER JOIN
dbo.images i ON p.product_id = i.product_id

i would like to be able to do this with just one view. i'm not sure how to do it though while still limiting the images to only primary ones.

thanks for any help :)If this in Oracle, you could use inline views as follows :

SELECT
p.product_id as product_id,
p.product_partNumber as part_number,
p.product_name as product_name,
i.productImage_title as small_image,
FROM
dbo.products p,
(SELECT p.product_id,
pI.productImage_title as productImage_title
FROM dbo.products p INNER JOIN
dbo.productImages pI ON p.product_id = pI.product_id
WHERE pI.productImage_primary = 1) i
WHERE p.product_id = i.product_id(+)

Originally posted by kfenstad
i have two views. the first finds related images for products, but only if the image is the primary image. here it is:

CREATE VIEW images AS
SELECT
p.product_id,
pI.productImage_title as productImage_title
FROM
dbo.products p INNER JOIN
dbo.productImages pI ON p.product_id = pI.product_id
WHERE pI.productImage_primary = 1

the second view gets all the products, and uses the first view to find an image, if there is one:

SELECT
p.product_id as product_id,
p.product_partNumber as part_number,
p.product_name as product_name,
i.productImage_title as small_image,
FROM
dbo.products p LEFT OUTER JOIN
dbo.images i ON p.product_id = i.product_id

i would like to be able to do this with just one view. i'm not sure how to do it though while still limiting the images to only primary ones.

thanks for any help :)|||i am working in SQL server.|||Sorry, I cant help you with exact syntax but SQL Server also supports inline views -- dont know which version. May be, you can look into the documentation.

Originally posted by kfenstad
i am working in SQL server.