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

Monday, March 12, 2012

Query to import all?

Hi all,

[SQL Server 2005]

I just moved to SQL 2005 developer edition & was trying to figure out how to import all objects (all tables, views & stored procedures ... are the main ones I need at the moment) into a DB from SQL 2k ?

There's an option to chose "Write Query to ..." in the Import Wizard, but I'm not good at all at SQL or is there an option/tool to help me out w/ this.

Could someone please point me in the right direction if this has been posted before, or if you have a Script that does this, thanks much appreciated.Use the > Tasks > Generate Scripts > method on the database node.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||

You can also use Backup/Resotre method if you want exact replica of the SQL Server 2000 database.... Another option is Copy Database Wizards ...

Madhu

Query to get name of views which reference a give column from a ta

Hi
Can somebody give me a query to find the name of all the views which referen
ce
a give column name of a table
ex: i want to find names of all views which have the column account_type
from the table accounts.
Thanks
RodgerRodger,
check view INFORMATION_SCHEMA.COLUMNS
Example:
use northwind
go
declare @.cn sysname
set @.cn = N'OrderID'
select TABLE_NAME
from INFORMATION_SCHEMA.COLUMNS
where COLUMN_NAME = @.cn and
objectproperty(object_id('[' + TABLE_SCHEMA + '].[' + TABLE_NAME + ']'),
'IsView') = 1
go
AMB
"Rodger" wrote:

> Hi
> Can somebody give me a query to find the name of all the views which refer
ence
> a give column name of a table
> ex: i want to find names of all views which have the column account_type
> from the table accounts.
> Thanks
> Rodger

Query to get name of views which reference a give column from

I have 3 to 4 tables with the same column names, so it displays views for al
l
the tables ,
any additions '
Thanks a Lot
"Alejandro Mesa" wrote:
> Rodger,
> check view INFORMATION_SCHEMA.COLUMNS
> Example:
> use northwind
> go
> declare @.cn sysname
> set @.cn = N'OrderID'
> select TABLE_NAME
> from INFORMATION_SCHEMA.COLUMNS
> where COLUMN_NAME = @.cn and
> objectproperty(object_id('[' + TABLE_SCHEMA + '].[' + TABLE_NAME + ']'),
> 'IsView') = 1
> go
>
> AMB
> "Rodger" wrote:
>use information_Schema.view_column_usage
"Rodger" wrote:
> I have 3 to 4 tables with the same column names, so it displays views for
all
> the tables ,
> any additions '
> Thanks a Lot
> "Alejandro Mesa" wrote:
>|||It worked...great... never tried these wonderful views.
Thanks
rodger
"Omnibuzz" wrote:
> use information_Schema.view_column_usage
> "Rodger" wrote:
>|||Check out all the view in INFORMATION_SCHEMA. if you are interested. gives a
lot of metadata. And if you have no further questions can you close this
thred.
Thanks
Omnibuzz
"Rodger" wrote:
> It worked...great... never tried these wonderful views.
> Thanks
> rodger
> "Omnibuzz" wrote:
>

Friday, March 9, 2012

query to find all indexed views in a database?

query to find all indexed views in a database?select name from sysobjects
where objectproperty(id, 'isindexed')=1
and xtype='V'
--
-Vishal
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:O508GIIWDHA.1896@.TK2MSFTNGP12.phx.gbl...
>

Wednesday, March 7, 2012

Query to another database

Dear all,

I have views in database that select records from a table in another database in the same server.
Can I set security in such a way for not to give direct access to the table. I know than it is possible if a table and views are in the same database and have the same owner, but I failed to get the same for different databases.

Thanks.

The following thread includes an example of how to achieve this via signed code:

controlling security through stored procedures -- 2005 behaviour


Also, for another option, search for "cross database ownership chaining" in Books Online. There is a server option that enables this. BOL contains information on it.

Thanks
Laurentiu

|||Thank you

Query Timeout in SSAS

I am using Sql 2005 SSAS. When building the Data Source Views using "Edit Named Query", the data source is pointed to a Sql 7.0 server. When I tried to execute the query, it terminates after 30 seconds with "Query Timeout Expired".

Try editing the DataSource object for your SQL 7.0.

You should be able to change query timeout. I beleive it is part of the connection string.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.