Showing posts with label view. Show all posts
Showing posts with label view. Show all posts

Thursday, March 29, 2012

Adding a static text to a report header?

Does anyone know how to add static text to the report in the same section where report parameters and View Report are located?

Thanks,

Yadgor2000

Drop a textbox in the header and type into it. Bear in mind that a rich/html textbox is not supported so you can't format individual words. Any formats and fonts will apply to the entire contents of the textbox.|||

Will the static text render before the report is run?

Thanks

YADGOR2000

|||No. When you run the report you will see the green circular loading gif and only once the report output has been generated in the RSTempDB database the report HTML will be sent to the client for output. I think you're referring to the way HTML tables get rendered as soon as the browser detects a closing </table> tag. This is not the way things work in RS.

Adding a restricted role to SQL Server 2005

I have a database and I want to grant an external user access to only one
view in my database. Using SQL Studio I generated these scripts and ran
them.
Once I did that I logged into the database as [loginExternalApp] and was
happy that I could not see any of the raw tables. But I found that I could
SELECT from all of the views in my database, not just the one I granted the
SELECT to.
What did I miss? I thought by default that the new role would have no
permissions for anything that I did not grant. It doesn't seem right that I
would need to specifically deny access to all of the views.
Any thoughts would be welcome.
Richard Speiss
Here is the script that I ran
USE [master]
GO
CREATE LOGIN [loginExternalApp] WITH PASSWORD=N'password',
DEFAULT_DATABASE=[TestDB], CHECK_EXPIRATION=OFF
GO
USE [TestDB]
GO
CREATE USER [userExternalApp] FOR LOGIN [loginExternalApp]
GO
CREATE ROLE [roleExternalApp]
GO
EXEC sp_addrolemember N'roleExternalApp', N'useExternalApp'
GO
GRANT SELECT ON [dbo].[vTestView] TO [roleExternalApp]
GOHi Richard,
Verify the permissions granted to the public role. Every user is a member of
the public role and has access to the objects granted to it.
Right-click any of these views in Management Studio, select Properties and
Permissions. See if permissions have been granted to public.
Also, you are not talking about catalog views, right?
Hope this helps,
Ben Nevarez
"Richard Speiss" wrote:
> I have a database and I want to grant an external user access to only one
> view in my database. Using SQL Studio I generated these scripts and ran
> them.
> Once I did that I logged into the database as [loginExternalApp] and was
> happy that I could not see any of the raw tables. But I found that I could
> SELECT from all of the views in my database, not just the one I granted the
> SELECT to.
> What did I miss? I thought by default that the new role would have no
> permissions for anything that I did not grant. It doesn't seem right that I
> would need to specifically deny access to all of the views.
> Any thoughts would be welcome.
> Richard Speiss
>
> Here is the script that I ran
> USE [master]
> GO
> CREATE LOGIN [loginExternalApp] WITH PASSWORD=N'password',
> DEFAULT_DATABASE=[TestDB], CHECK_EXPIRATION=OFF
> GO
> USE [TestDB]
> GO
> CREATE USER [userExternalApp] FOR LOGIN [loginExternalApp]
> GO
> CREATE ROLE [roleExternalApp]
> GO
> EXEC sp_addrolemember N'roleExternalApp', N'useExternalApp'
> GO
> GRANT SELECT ON [dbo].[vTestView] TO [roleExternalApp]
> GO
>
>|||Thanks, those views are granting 'public' accessibility (user views, not
catalog views)
I don't see an easy way to disable the 'public' role though or to get my
[userExternalApp] to not be part of 'public'.
Is there any way to disable the public role or do I need to explicitly
revoke permissions to public on each view (and/or table, etc)?
Thanks again
Richard
"Ben Nevarez" <bnevarez@.no.spam.please.sunamerica.com> wrote in message
news:449C85C5-A8D8-49F5-8480-80584D1E91CD@.microsoft.com...
> Hi Richard,
> Verify the permissions granted to the public role. Every user is a member
> of
> the public role and has access to the objects granted to it.
> Right-click any of these views in Management Studio, select Properties and
> Permissions. See if permissions have been granted to public.
> Also, you are not talking about catalog views, right?
> Hope this helps,
> Ben Nevarez
>
>
> "Richard Speiss" wrote:
>> I have a database and I want to grant an external user access to only one
>> view in my database. Using SQL Studio I generated these scripts and ran
>> them.
>> Once I did that I logged into the database as [loginExternalApp] and was
>> happy that I could not see any of the raw tables. But I found that I
>> could
>> SELECT from all of the views in my database, not just the one I granted
>> the
>> SELECT to.
>> What did I miss? I thought by default that the new role would have no
>> permissions for anything that I did not grant. It doesn't seem right
>> that I
>> would need to specifically deny access to all of the views.
>> Any thoughts would be welcome.
>> Richard Speiss
>>
>> Here is the script that I ran
>> USE [master]
>> GO
>> CREATE LOGIN [loginExternalApp] WITH PASSWORD=N'password',
>> DEFAULT_DATABASE=[TestDB], CHECK_EXPIRATION=OFF
>> GO
>> USE [TestDB]
>> GO
>> CREATE USER [userExternalApp] FOR LOGIN [loginExternalApp]
>> GO
>> CREATE ROLE [roleExternalApp]
>> GO
>> EXEC sp_addrolemember N'roleExternalApp', N'useExternalApp'
>> GO
>> GRANT SELECT ON [dbo].[vTestView] TO [roleExternalApp]
>> GO
>>

Sunday, March 25, 2012

Adding a Linked Server

HI,

There is a requirement to transfer a table data from a oracle view to a SQL Server table. These both reside on the same box. I am trying to add the oracle instance as a linked server, like this:

EXEC sp_addlinkedserver @.server = @.SOURCE_SERVER_NAME, @.srvproduct = '', @.provider = @.PROVIDER_NAME, @.datasrc = @.DATA_SOURCE_NAME

The server gets added. But When I use this string as part of a stored procedure (or even not use it there), which does the work of transfering the data as required, I get this error:

Server: Msg 7399, Level 16, State 1, Procedure UBS_PULL_HR_DATA, Line 125
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IDBInitialize::Initialize returned 0x80004005: ].

I have added this Name in the System DSM also. I dont know how to go about it. Can any one please help?

Thanks a lot and let me know if the question is not clear.

Mannu.

When the server gets added, check the security tab. I'm guessing it's blank as you aren't adding the login information. Error 0x80004005 is access is denied. That looks like it's one of the problems anyway. If you want to script the login for the linked server, you would use sp_addlinkedsrvlogin.

-Sue

|||

Hi Sue, Thanks for the reply. I have overcome this problem. However, I am now getting this error:

The operation could not be performed because the OLE DB provider 'MSDAORA' was unable to begin a distributed transaction.
OLE DB error trace [OLE/DB Provider 'MSDAORA' ITransactionJoin::JoinTransaction returned 0x8004d01b].

Any ideas to solve this? Thanks a lot.

Mannu.

sql

Adding a Linked Server

HI,

There is a requirement to transfer a table data from a oracle view to a SQL Server table. These both reside on the same box. I am trying to add the oracle instance as a linked server, like this:

EXEC sp_addlinkedserver @.server = @.SOURCE_SERVER_NAME, @.srvproduct = '', @.provider = @.PROVIDER_NAME, @.datasrc = @.DATA_SOURCE_NAME

The server gets added. But When I use this string as part of a stored procedure (or even not use it there), which does the work of transfering the data as required, I get this error:

Server: Msg 7399, Level 16, State 1, Procedure UBS_PULL_HR_DATA, Line 125
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IDBInitialize::Initialize returned 0x80004005: ].

I have added this Name in the System DSM also. I dont know how to go about it. Can any one please help?

Thanks a lot and let me know if the question is not clear.

Mannu.

When the server gets added, check the security tab. I'm guessing it's blank as you aren't adding the login information. Error 0x80004005 is access is denied. That looks like it's one of the problems anyway. If you want to script the login for the linked server, you would use sp_addlinkedsrvlogin.

-Sue

|||

Hi Sue, Thanks for the reply. I have overcome this problem. However, I am now getting this error:

The operation could not be performed because the OLE DB provider 'MSDAORA' was unable to begin a distributed transaction.
OLE DB error trace [OLE/DB Provider 'MSDAORA' ITransactionJoin::JoinTransaction returned 0x8004d01b].

Any ideas to solve this? Thanks a lot.

Mannu.

Tuesday, March 20, 2012

'Addding' Column In View

Hi! Here is what I need to do:
I have 2 tables; the first called "IDs" and the second called "Test".
This 'Test' doesn't have an identity field, and I need to have one to
do some filtering, but for burocracy I can't simply add another column
to the table. So, as as it is, I had to create another table
called 'IDs' with only 1 field called 'ID' filled with autogenerated
numbers from 1 to 99999999^9999 :D. Then, the thing that I can't do is
to "append" this table to the "Test".
When I do, for example:
<select IDs.id, Test.Name from IDs, test>, what I get is something
like:
id name
--
----
1 ABC
2 ABC
3 ABC
4 ABC
1 DEF
2 DEF
3 DEF
4 DEF
1 GHI
2 GHI
3 GHI
4 GHI
1 JKM
2 JKM
3 JKM
4 JKM
Notice the repetition of the values...
I would need it to be like:
id name
--
----
1 ABC
2 ABC
3 ABC
4 ABC
So... is there something I can do to get this? And also, what would
happen if one of the tables had more registries than the other? Would
it work?
Very very thanks in advance;
Bye.See if this helps:
How to dynamically number rows in a SELECT Statement
http://support.microsoft.com/defaul...kb;en-us;186133
AMB
"Dan_Aykroyd" wrote:

> Hi! Here is what I need to do:
> I have 2 tables; the first called "IDs" and the second called "Test".
> This 'Test' doesn't have an identity field, and I need to have one to
> do some filtering, but for burocracy I can't simply add another column
> to the table. So, as as it is, I had to create another table
> called 'IDs' with only 1 field called 'ID' filled with autogenerated
> numbers from 1 to 99999999^9999 :D. Then, the thing that I can't do is
> to "append" this table to the "Test".
> When I do, for example:
> <select IDs.id, Test.Name from IDs, test>, what I get is something
> like:
> id name
> --
> ----
> 1 ABC
> 2 ABC
> 3 ABC
> 4 ABC
> 1 DEF
> 2 DEF
> 3 DEF
> 4 DEF
> 1 GHI
> 2 GHI
> 3 GHI
> 4 GHI
> 1 JKM
> 2 JKM
> 3 JKM
> 4 JKM
> Notice the repetition of the values...
> I would need it to be like:
> id name
> --
> ----
> 1 ABC
> 2 ABC
> 3 ABC
> 4 ABC
> So... is there something I can do to get this? And also, what would
> happen if one of the tables had more registries than the other? Would
> it work?
> Very very thanks in advance;
> Bye.
>|||SQL2005 will have 'rownumber', which will let you do it really easily.
But for the time being, you will have to do it the nasty way.|||Wow... it wasn't as easy as I thought! :)
I thought that what I needed to do would be easy, because it
requires... "no processing"; I mean, no combination of rows, no
relations, no linking, etc etc; it's just adding a column to a view in
the way it's stored in the table...
Thanks very much Alejandro; I'm gonna read it now!
And if there's an easier way... I'd be glad to hear it ;)sql

Monday, March 19, 2012

Add Temp Parameters to a function

I am writing a set of functions and then a stored procedure to allow me to view some data in Reporting Services. I have written the first part of the function as shown ;

set ANSI_NULLS ON

set QUOTED_IDENTIFIER ON

GO

ALTER FUNCTION [dbo].[fnWTRTerrierData]

(@.vch_site_ref nvarchar (3), @.dt_src_date datetime)

RETURNS @.WeeklyTerrierRSPI TABLE

(Areacode varchar(2),siteref nvarchar(3),

estatename nvarchar(100), Securitised nvarchar(255),

unitref nvarchar(15), unittype nvarchar(30),

unittype_count int, tenantname nvarchar(100),

tenantstatus nvarchar(25), tenantstatus_count int,

unitstatus nvarchar(15), unitstatus_count int,

floortotal float, floortotocc float,

initialvacarea float, initialvacnet float,

TotalRent float, NetRent float,

FinalRtLsincSC float, DiscEndDate datetime,

ErvTot float, Leaseterm int,

leasestart datetime, rentreview nvarchar(255),

leaseend datetime, breakclause datetime,

tenancyterm datetime, landact nvarchar(255),

datadate datetime)

AS

BEGIN

INSERT @.WeeklyTerrierRSPI

SELECT Areacode, siteref, estatename, Securitised, unitref, unittype, unittype_count, tenantname,

tenantstatus, tenantstatus_count, unitstatus, unitstatus_count, floortotal, floortotocc,

initialvacarea, initialvacnet, TotalRent, NetRent, FinalRtLsincSC, DiscEndDate, ErvTot,

Leaseterm, leasestart, rentreview, leaseend, breakclause, tenancyterm, landact, datadate

FROM dbo.src_terrier

WHERE (datadate = @.dt_src_date) AND (siteref = @.vch_site_ref)

RETURN

END

I have then written a stored procedure which picks up the result set from the function and ultimately will deliver it to Reporting Services. The problem I have is that as soon as I run the CREATE PROCEDURE script, I get an error saying ;

Msg 216, Level 16, State 1, Procedure spWTRWeeklyTerrierData, Line 16

Parameters were not supplied for the function 'fnWTRTerrierData'.

How can I add parameters to the function sufficently so that I can run the Create procedure element of my code?

Regards

Post your Stored Procedure codes.|||

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE PROCEDURE [dbo].[spWTRWeeklyTerrierData]

(@.vch_site_ref nvarchar(3), @.dt_src_date datetime)

AS

BEGIN

SET NOCOUNT ON;

SELECT fnWTRTerrierData.Areacode, fnWTRTerrierData.siteref, fnWTRTerrierData.estatename, fnWTRTerrierData.Securitised, fnWTRTerrierData.unitref, fnWTRTerrierData.unittype, fnWTRTerrierData.unittype_count, fnWTRTerrierData.tenantname,fnWTRTerrierData.tenantstatus, fnWTRTerrierData.tenantstatus_count, fnWTRTerrierData.unitstatus, fnWTRTerrierData.unitstatus_count, fnWTRTerrierData.floortotal, fnWTRTerrierData.floortotocc, fnWTRTerrierData.initialvacarea, fnWTRTerrierData.initialvacnet, fnWTRTerrierData.TotalRent, fnWTRTerrierData.NetRent, fnWTRTerrierData.FinalRtLsincSC, fnWTRTerrierData.ErvTot, fnWTRTerrierData.tenancyterm, fnWTRTerrierData.landact, fnWTRTerrierData.datadate

FROM fnWTRTerrierData

RETURN

END

|||

Looking at a stored procedure I pulled over from a SQL 2000 DB, I took out the elements that seems to resemble the function side

BEGIN

SET NOCOUNT ON;

RETURN

END

But I am still met with the same parameters message when I try to execute the SQL code to create the SP.

Regards

|||

ALTER FUNCTION [dbo].[fnWTRTerrierData]

(

@.vch_site_ref nvarchar (3),

@.dt_src_date datetime

)


Your table function is expecting 2 input parameter which you did not supply.
You will need to supply these 2 value to the function
for example

SELECT ...
FROM fnWTRTerrierData ('?', '2006-01-01')

Sunday, March 11, 2012

Add table to view: only showing (All Columns)

Hi all,
I have a database created a few years ago by another team.It has gone
through upgrades and is currently SQL Server 2000 SP3 on Windows 2000 SP4.
It is performing normally, with one annoying exception:
When I use Enterprise Manager's view designer to create a new view or look
at an existing view, the tables always show only 1 line: * (All Columns).
The individual column names are not showing.This is true for all tables and
views, including a new test table I just created.
The problem only occurs with this database. It also occurs on other servers.
DBCC CHECKDB did not report anything unusual.
What can I do to make the column names appear again? Please let me know if
I should report any other information to diagnose this issue.
Thanks,
-Tom.
P.S.:
I *can* force columns to show with a syntax like this:
SELECT *
FROM (SELECT Col1, Col2
FROM tblTest) DERIVEDTBL
but that's hardly what I should have to do.Is it only the view/query designer which has this problem? Perhaps there's
some strange database setting in play here... What is the compatibility
level of the database?
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in message
news:1027hviq64k8e35@.corp.supernews.com...
> Hi all,
> I have a database created a few years ago by another team.It has gone
> through upgrades and is currently SQL Server 2000 SP3 on Windows 2000 SP4.
> It is performing normally, with one annoying exception:
> When I use Enterprise Manager's view designer to create a new view or look
> at an existing view, the tables always show only 1 line: * (All Columns).
> The individual column names are not showing.This is true for all tables
and
> views, including a new test table I just created.
> The problem only occurs with this database. It also occurs on other
servers.
> DBCC CHECKDB did not report anything unusual.
> What can I do to make the column names appear again? Please let me know
if
> I should report any other information to diagnose this issue.
> Thanks,
> -Tom.
> P.S.:
> I *can* force columns to show with a syntax like this:
> SELECT *
> FROM (SELECT Col1, Col2
> FROM tblTest) DERIVEDTBL
> but that's hardly what I should have to do.
>|||Hi Tibor,
"only"? What other viewer are you referring to? The Diagrams are normal.
Compatibility level is 80 for all databases, as reported by sp_helpdb.
-Tom.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:ODekOPN7DHA.2392@.TK2MSFTNGP11.phx.gbl...
> Is it only the view/query designer which has this problem? Perhaps there's
> some strange database setting in play here... What is the compatibility
> level of the database?
> --
> Tibor Karaszi, SQL Server MVP
> Archive at:
>
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
>
> "Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in message
> news:1027hviq64k8e35@.corp.supernews.com...
> > Hi all,
> > I have a database created a few years ago by another team.It has gone
> > through upgrades and is currently SQL Server 2000 SP3 on Windows 2000
SP4.
> > It is performing normally, with one annoying exception:
> > When I use Enterprise Manager's view designer to create a new view or
look
> > at an existing view, the tables always show only 1 line: * (All
Columns).
> > The individual column names are not showing.This is true for all tables
> and
> > views, including a new test table I just created.
> > The problem only occurs with this database. It also occurs on other
> servers.
> > DBCC CHECKDB did not report anything unusual.
> > What can I do to make the column names appear again? Please let me know
> if
> > I should report any other information to diagnose this issue.
> > Thanks,
> > -Tom.
> >
> > P.S.:
> > I *can* force columns to show with a syntax like this:
> > SELECT *
> > FROM (SELECT Col1, Col2
> > FROM tblTest) DERIVEDTBL
> > but that's hardly what I should have to do.
> >
> >
>|||No viewer in particular, just other GUI tools in general. I'm trying to
pinpoint what might be the problem. So, you are saying that you run EM on a
machine. From that machine, the query builder doesn't show the column names
for the tables in one of your databases, even if you create new tables. But
of you create another database and create tables in that database, you will
see the column in that. Is this a correct description?
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in message
news:1027j8k4od20t23@.corp.supernews.com...
> Hi Tibor,
> "only"? What other viewer are you referring to? The Diagrams are normal.
> Compatibility level is 80 for all databases, as reported by sp_helpdb.
> -Tom.
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in
> message news:ODekOPN7DHA.2392@.TK2MSFTNGP11.phx.gbl...
> > Is it only the view/query designer which has this problem? Perhaps
there's
> > some strange database setting in play here... What is the compatibility
> > level of the database?
> >
> > --
> > Tibor Karaszi, SQL Server MVP
> > Archive at:
> >
>
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
> >
> >
> > "Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in
message
> > news:1027hviq64k8e35@.corp.supernews.com...
> > > Hi all,
> > > I have a database created a few years ago by another team.It has gone
> > > through upgrades and is currently SQL Server 2000 SP3 on Windows 2000
> SP4.
> > > It is performing normally, with one annoying exception:
> > > When I use Enterprise Manager's view designer to create a new view or
> look
> > > at an existing view, the tables always show only 1 line: * (All
> Columns).
> > > The individual column names are not showing.This is true for all
tables
> > and
> > > views, including a new test table I just created.
> > > The problem only occurs with this database. It also occurs on other
> > servers.
> > > DBCC CHECKDB did not report anything unusual.
> > > What can I do to make the column names appear again? Please let me
know
> > if
> > > I should report any other information to diagnose this issue.
> > > Thanks,
> > > -Tom.
> > >
> > > P.S.:
> > > I *can* force columns to show with a syntax like this:
> > > SELECT *
> > > FROM (SELECT Col1, Col2
> > > FROM tblTest) DERIVEDTBL
> > > but that's hardly what I should have to do.
> > >
> > >
> >
> >
>|||Yes, that's correct. But note that I created this db from a backup from my
ISP's SQL Server. I'm assuming that the imperfections came with the backup
and are not native to my Server. At the ISP they see the same behavior.
Additionally, if I use an Access 2000 ADP to create a view or inspect an
existing one, I get the same behavior.
-Tom.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23eqDG$N7DHA.712@.tk2msftngp13.phx.gbl...
> No viewer in particular, just other GUI tools in general. I'm trying to
> pinpoint what might be the problem. So, you are saying that you run EM on
a
> machine. From that machine, the query builder doesn't show the column
names
> for the tables in one of your databases, even if you create new tables.
But
> of you create another database and create tables in that database, you
will
> see the column in that. Is this a correct description?
> --
> Tibor Karaszi, SQL Server MVP
> Archive at:
>
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
>
> "Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in message
> news:1027j8k4od20t23@.corp.supernews.com...
> > Hi Tibor,
> > "only"? What other viewer are you referring to? The Diagrams are
normal.
> > Compatibility level is 80 for all databases, as reported by sp_helpdb.
> > -Tom.
> >
> >
> > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
> in
> > message news:ODekOPN7DHA.2392@.TK2MSFTNGP11.phx.gbl...
> > > Is it only the view/query designer which has this problem? Perhaps
> there's
> > > some strange database setting in play here... What is the
compatibility
> > > level of the database?
> > >
> > > --
> > > Tibor Karaszi, SQL Server MVP
> > > Archive at:
> > >
> >
>
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
> > >
> > >
> > > "Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in
> message
> > > news:1027hviq64k8e35@.corp.supernews.com...
> > > > Hi all,
> > > > I have a database created a few years ago by another team.It has
gone
> > > > through upgrades and is currently SQL Server 2000 SP3 on Windows
2000
> > SP4.
> > > > It is performing normally, with one annoying exception:
> > > > When I use Enterprise Manager's view designer to create a new view
or
> > look
> > > > at an existing view, the tables always show only 1 line: * (All
> > Columns).
> > > > The individual column names are not showing.This is true for all
> tables
> > > and
> > > > views, including a new test table I just created.
> > > > The problem only occurs with this database. It also occurs on other
> > > servers.
> > > > DBCC CHECKDB did not report anything unusual.
> > > > What can I do to make the column names appear again? Please let me
> know
> > > if
> > > > I should report any other information to diagnose this issue.
> > > > Thanks,
> > > > -Tom.
> > > >
> > > > P.S.:
> > > > I *can* force columns to show with a syntax like this:
> > > > SELECT *
> > > > FROM (SELECT Col1, Col2
> > > > FROM tblTest) DERIVEDTBL
> > > > but that's hardly what I should have to do.
> > > >
> > > >
> > >
> > >
> >
> >
>|||OK, the next thing I'd do is to check all the database options and see if
there are any differences between a "working" database and this one.
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in message
news:1027pld4sts7g4e@.corp.supernews.com...
> Yes, that's correct. But note that I created this db from a backup from my
> ISP's SQL Server. I'm assuming that the imperfections came with the backup
> and are not native to my Server. At the ISP they see the same behavior.
> Additionally, if I use an Access 2000 ADP to create a view or inspect an
> existing one, I get the same behavior.
> -Tom.
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in
> message news:%23eqDG$N7DHA.712@.tk2msftngp13.phx.gbl...
> > No viewer in particular, just other GUI tools in general. I'm trying to
> > pinpoint what might be the problem. So, you are saying that you run EM
on
> a
> > machine. From that machine, the query builder doesn't show the column
> names
> > for the tables in one of your databases, even if you create new tables.
> But
> > of you create another database and create tables in that database, you
> will
> > see the column in that. Is this a correct description?
> >
> > --
> > Tibor Karaszi, SQL Server MVP
> > Archive at:
> >
>
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
> >
> >
> > "Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in
message
> > news:1027j8k4od20t23@.corp.supernews.com...
> > > Hi Tibor,
> > > "only"? What other viewer are you referring to? The Diagrams are
> normal.
> > > Compatibility level is 80 for all databases, as reported by sp_helpdb.
> > > -Tom.
> > >
> > >
> > > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
wrote
> > in
> > > message news:ODekOPN7DHA.2392@.TK2MSFTNGP11.phx.gbl...
> > > > Is it only the view/query designer which has this problem? Perhaps
> > there's
> > > > some strange database setting in play here... What is the
> compatibility
> > > > level of the database?
> > > >
> > > > --
> > > > Tibor Karaszi, SQL Server MVP
> > > > Archive at:
> > > >
> > >
> >
>
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
> > > >
> > > >
> > > > "Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in
> > message
> > > > news:1027hviq64k8e35@.corp.supernews.com...
> > > > > Hi all,
> > > > > I have a database created a few years ago by another team.It has
> gone
> > > > > through upgrades and is currently SQL Server 2000 SP3 on Windows
> 2000
> > > SP4.
> > > > > It is performing normally, with one annoying exception:
> > > > > When I use Enterprise Manager's view designer to create a new view
> or
> > > look
> > > > > at an existing view, the tables always show only 1 line: * (All
> > > Columns).
> > > > > The individual column names are not showing.This is true for all
> > tables
> > > > and
> > > > > views, including a new test table I just created.
> > > > > The problem only occurs with this database. It also occurs on
other
> > > > servers.
> > > > > DBCC CHECKDB did not report anything unusual.
> > > > > What can I do to make the column names appear again? Please let
me
> > know
> > > > if
> > > > > I should report any other information to diagnose this issue.
> > > > > Thanks,
> > > > > -Tom.
> > > > >
> > > > > P.S.:
> > > > > I *can* force columns to show with a syntax like this:
> > > > > SELECT *
> > > > > FROM (SELECT Col1, Col2
> > > > > FROM tblTest) DERIVEDTBL
> > > > > but that's hardly what I should have to do.
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>|||Hi Tibor,
Thanks for hanging in there with me. You are making some good suggestions.
Not much difference in database options. I ran this:
sp_dboption 'arizonavacationvalues.com'
go
sp_dboption 'pubs'
results:
torn page detection
auto create statistics
auto update statistics
trunc. log on chkpt.
torn page detection
auto create statistics
auto update statistics
-Tom.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:O6A2oYO7DHA.1040@.TK2MSFTNGP10.phx.gbl...
> OK, the next thing I'd do is to check all the database options and see if
> there are any differences between a "working" database and this one.
> --
> Tibor Karaszi, SQL Server MVP
> Archive at:
>
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
>
> "Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in message
> news:1027pld4sts7g4e@.corp.supernews.com...
> > Yes, that's correct. But note that I created this db from a backup from
my
> > ISP's SQL Server. I'm assuming that the imperfections came with the
backup
> > and are not native to my Server. At the ISP they see the same behavior.
> >
> > Additionally, if I use an Access 2000 ADP to create a view or inspect an
> > existing one, I get the same behavior.
> >
> > -Tom.
> >
> >
> >
> > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
> in
> > message news:%23eqDG$N7DHA.712@.tk2msftngp13.phx.gbl...
> > > No viewer in particular, just other GUI tools in general. I'm trying
to
> > > pinpoint what might be the problem. So, you are saying that you run EM
> on
> > a
> > > machine. From that machine, the query builder doesn't show the column
> > names
> > > for the tables in one of your databases, even if you create new
tables.
> > But
> > > of you create another database and create tables in that database, you
> > will
> > > see the column in that. Is this a correct description?
> > >
> > > --
> > > Tibor Karaszi, SQL Server MVP
> > > Archive at:
> > >
> >
>
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
> > >
> > >
> > > "Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in
> message
> > > news:1027j8k4od20t23@.corp.supernews.com...
> > > > Hi Tibor,
> > > > "only"? What other viewer are you referring to? The Diagrams are
> > normal.
> > > > Compatibility level is 80 for all databases, as reported by
sp_helpdb.
> > > > -Tom.
> > > >
> > > >
> > > > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
> wrote
> > > in
> > > > message news:ODekOPN7DHA.2392@.TK2MSFTNGP11.phx.gbl...
> > > > > Is it only the view/query designer which has this problem? Perhaps
> > > there's
> > > > > some strange database setting in play here... What is the
> > compatibility
> > > > > level of the database?
> > > > >
> > > > > --
> > > > > Tibor Karaszi, SQL Server MVP
> > > > > Archive at:
> > > > >
> > > >
> > >
> >
>
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
> > > > >
> > > > >
> > > > > "Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in
> > > message
> > > > > news:1027hviq64k8e35@.corp.supernews.com...
> > > > > > Hi all,
> > > > > > I have a database created a few years ago by another team.It has
> > gone
> > > > > > through upgrades and is currently SQL Server 2000 SP3 on Windows
> > 2000
> > > > SP4.
> > > > > > It is performing normally, with one annoying exception:
> > > > > > When I use Enterprise Manager's view designer to create a new
view
> > or
> > > > look
> > > > > > at an existing view, the tables always show only 1 line: * (All
> > > > Columns).
> > > > > > The individual column names are not showing.This is true for all
> > > tables
> > > > > and
> > > > > > views, including a new test table I just created.
> > > > > > The problem only occurs with this database. It also occurs on
> other
> > > > > servers.
> > > > > > DBCC CHECKDB did not report anything unusual.
> > > > > > What can I do to make the column names appear again? Please let
> me
> > > know
> > > > > if
> > > > > > I should report any other information to diagnose this issue.
> > > > > > Thanks,
> > > > > > -Tom.
> > > > > >
> > > > > > P.S.:
> > > > > > I *can* force columns to show with a syntax like this:
> > > > > > SELECT *
> > > > > > FROM (SELECT Col1, Col2
> > > > > > FROM tblTest) DERIVEDTBL
> > > > > > but that's hardly what I should have to do.
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>|||I had this happen several years ago. It turned out that someone had put a
stored procedure in the database that was the same name as the stored
procedure that Enterprise Manager uses to get the Field Names. Since SQL
will pull the stored proc from the current database before it tries the
master, it was messing up Enterprise Manager. I'm sorry, I don't recall the
name of the stored proc, but maybe this will give you a starting place.
"Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in message
news:1027hviq64k8e35@.corp.supernews.com...
> Hi all,
> I have a database created a few years ago by another team.It has gone
> through upgrades and is currently SQL Server 2000 SP3 on Windows 2000 SP4.
> It is performing normally, with one annoying exception:
> When I use Enterprise Manager's view designer to create a new view or look
> at an existing view, the tables always show only 1 line: * (All Columns).
> The individual column names are not showing.This is true for all tables
and
> views, including a new test table I just created.
> The problem only occurs with this database. It also occurs on other
servers.
> DBCC CHECKDB did not report anything unusual.
> What can I do to make the column names appear again? Please let me know
if
> I should report any other information to diagnose this issue.
> Thanks,
> -Tom.
> P.S.:
> I *can* force columns to show with a syntax like this:
> SELECT *
> FROM (SELECT Col1, Col2
> FROM tblTest) DERIVEDTBL
> but that's hardly what I should have to do.
>|||Hmm, I think I'm out of ideas, then (or I need to get some sleep). However,
Joe has a very intriguing theory!
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in message
news:1027u48lpb6iac4@.corp.supernews.com...
> Hi Tibor,
> Thanks for hanging in there with me. You are making some good suggestions.
> Not much difference in database options. I ran this:
> sp_dboption 'arizonavacationvalues.com'
> go
> sp_dboption 'pubs'
> results:
> torn page detection
> auto create statistics
> auto update statistics
> trunc. log on chkpt.
> torn page detection
> auto create statistics
> auto update statistics
> -Tom.
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in
> message news:O6A2oYO7DHA.1040@.TK2MSFTNGP10.phx.gbl...
> > OK, the next thing I'd do is to check all the database options and see
if
> > there are any differences between a "working" database and this one.
> >
> > --
> > Tibor Karaszi, SQL Server MVP
> > Archive at:
> >
>
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
> >
> >
> > "Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in
message
> > news:1027pld4sts7g4e@.corp.supernews.com...
> > > Yes, that's correct. But note that I created this db from a backup
from
> my
> > > ISP's SQL Server. I'm assuming that the imperfections came with the
> backup
> > > and are not native to my Server. At the ISP they see the same
behavior.
> > >
> > > Additionally, if I use an Access 2000 ADP to create a view or inspect
an
> > > existing one, I get the same behavior.
> > >
> > > -Tom.
> > >
> > >
> > >
> > > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
wrote
> > in
> > > message news:%23eqDG$N7DHA.712@.tk2msftngp13.phx.gbl...
> > > > No viewer in particular, just other GUI tools in general. I'm trying
> to
> > > > pinpoint what might be the problem. So, you are saying that you run
EM
> > on
> > > a
> > > > machine. From that machine, the query builder doesn't show the
column
> > > names
> > > > for the tables in one of your databases, even if you create new
> tables.
> > > But
> > > > of you create another database and create tables in that database,
you
> > > will
> > > > see the column in that. Is this a correct description?
> > > >
> > > > --
> > > > Tibor Karaszi, SQL Server MVP
> > > > Archive at:
> > > >
> > >
> >
>
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
> > > >
> > > >
> > > > "Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in
> > message
> > > > news:1027j8k4od20t23@.corp.supernews.com...
> > > > > Hi Tibor,
> > > > > "only"? What other viewer are you referring to? The Diagrams are
> > > normal.
> > > > > Compatibility level is 80 for all databases, as reported by
> sp_helpdb.
> > > > > -Tom.
> > > > >
> > > > >
> > > > > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
> > wrote
> > > > in
> > > > > message news:ODekOPN7DHA.2392@.TK2MSFTNGP11.phx.gbl...
> > > > > > Is it only the view/query designer which has this problem?
Perhaps
> > > > there's
> > > > > > some strange database setting in play here... What is the
> > > compatibility
> > > > > > level of the database?
> > > > > >
> > > > > > --
> > > > > > Tibor Karaszi, SQL Server MVP
> > > > > > Archive at:
> > > > > >
> > > > >
> > > >
> > >
> >
>
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
> > > > > >
> > > > > >
> > > > > > "Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote
in
> > > > message
> > > > > > news:1027hviq64k8e35@.corp.supernews.com...
> > > > > > > Hi all,
> > > > > > > I have a database created a few years ago by another team.It
has
> > > gone
> > > > > > > through upgrades and is currently SQL Server 2000 SP3 on
Windows
> > > 2000
> > > > > SP4.
> > > > > > > It is performing normally, with one annoying exception:
> > > > > > > When I use Enterprise Manager's view designer to create a new
> view
> > > or
> > > > > look
> > > > > > > at an existing view, the tables always show only 1 line: *
(All
> > > > > Columns).
> > > > > > > The individual column names are not showing.This is true for
all
> > > > tables
> > > > > > and
> > > > > > > views, including a new test table I just created.
> > > > > > > The problem only occurs with this database. It also occurs on
> > other
> > > > > > servers.
> > > > > > > DBCC CHECKDB did not report anything unusual.
> > > > > > > What can I do to make the column names appear again? Please
let
> > me
> > > > know
> > > > > > if
> > > > > > > I should report any other information to diagnose this issue.
> > > > > > > Thanks,
> > > > > > > -Tom.
> > > > > > >
> > > > > > > P.S.:
> > > > > > > I *can* force columns to show with a syntax like this:
> > > > > > > SELECT *
> > > > > > > FROM (SELECT Col1, Col2
> > > > > > > FROM tblTest) DERIVEDTBL
> > > > > > > but that's hardly what I should have to do.
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>|||Hi Joe,
Thanks for this neat idea.
Alas:
select * from sysobjects
where [name] in (select [name] from master..sysobjects)
only results in 21 sysxxxx tables.
-Tom.
"Joe Jackson" <jj@.microsoft.com> wrote in message
news:uNoPTyP7DHA.1636@.TK2MSFTNGP12.phx.gbl...
> I had this happen several years ago. It turned out that someone had put a
> stored procedure in the database that was the same name as the stored
> procedure that Enterprise Manager uses to get the Field Names. Since SQL
> will pull the stored proc from the current database before it tries the
> master, it was messing up Enterprise Manager. I'm sorry, I don't recall
the
> name of the stored proc, but maybe this will give you a starting place.
>
> "Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in message
> news:1027hviq64k8e35@.corp.supernews.com...
> > Hi all,
> > I have a database created a few years ago by another team.It has gone
> > through upgrades and is currently SQL Server 2000 SP3 on Windows 2000
SP4.
> > It is performing normally, with one annoying exception:
> > When I use Enterprise Manager's view designer to create a new view or
look
> > at an existing view, the tables always show only 1 line: * (All
Columns).
> > The individual column names are not showing.This is true for all tables
> and
> > views, including a new test table I just created.
> > The problem only occurs with this database. It also occurs on other
> servers.
> > DBCC CHECKDB did not report anything unusual.
> > What can I do to make the column names appear again? Please let me know
> if
> > I should report any other information to diagnose this issue.
> > Thanks,
> > -Tom.
> >
> > P.S.:
> > I *can* force columns to show with a syntax like this:
> > SELECT *
> > FROM (SELECT Col1, Col2
> > FROM tblTest) DERIVEDTBL
> > but that's hardly what I should have to do.
> >
> >
>

Add table to view: only showing (All Columns)

Hi all,
I have a database created a few years ago by another team.It has gone
through upgrades and is currently SQL Server 2000 SP3 on Windows 2000 SP4.
It is performing normally, with one annoying exception:
When I use Enterprise Manager's view designer to create a new view or look
at an existing view, the tables always show only 1 line: * (All Columns).
The individual column names are not showing.This is true for all tables and
views, including a new test table I just created.
The problem only occurs with this database. It also occurs on other servers.
DBCC CHECKDB did not report anything unusual.
What can I do to make the column names appear again? Please let me know if
I should report any other information to diagnose this issue.
Thanks,
-Tom.
P.S.:
I *can* force columns to show with a syntax like this:
SELECT *
FROM (SELECT Col1, Col2
FROM tblTest) DERIVEDTBL
but that's hardly what I should have to do.Is it only the view/query designer which has this problem? Perhaps there's
some strange database setting in play here... What is the compatibility
level of the database?
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=...ublic.sqlserver
"Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in message
news:1027hviq64k8e35@.corp.supernews.com...
> Hi all,
> I have a database created a few years ago by another team.It has gone
> through upgrades and is currently SQL Server 2000 SP3 on Windows 2000 SP4.
> It is performing normally, with one annoying exception:
> When I use Enterprise Manager's view designer to create a new view or look
> at an existing view, the tables always show only 1 line: * (All Columns).
> The individual column names are not showing.This is true for all tables
and
> views, including a new test table I just created.
> The problem only occurs with this database. It also occurs on other
servers.
> DBCC CHECKDB did not report anything unusual.
> What can I do to make the column names appear again? Please let me know
if
> I should report any other information to diagnose this issue.
> Thanks,
> -Tom.
> P.S.:
> I *can* force columns to show with a syntax like this:
> SELECT *
> FROM (SELECT Col1, Col2
> FROM tblTest) DERIVEDTBL
> but that's hardly what I should have to do.
>|||Hi Tibor,
"only"? What other viewer are you referring to? The Diagrams are normal.
Compatibility level is 80 for all databases, as reported by sp_helpdb.
-Tom.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:ODekOPN7DHA.2392@.TK2MSFTNGP11.phx.gbl...
> Is it only the view/query designer which has this problem? Perhaps there's
> some strange database setting in play here... What is the compatibility
> level of the database?
> --
> Tibor Karaszi, SQL Server MVP
> Archive at:
>
http://groups.google.com/groups?oi=...ublic.sqlserver
>
> "Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in message
> news:1027hviq64k8e35@.corp.supernews.com...
SP4.
look
Columns).
> and
> servers.
> if
>|||No viewer in particular, just other GUI tools in general. I'm trying to
pinpoint what might be the problem. So, you are saying that you run EM on a
machine. From that machine, the query builder doesn't show the column names
for the tables in one of your databases, even if you create new tables. But
of you create another database and create tables in that database, you will
see the column in that. Is this a correct description?
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=...ublic.sqlserver
"Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in message
news:1027j8k4od20t23@.corp.supernews.com...
> Hi Tibor,
> "only"? What other viewer are you referring to? The Diagrams are normal.
> Compatibility level is 80 for all databases, as reported by sp_helpdb.
> -Tom.
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in
> message news:ODekOPN7DHA.2392@.TK2MSFTNGP11.phx.gbl...
there's
>
http://groups.google.com/groups?oi=...ublic.sqlserver
message
> SP4.
> look
> Columns).
tables
know
>|||Yes, that's correct. But note that I created this db from a backup from my
ISP's SQL Server. I'm assuming that the imperfections came with the backup
and are not native to my Server. At the ISP they see the same behavior.
Additionally, if I use an Access 2000 ADP to create a view or inspect an
existing one, I get the same behavior.
-Tom.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23eqDG$N7DHA.712@.tk2msftngp13.phx.gbl...
> No viewer in particular, just other GUI tools in general. I'm trying to
> pinpoint what might be the problem. So, you are saying that you run EM on
a
> machine. From that machine, the query builder doesn't show the column
names
> for the tables in one of your databases, even if you create new tables.
But
> of you create another database and create tables in that database, you
will
> see the column in that. Is this a correct description?
> --
> Tibor Karaszi, SQL Server MVP
> Archive at:
>
http://groups.google.com/groups?oi=...ublic.sqlserver
>
> "Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in message
> news:1027j8k4od20t23@.corp.supernews.com...
normal.
> in
> there's
compatibility
>
http://groups.google.com/groups?oi=...ublic.sqlserver
> message
gone
2000
or
> tables
> know
>|||OK, the next thing I'd do is to check all the database options and see if
there are any differences between a "working" database and this one.
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=...ublic.sqlserver
"Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in message
news:1027pld4sts7g4e@.corp.supernews.com...
> Yes, that's correct. But note that I created this db from a backup from my
> ISP's SQL Server. I'm assuming that the imperfections came with the backup
> and are not native to my Server. At the ISP they see the same behavior.
> Additionally, if I use an Access 2000 ADP to create a view or inspect an
> existing one, I get the same behavior.
> -Tom.
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in
> message news:%23eqDG$N7DHA.712@.tk2msftngp13.phx.gbl...
on
> a
> names
> But
> will
>
http://groups.google.com/groups?oi=...ublic.sqlserver
message
> normal.
wrote
> compatibility
>
http://groups.google.com/groups?oi=...ublic.sqlserver
> gone
> 2000
> or
other
me
>|||Hi Tibor,
Thanks for hanging in there with me. You are making some good suggestions.
Not much difference in database options. I ran this:
sp_dboption 'arizonavacationvalues.com'
go
sp_dboption 'pubs'
results:
torn page detection
auto create statistics
auto update statistics
trunc. log on chkpt.
torn page detection
auto create statistics
auto update statistics
-Tom.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:O6A2oYO7DHA.1040@.TK2MSFTNGP10.phx.gbl...
> OK, the next thing I'd do is to check all the database options and see if
> there are any differences between a "working" database and this one.
> --
> Tibor Karaszi, SQL Server MVP
> Archive at:
>
http://groups.google.com/groups?oi=...ublic.sqlserver
>
> "Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in message
> news:1027pld4sts7g4e@.corp.supernews.com...
my
backup
> in
to
> on
tables.
>
http://groups.google.com/groups?oi=...ublic.sqlserver
> message
sp_helpdb.
> wrote
>
http://groups.google.com/groups?oi=...ublic.sqlserver
view
> other
> me
>|||I had this happen several years ago. It turned out that someone had put a
stored procedure in the database that was the same name as the stored
procedure that Enterprise Manager uses to get the Field Names. Since SQL
will pull the stored proc from the current database before it tries the
master, it was messing up Enterprise Manager. I'm sorry, I don't recall the
name of the stored proc, but maybe this will give you a starting place.
"Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in message
news:1027hviq64k8e35@.corp.supernews.com...
> Hi all,
> I have a database created a few years ago by another team.It has gone
> through upgrades and is currently SQL Server 2000 SP3 on Windows 2000 SP4.
> It is performing normally, with one annoying exception:
> When I use Enterprise Manager's view designer to create a new view or look
> at an existing view, the tables always show only 1 line: * (All Columns).
> The individual column names are not showing.This is true for all tables
and
> views, including a new test table I just created.
> The problem only occurs with this database. It also occurs on other
servers.
> DBCC CHECKDB did not report anything unusual.
> What can I do to make the column names appear again? Please let me know
if
> I should report any other information to diagnose this issue.
> Thanks,
> -Tom.
> P.S.:
> I *can* force columns to show with a syntax like this:
> SELECT *
> FROM (SELECT Col1, Col2
> FROM tblTest) DERIVEDTBL
> but that's hardly what I should have to do.
>|||Hmm, I think I'm out of ideas, then (or I need to get some sleep). However,
Joe has a very intriguing theory!
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=...ublic.sqlserver
"Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in message
news:1027u48lpb6iac4@.corp.supernews.com...
> Hi Tibor,
> Thanks for hanging in there with me. You are making some good suggestions.
> Not much difference in database options. I ran this:
> sp_dboption 'arizonavacationvalues.com'
> go
> sp_dboption 'pubs'
> results:
> torn page detection
> auto create statistics
> auto update statistics
> trunc. log on chkpt.
> torn page detection
> auto create statistics
> auto update statistics
> -Tom.
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in
> message news:O6A2oYO7DHA.1040@.TK2MSFTNGP10.phx.gbl...
if
>
http://groups.google.com/groups?oi=...ublic.sqlserver
message
from
> my
> backup
behavior.
an
wrote
> to
EM
column
> tables.
you
>
http://groups.google.com/groups?oi=...ublic.sqlserver
> sp_helpdb.
Perhaps
>
http://groups.google.com/groups?oi=...ublic.sqlserver
in
has
Windows
> view
(All
all
let
>|||Hi Joe,
Thanks for this neat idea.
Alas:
select * from sysobjects
where [name] in (select [name] from master..sysobjects)
only results in 21 sysxxxx tables.
-Tom.
"Joe Jackson" <jj@.microsoft.com> wrote in message
news:uNoPTyP7DHA.1636@.TK2MSFTNGP12.phx.gbl...
> I had this happen several years ago. It turned out that someone had put a
> stored procedure in the database that was the same name as the stored
> procedure that Enterprise Manager uses to get the Field Names. Since SQL
> will pull the stored proc from the current database before it tries the
> master, it was messing up Enterprise Manager. I'm sorry, I don't recall
the
> name of the stored proc, but maybe this will give you a starting place.
>
> "Tom van Stiphout" <no.spam.tvanstiphout@.kinetik-it.com> wrote in message
> news:1027hviq64k8e35@.corp.supernews.com...
SP4.
look
Columns).
> and
> servers.
> if
>

Saturday, February 25, 2012

Add indexed view will suppress the after trigger to get fired.

Problem: Add indexed view will suppress the after trigger to get fired.
Step to Reproduce:
Create TableA, TableB, TableC and TableD with after trigger in each one.
TableA is parent table for TableB with Foreign key Cascade Delete.
TableB is parent table for TableC with Foreign key Cascade Delete.
TableC is parent table for TableD with Foreign key Cascade Delete.
Test Case 1.
Delete from TableA
TableA, TableB, TableC, and TableD's After delete trigger will get fired cor
rectly.
Test Case 2.
Add indexed view in TableC
Delete from TableA
TableA, TableB, and TableD's After delete trigger will get fired correctly
but miss TableC's After trigger.
If anyone has any suggestion, that will be appreciated.
----
--
-- Sample sql
----
--
-- Clean Out
IF OBJECT_ID (N'[dbo].[TableC_VW]') IS NOT NULL
DROP View [dbo].[TableC_VW]
GO
IF OBJECT_ID (N'TableD') IS NOT NULL
DROP TABLE TableD
GO
IF OBJECT_ID (N'TableC') IS NOT NULL
DROP TABLE TableC
GO
IF OBJECT_ID (N'TableB') IS NOT NULL
DROP TABLE TableB
GO
IF OBJECT_ID (N'TableA') IS NOT NULL
DROP TABLE TableA
GO
Create TABLE TableA
(
ID int not null,
dummy1 varchar(20) null default 'dummy1',
dummy2 varchar(20) null default 'dummy2',
dummy3 varchar(20) null default 'dummy3',
CONSTRAINT [PK-TableA_-ID] PRIMARY KEY CLUSTERED ( [ID] )
)
GO
CREATE TRIGGER [dbo].[TableA_Delete]
ON [dbo].[TableA]
AFTER DELETE
AS
begin
print 'Trigger TableA_Delete'
end
GO
Create TABLE TableB
(
ID int not null,
TableAId int null,
dummy1 varchar(20) null default 'dummy1',
dummy2 varchar(20) null default 'dummy2',
dummy3 varchar(20) null default 'dummy3',
CONSTRAINT [UK-TableB-ID] Unique ( [ID] ),
CONSTRAINT [FK-TableB-TableAId_TableA-ID]
FOREIGN KEY ( [TableAId] ) REFERENCES [TableA] ( [ID] ) ON DELETE CASCADE
)
GO
CREATE TRIGGER [dbo].[TableB_Delete]
ON [dbo].[TableB]
AFTER DELETE
AS
begin
print 'Trigger TableB_Delete'
end
GO
Create TABLE TableC
(
ID int not null,
TableBId int null,
dummy1 varchar(20) null default 'dummy1',
dummy2 varchar(20) null default 'dummy2',
dummy3 varchar(20) null default 'dummy3',
CONSTRAINT [PK-TableC-ID] PRIMARY KEY CLUSTERED ( [ID] ),
CONSTRAINT [FK-TableC-TableBId_TableB-ID]
FOREIGN KEY ( [TableBId] ) REFERENCES [TableB] ( [ID] ) ON DELETE CASCADE
)
GO
CREATE TRIGGER [dbo].[TableC_Delete]
ON [dbo].[TableC]
AFTER DELETE
AS
begin
print 'Trigger TableC_Delete'
end
GO
Create TABLE TableD
(
ID int not null,
TableCId int null,
dummy1 varchar(20) null default 'dummy1',
dummy2 varchar(20) null default 'dummy2',
dummy3 varchar(20) null default 'dummy3',
CONSTRAINT [PK-TableD-ID] PRIMARY KEY CLUSTERED ( [ID] ),
CONSTRAINT [FK-TableD-TableCId_TableC-ID]
FOREIGN KEY ( [TableCId] ) REFERENCES [TableC] ( [ID] ) ON DELETE CASCADE
)
GO
CREATE TRIGGER [dbo].[TableD_Delete]
ON [dbo].[TableD]
AFTER DELETE
AS
begin
print 'Trigger TableD_Delete'
end
GO
----
-- Test 1 Delete from TableA without indexd view schema binding which case t
he TableC After delete trigger has fired.
----
Print 'Delete from TableA without indexd view schema binding which case the
TableC After delete trigger has fired.'
Set NoCount On
Insert Into TableA (ID) values(1)
Insert Into TableB (ID, TableAId) values(1,1)
Insert Into TableC (ID, TableBId) values(1,1)
Insert Into TableD (ID, TableCId) values(1,1)
delete from TableA
----
-- Test 2 Delete from TableA with indexd view schema binding which case the
TableC After delete trigger has not fired.
----
Print 'Test 2 Delete from TableA with indexd view schema binding which case
the TableC After delete trigger has not fired.'
Insert Into TableA (ID) values(1)
Insert Into TableB (ID, TableAId) values(1,1)
Insert Into TableC (ID, TableBId) values(1,1)
Insert Into TableD (ID, TableCId) values(1,1)
IF OBJECT_ID (N'[dbo].[TableC_VW]') IS NOT NULL
DROP View [dbo].[TableC_VW]
GO
CREATE VIEW [dbo].[TableC_VW] WITH SCHEMABINDING
AS
SELECT TableBId, C.Dummy1, C.Dummy2, C.Dummy3
FROM [dbo].TableC C inner join [dbo].TableB B on B.ID = B.TableAId
WHERE TableBID Is Not Null
GO
CREATE UNIQUE CLUSTERED INDEX [IX_TableC_VW]
ON [dbo].[TableC_VW] (TableBID, Dummy1,Dummy2,Dummy3)
Go
delete from TableA
----
----Notes:
Sql 2000 sp4 get this trouble.
Sql 2005 is good without this issue.

Add IDENTITY column in runtime in a View...

Dear All,
I'm facing a problem with creating a view.I have a table with
following description

Tab1
-----------
Col1 col2
-- --
Val1 Tom
Val2 Cat
Val3 Jack
Val4 Jim

Now I'm trying to create a view with following information from
Tab1.The output should be

Tab1View
------------
Col1 Col2 Col3
-- -- --
1 Val1 Tom
2 Val2 Cat
3 Val3 Jack
4 Val4 Jim
------------
So the create view statement add this column dynamically in this
result set.
If any body has any doubt on this query please let me inform.
Regards
Arijit Chatterjeearijitchatterjee123@.yahoo.co.in (Arijit Chatterjee) wrote in message news:<ea01504d.0308032036.206a7354@.posting.google.com>...
> Dear All,
> I'm facing a problem with creating a view.I have a table with
> following description
> Tab1
> -----------
> Col1 col2
> -- --
> Val1 Tom
> Val2 Cat
> Val3 Jack
> Val4 Jim
> Now I'm trying to create a view with following information from
> Tab1.The output should be
> Tab1View
> ------------
> Col1 Col2 Col3
> -- -- --
> 1 Val1 Tom
> 2 Val2 Cat
> 3 Val3 Jack
> 4 Val4 Jim
> ------------
> So the create view statement add this column dynamically in this
> result set.
> If any body has any doubt on this query please let me inform.
> Regards
> Arijit Chatterjee

Here is a Microsoft KB article which describes various options:

http://support.microsoft.com/defaul...kb;en-us;186133

Alternatively, you might find it easier and more efficient to add the
row numbers in the client application.

Simon

Friday, February 24, 2012

Add control in TreeView control

Hey all .net programmers..

I am thinking about Tree View control which contains controls. any idea?


Microsoft Tree View control only support add nodes as text. i think. but istead of text, putting Button or link or any usercontrol.. what do u think?

I suspect that one of the Visual Studio forums would be a more likely place to post this question and get a meaningful response.|||True and check(search_) that forum as this might have discussed there already.|||

http://www.codeproject.com/Purgatory/Button_TreeView_Control.asp

Found this link. Still looking for the other solution.

Felice

Add control in TreeView control

Hey all .net programmers..

I am thinking about Tree View control which contains controls. any idea?


Microsoft Tree View control only support add nodes as text. i think. but istead of text, putting Button or link or any usercontrol.. what do u think?

I suspect that one of the Visual Studio forums would be a more likely place to post this question and get a meaningful response.|||True and check(search_) that forum as this might have discussed there already.|||

http://www.codeproject.com/Purgatory/Button_TreeView_Control.asp

Found this link. Still looking for the other solution.

Felice

Sunday, February 19, 2012

Add Column to a View

I am trying to add a NEW Column to a view
Here is the syntax I am using
ALTER VIEW AFS_INDEX
ADD Value varchar(30)
Can some one tell me what I am doing wrong and what is the correct way of
doing this
ThanksPlease refer to BOL for syntax questions. ALTER VIEW cannot be used in the
same manner as ALTER TABLE.|||You should be adding to one of the base table that define the view, not
altering the view itself.
"Chrismkr" wrote:

> I am trying to add a NEW Column to a view
> Here is the syntax I am using
> ALTER VIEW AFS_INDEX
> ADD Value varchar(30)
> Can some one tell me what I am doing wrong and what is the correct way of
> doing this
> Thanks
>|||Alter view works exactly the same as create view, but completely different
from alter table.
When you alter a view or stored procedure you actually recreate it, but
leave the permissions in place. So use alter view just as you would create
view.
"Chrismkr" <Chrismkr@.discussions.microsoft.com> wrote in message
news:7B76CA24-E9C3-423D-9C22-0F6A6B58D8A8@.microsoft.com...
> I am trying to add a NEW Column to a view
> Here is the syntax I am using
> ALTER VIEW AFS_INDEX
> ADD Value varchar(30)
> Can some one tell me what I am doing wrong and what is the correct way of
> doing this
> Thanks
>

Add auto number field to view

I have a simple view something like "SELECT * from <table_name> order
by field1,field2,field3
I have a program that needs to read these values in by the order I have
ordered them in the database however it needs an incremental numeric
value to do so. Is there any way to add to the view, a field that after
the order by is done, that places a numeric incremental value in
another virtual or real column?
Thanks.
JRhttp://www.aspfaq.com/2427
"JR" <jriker1@.yahoo.com> wrote in message
news:1149872089.709215.141860@.i39g2000cwa.googlegroups.com...
>I have a simple view something like "SELECT * from <table_name> order
> by field1,field2,field3
> I have a program that needs to read these values in by the order I have
> ordered them in the database however it needs an incremental numeric
> value to do so. Is there any way to add to the view, a field that after
> the order by is done, that places a numeric incremental value in
> another virtual or real column?
> Thanks.
> JR
>|||JR wrote:
> I have a simple view something like "SELECT * from <table_name> order
> by field1,field2,field3
> I have a program that needs to read these values in by the order I have
> ordered them in the database however it needs an incremental numeric
> value to do so. Is there any way to add to the view, a field that after
> the order by is done, that places a numeric incremental value in
> another virtual or real column?
> Thanks.
> JR
on 2005, use row_number()|||Using SQL Server 2000.
Alexander Kuznetsov wrote:
> JR wrote:
> on 2005, use row_number()|||I was looking at the rank option however with that it seems to want you
to define each and every column in your view in the group by clause.
Aaron Bertrand [SQL Server MVP] wrote:
> http://www.aspfaq.com/2427
>
>
> "JR" <jriker1@.yahoo.com> wrote in message
> news:1149872089.709215.141860@.i39g2000cwa.googlegroups.com...|||>I was looking at the rank option however with that it seems to want you
> to define each and every column in your view in the group by clause.
Which you should be doing anyway; don't be lazy, it doesn't pay off in the
long run!
http://www.aspfaq.com/2096|||OK, I'll give it a try however I have over 50 columns so kind of a
pain.
Aaron Bertrand [SQL Server MVP] wrote:
> Which you should be doing anyway; don't be lazy, it doesn't pay off in the
> long run!
> http://www.aspfaq.com/2096|||> OK, I'll give it a try however I have over 50 columns so kind of a
> pain.
CREATE VIEW tmp_vw_foo
AS
SELECT * FROM SomeTable
GO
SELECT COLUMN_NAME+',' FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'tmp_vw_foo'
ORDER BY ORDINAL_POSITION
The most work you're going to do, aside from copy and paste, is deleting the
last comma.
Yep, that's a real pain. :-)|||Sweet. Thanks for that Aaron.
Aaron Bertrand [SQL Server MVP] wrote:
> CREATE VIEW tmp_vw_foo
> AS
> SELECT * FROM SomeTable
> GO
> SELECT COLUMN_NAME+',' FROM INFORMATION_SCHEMA.COLUMNS
> WHERE TABLE_NAME = 'tmp_vw_foo'
> ORDER BY ORDINAL_POSITION
> The most work you're going to do, aside from copy and paste, is deleting t
he
> last comma.
> Yep, that's a real pain. :-)

Thursday, February 16, 2012

Add a view in a diagram

H
I would like to import views in SQL Server's Diagram. I could only import tables. Thank you for your helSQL Servers database diagram tool only supports diagrams
using tables. Some of the other data modeling tools support
views in diagrams. If you have Visio, you can reverse
engineer your database and include views in the diagrams.
-Sue
On Wed, 14 Apr 2004 07:36:02 -0700, "SLEMARIE"
<anonymous@.discussions.microsoft.com> wrote:
>Hi
>I would like to import views in SQL Server's Diagram. I could only import tables. Thank you for your help

Add a view in a diagram

Hi
I would like to import views in SQL Server's Diagram. I could only import tables. Thank you for your help
SQL Servers database diagram tool only supports diagrams
using tables. Some of the other data modeling tools support
views in diagrams. If you have Visio, you can reverse
engineer your database and include views in the diagrams.
-Sue
On Wed, 14 Apr 2004 07:36:02 -0700, "SLEMARIE"
<anonymous@.discussions.microsoft.com> wrote:

>Hi
>I would like to import views in SQL Server's Diagram. I could only import tables. Thank you for your help

Add a view in a diagram

Hi
I would like to import views in SQL Server's Diagram. I could only import ta
bles. Thank you for your helpSQL Servers database diagram tool only supports diagrams
using tables. Some of the other data modeling tools support
views in diagrams. If you have Visio, you can reverse
engineer your database and include views in the diagrams.
-Sue
On Wed, 14 Apr 2004 07:36:02 -0700, "SLEMARIE"
<anonymous@.discussions.microsoft.com> wrote:

>Hi
>I would like to import views in SQL Server's Diagram. I could only import tables. T
hank you for your help

add a Primary Key (or something like that) to a View

Hi,
I have a View like this in my SQL Server 2000:
CREATE VIEW vw_oas_linkhead
AS
SELECT *
FROM oas_linkhead
WHERE (cmpcode = SUSER_SNAME())
WITH CHECK OPTION
The problem is: When, inside an Access-applciation, I put a link to this
View, I can't delete records from the View unless I have a Primary Key
defined on the View.
I can define that Primary Key in Access, but when I refresh the Linked Table
(View) the Primary Key disspaears. This doesn't happen when the Table itself
has a Primary Key on the SQL Server. So I wouldl ike to know if there is a
possiblity to put a Primary Key on a View in Sql Server (I thought this
isn't possible?) or to kind of simulate this on another way (with a check
constraint, ... ?)?
Does anybody has any idea?
Thanks a lot!
Pieter
I would assume that Access would pick up the underlying table's primary key definition. Do you have
such?
You can't define a PK on a view as the view doesn't store any data in itself. You can, in some
cases, make the view with SCHEMABINING and create a unique index on the view. The question is, of
course, whether Access would pick up on that. But that is a question for the Access experts.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"DraguVaso" <pietercoucke@.hotmail.com> wrote in message
news:Opndze35EHA.3828@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I have a View like this in my SQL Server 2000:
> CREATE VIEW vw_oas_linkhead
> AS
> SELECT *
> FROM oas_linkhead
> WHERE (cmpcode = SUSER_SNAME())
> WITH CHECK OPTION
> The problem is: When, inside an Access-applciation, I put a link to this
> View, I can't delete records from the View unless I have a Primary Key
> defined on the View.
> I can define that Primary Key in Access, but when I refresh the Linked Table
> (View) the Primary Key disspaears. This doesn't happen when the Table itself
> has a Primary Key on the SQL Server. So I wouldl ike to know if there is a
> possiblity to put a Primary Key on a View in Sql Server (I thought this
> isn't possible?) or to kind of simulate this on another way (with a check
> constraint, ... ?)?
> Does anybody has any idea?
> Thanks a lot!
> Pieter
>
|||Well, the problem is that the underlying table doesn't have a Primary Key,
but in access it should.
I'm not allowed to change the udnerlying table, so I should put something on
theView...
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:uVHfWi35EHA.272@.TK2MSFTNGP10.phx.gbl...
> I would assume that Access would pick up the underlying table's primary
key definition. Do you have
> such?
> You can't define a PK on a view as the view doesn't store any data in
itself. You can, in some
> cases, make the view with SCHEMABINING and create a unique index on the
view. The question is, of
> course, whether Access would pick up on that. But that is a question for
the Access experts.[vbcol=seagreen]
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "DraguVaso" <pietercoucke@.hotmail.com> wrote in message
> news:Opndze35EHA.3828@.TK2MSFTNGP09.phx.gbl...
Table[vbcol=seagreen]
itself[vbcol=seagreen]
a[vbcol=seagreen]
check
>
|||The option for "putting something on the view" you find in my prior post. But the bigger question is
why the table doesn't have a PK...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"DraguVaso" <pietercoucke@.hotmail.com> wrote in message news:OIV9Vr35EHA.828@.TK2MSFTNGP14.phx.gbl...
> Well, the problem is that the underlying table doesn't have a Primary Key,
> but in access it should.
> I'm not allowed to change the udnerlying table, so I should put something on
> theView...
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:uVHfWi35EHA.272@.TK2MSFTNGP10.phx.gbl...
> key definition. Do you have
> itself. You can, in some
> view. The question is, of
> the Access experts.
> Table
> itself
> a
> check
>
|||I don't know why it doesn't have a Primary Key: It's a table of a big
Accountant Software, so I can't change anything to the table... :-)
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OuPd7K45EHA.1300@.TK2MSFTNGP14.phx.gbl...
> The option for "putting something on the view" you find in my prior post.
But the bigger question is
> why the table doesn't have a PK...
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> http://www.sqlug.se/
> "DraguVaso" <pietercoucke@.hotmail.com> wrote in message
news:OIV9Vr35EHA.828@.TK2MSFTNGP14.phx.gbl...[vbcol=seagreen]
Key,[vbcol=seagreen]
something on[vbcol=seagreen]
in[vbcol=seagreen]
for[vbcol=seagreen]
this[vbcol=seagreen]
Key[vbcol=seagreen]
Linked[vbcol=seagreen]
is[vbcol=seagreen]
this
>
|||I see :-(. I suggest you post this to an Access forum to see whether you can define in Access what
column define uniqueness.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"DraguVaso" <pietercoucke@.hotmail.com> wrote in message
news:e9Y2cqA6EHA.4028@.TK2MSFTNGP15.phx.gbl...
>I don't know why it doesn't have a Primary Key: It's a table of a big
> Accountant Software, so I can't change anything to the table... :-)
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:OuPd7K45EHA.1300@.TK2MSFTNGP14.phx.gbl...
> But the bigger question is
> news:OIV9Vr35EHA.828@.TK2MSFTNGP14.phx.gbl...
> Key,
> something on
> in
> for
> this
> Key
> Linked
> is
> this
>
|||Well I did, and I just got the answer!
It shoudl have been the nicest oslution if I could implement it on the view,
but now I have some VBA that puts the index on the linked view after I
refreshed everything... It seemsto work fine.
Thanks a lot for the effort!
Pieter
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:uOSsf5A6EHA.4028@.TK2MSFTNGP15.phx.gbl...
> I see :-(. I suggest you post this to an Access forum to see whether you
can define in Access what[vbcol=seagreen]
> column define uniqueness.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> http://www.sqlug.se/
>
> "DraguVaso" <pietercoucke@.hotmail.com> wrote in message
> news:e9Y2cqA6EHA.4028@.TK2MSFTNGP15.phx.gbl...
in[vbcol=seagreen]
post.[vbcol=seagreen]
wrote[vbcol=seagreen]
primary[vbcol=seagreen]
in[vbcol=seagreen]
the[vbcol=seagreen]
to[vbcol=seagreen]
Table[vbcol=seagreen]
there[vbcol=seagreen]
a
>

add a Primary Key (or something like that) to a View

Hi,
I have a View like this in my SQL Server 2000:
CREATE VIEW vw_oas_linkhead
AS
SELECT *
FROM oas_linkhead
WHERE (cmpcode = SUSER_SNAME())
WITH CHECK OPTION
The problem is: When, inside an Access-applciation, I put a link to this
View, I can't delete records from the View unless I have a Primary Key
defined on the View.
I can define that Primary Key in Access, but when I refresh the Linked Table
(View) the Primary Key disspaears. This doesn't happen when the Table itself
has a Primary Key on the SQL Server. So I wouldl ike to know if there is a
possiblity to put a Primary Key on a View in Sql Server (I thought this
isn't possible?) or to kind of simulate this on another way (with a check
constraint, ... ?)?
Does anybody has any idea?
Thanks a lot!
PieterI would assume that Access would pick up the underlying table's primary key definition. Do you have
such?
You can't define a PK on a view as the view doesn't store any data in itself. You can, in some
cases, make the view with SCHEMABINING and create a unique index on the view. The question is, of
course, whether Access would pick up on that. But that is a question for the Access experts.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"DraguVaso" <pietercoucke@.hotmail.com> wrote in message
news:Opndze35EHA.3828@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I have a View like this in my SQL Server 2000:
> CREATE VIEW vw_oas_linkhead
> AS
> SELECT *
> FROM oas_linkhead
> WHERE (cmpcode = SUSER_SNAME())
> WITH CHECK OPTION
> The problem is: When, inside an Access-applciation, I put a link to this
> View, I can't delete records from the View unless I have a Primary Key
> defined on the View.
> I can define that Primary Key in Access, but when I refresh the Linked Table
> (View) the Primary Key disspaears. This doesn't happen when the Table itself
> has a Primary Key on the SQL Server. So I wouldl ike to know if there is a
> possiblity to put a Primary Key on a View in Sql Server (I thought this
> isn't possible?) or to kind of simulate this on another way (with a check
> constraint, ... ?)?
> Does anybody has any idea?
> Thanks a lot!
> Pieter
>|||Well, the problem is that the underlying table doesn't have a Primary Key,
but in access it should.
I'm not allowed to change the udnerlying table, so I should put something on
theView...
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:uVHfWi35EHA.272@.TK2MSFTNGP10.phx.gbl...
> I would assume that Access would pick up the underlying table's primary
key definition. Do you have
> such?
> You can't define a PK on a view as the view doesn't store any data in
itself. You can, in some
> cases, make the view with SCHEMABINING and create a unique index on the
view. The question is, of
> course, whether Access would pick up on that. But that is a question for
the Access experts.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "DraguVaso" <pietercoucke@.hotmail.com> wrote in message
> news:Opndze35EHA.3828@.TK2MSFTNGP09.phx.gbl...
> > Hi,
> >
> > I have a View like this in my SQL Server 2000:
> > CREATE VIEW vw_oas_linkhead
> > AS
> > SELECT *
> > FROM oas_linkhead
> > WHERE (cmpcode = SUSER_SNAME())
> > WITH CHECK OPTION
> >
> > The problem is: When, inside an Access-applciation, I put a link to this
> > View, I can't delete records from the View unless I have a Primary Key
> > defined on the View.
> >
> > I can define that Primary Key in Access, but when I refresh the Linked
Table
> > (View) the Primary Key disspaears. This doesn't happen when the Table
itself
> > has a Primary Key on the SQL Server. So I wouldl ike to know if there is
a
> > possiblity to put a Primary Key on a View in Sql Server (I thought this
> > isn't possible?) or to kind of simulate this on another way (with a
check
> > constraint, ... ?)?
> >
> > Does anybody has any idea?
> >
> > Thanks a lot!
> >
> > Pieter
> >
> >
>|||The option for "putting something on the view" you find in my prior post. But the bigger question is
why the table doesn't have a PK...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"DraguVaso" <pietercoucke@.hotmail.com> wrote in message news:OIV9Vr35EHA.828@.TK2MSFTNGP14.phx.gbl...
> Well, the problem is that the underlying table doesn't have a Primary Key,
> but in access it should.
> I'm not allowed to change the udnerlying table, so I should put something on
> theView...
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:uVHfWi35EHA.272@.TK2MSFTNGP10.phx.gbl...
>> I would assume that Access would pick up the underlying table's primary
> key definition. Do you have
>> such?
>> You can't define a PK on a view as the view doesn't store any data in
> itself. You can, in some
>> cases, make the view with SCHEMABINING and create a unique index on the
> view. The question is, of
>> course, whether Access would pick up on that. But that is a question for
> the Access experts.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>>
>> "DraguVaso" <pietercoucke@.hotmail.com> wrote in message
>> news:Opndze35EHA.3828@.TK2MSFTNGP09.phx.gbl...
>> > Hi,
>> >
>> > I have a View like this in my SQL Server 2000:
>> > CREATE VIEW vw_oas_linkhead
>> > AS
>> > SELECT *
>> > FROM oas_linkhead
>> > WHERE (cmpcode = SUSER_SNAME())
>> > WITH CHECK OPTION
>> >
>> > The problem is: When, inside an Access-applciation, I put a link to this
>> > View, I can't delete records from the View unless I have a Primary Key
>> > defined on the View.
>> >
>> > I can define that Primary Key in Access, but when I refresh the Linked
> Table
>> > (View) the Primary Key disspaears. This doesn't happen when the Table
> itself
>> > has a Primary Key on the SQL Server. So I wouldl ike to know if there is
> a
>> > possiblity to put a Primary Key on a View in Sql Server (I thought this
>> > isn't possible?) or to kind of simulate this on another way (with a
> check
>> > constraint, ... ?)?
>> >
>> > Does anybody has any idea?
>> >
>> > Thanks a lot!
>> >
>> > Pieter
>> >
>> >
>>
>|||I don't know why it doesn't have a Primary Key: It's a table of a big
Accountant Software, so I can't change anything to the table... :-)
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OuPd7K45EHA.1300@.TK2MSFTNGP14.phx.gbl...
> The option for "putting something on the view" you find in my prior post.
But the bigger question is
> why the table doesn't have a PK...
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> http://www.sqlug.se/
> "DraguVaso" <pietercoucke@.hotmail.com> wrote in message
news:OIV9Vr35EHA.828@.TK2MSFTNGP14.phx.gbl...
> > Well, the problem is that the underlying table doesn't have a Primary
Key,
> > but in access it should.
> > I'm not allowed to change the udnerlying table, so I should put
something on
> > theView...
> >
> > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in
> > message news:uVHfWi35EHA.272@.TK2MSFTNGP10.phx.gbl...
> >> I would assume that Access would pick up the underlying table's primary
> > key definition. Do you have
> >> such?
> >> You can't define a PK on a view as the view doesn't store any data in
> > itself. You can, in some
> >> cases, make the view with SCHEMABINING and create a unique index on the
> > view. The question is, of
> >> course, whether Access would pick up on that. But that is a question
for
> > the Access experts.
> >>
> >> --
> >> Tibor Karaszi, SQL Server MVP
> >> http://www.karaszi.com/sqlserver/default.asp
> >> http://www.solidqualitylearning.com/
> >>
> >>
> >> "DraguVaso" <pietercoucke@.hotmail.com> wrote in message
> >> news:Opndze35EHA.3828@.TK2MSFTNGP09.phx.gbl...
> >> > Hi,
> >> >
> >> > I have a View like this in my SQL Server 2000:
> >> > CREATE VIEW vw_oas_linkhead
> >> > AS
> >> > SELECT *
> >> > FROM oas_linkhead
> >> > WHERE (cmpcode = SUSER_SNAME())
> >> > WITH CHECK OPTION
> >> >
> >> > The problem is: When, inside an Access-applciation, I put a link to
this
> >> > View, I can't delete records from the View unless I have a Primary
Key
> >> > defined on the View.
> >> >
> >> > I can define that Primary Key in Access, but when I refresh the
Linked
> > Table
> >> > (View) the Primary Key disspaears. This doesn't happen when the Table
> > itself
> >> > has a Primary Key on the SQL Server. So I wouldl ike to know if there
is
> > a
> >> > possiblity to put a Primary Key on a View in Sql Server (I thought
this
> >> > isn't possible?) or to kind of simulate this on another way (with a
> > check
> >> > constraint, ... ?)?
> >> >
> >> > Does anybody has any idea?
> >> >
> >> > Thanks a lot!
> >> >
> >> > Pieter
> >> >
> >> >
> >>
> >>
> >
> >
>|||I see :-(. I suggest you post this to an Access forum to see whether you can define in Access what
column define uniqueness.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"DraguVaso" <pietercoucke@.hotmail.com> wrote in message
news:e9Y2cqA6EHA.4028@.TK2MSFTNGP15.phx.gbl...
>I don't know why it doesn't have a Primary Key: It's a table of a big
> Accountant Software, so I can't change anything to the table... :-)
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:OuPd7K45EHA.1300@.TK2MSFTNGP14.phx.gbl...
>> The option for "putting something on the view" you find in my prior post.
> But the bigger question is
>> why the table doesn't have a PK...
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>> http://www.sqlug.se/
>> "DraguVaso" <pietercoucke@.hotmail.com> wrote in message
> news:OIV9Vr35EHA.828@.TK2MSFTNGP14.phx.gbl...
>> > Well, the problem is that the underlying table doesn't have a Primary
> Key,
>> > but in access it should.
>> > I'm not allowed to change the udnerlying table, so I should put
> something on
>> > theView...
>> >
>> > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
> in
>> > message news:uVHfWi35EHA.272@.TK2MSFTNGP10.phx.gbl...
>> >> I would assume that Access would pick up the underlying table's primary
>> > key definition. Do you have
>> >> such?
>> >> You can't define a PK on a view as the view doesn't store any data in
>> > itself. You can, in some
>> >> cases, make the view with SCHEMABINING and create a unique index on the
>> > view. The question is, of
>> >> course, whether Access would pick up on that. But that is a question
> for
>> > the Access experts.
>> >>
>> >> --
>> >> Tibor Karaszi, SQL Server MVP
>> >> http://www.karaszi.com/sqlserver/default.asp
>> >> http://www.solidqualitylearning.com/
>> >>
>> >>
>> >> "DraguVaso" <pietercoucke@.hotmail.com> wrote in message
>> >> news:Opndze35EHA.3828@.TK2MSFTNGP09.phx.gbl...
>> >> > Hi,
>> >> >
>> >> > I have a View like this in my SQL Server 2000:
>> >> > CREATE VIEW vw_oas_linkhead
>> >> > AS
>> >> > SELECT *
>> >> > FROM oas_linkhead
>> >> > WHERE (cmpcode = SUSER_SNAME())
>> >> > WITH CHECK OPTION
>> >> >
>> >> > The problem is: When, inside an Access-applciation, I put a link to
> this
>> >> > View, I can't delete records from the View unless I have a Primary
> Key
>> >> > defined on the View.
>> >> >
>> >> > I can define that Primary Key in Access, but when I refresh the
> Linked
>> > Table
>> >> > (View) the Primary Key disspaears. This doesn't happen when the Table
>> > itself
>> >> > has a Primary Key on the SQL Server. So I wouldl ike to know if there
> is
>> > a
>> >> > possiblity to put a Primary Key on a View in Sql Server (I thought
> this
>> >> > isn't possible?) or to kind of simulate this on another way (with a
>> > check
>> >> > constraint, ... ?)?
>> >> >
>> >> > Does anybody has any idea?
>> >> >
>> >> > Thanks a lot!
>> >> >
>> >> > Pieter
>> >> >
>> >> >
>> >>
>> >>
>> >
>> >
>>
>|||Well I did, and I just got the answer!
It shoudl have been the nicest oslution if I could implement it on the view,
but now I have some VBA that puts the index on the linked view after I
refreshed everything... It seemsto work fine.
Thanks a lot for the effort!
Pieter
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:uOSsf5A6EHA.4028@.TK2MSFTNGP15.phx.gbl...
> I see :-(. I suggest you post this to an Access forum to see whether you
can define in Access what
> column define uniqueness.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> http://www.sqlug.se/
>
> "DraguVaso" <pietercoucke@.hotmail.com> wrote in message
> news:e9Y2cqA6EHA.4028@.TK2MSFTNGP15.phx.gbl...
> >I don't know why it doesn't have a Primary Key: It's a table of a big
> > Accountant Software, so I can't change anything to the table... :-)
> >
> > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in
> > message news:OuPd7K45EHA.1300@.TK2MSFTNGP14.phx.gbl...
> >> The option for "putting something on the view" you find in my prior
post.
> > But the bigger question is
> >> why the table doesn't have a PK...
> >>
> >> --
> >> Tibor Karaszi, SQL Server MVP
> >> http://www.karaszi.com/sqlserver/default.asp
> >> http://www.solidqualitylearning.com/
> >> http://www.sqlug.se/
> >>
> >> "DraguVaso" <pietercoucke@.hotmail.com> wrote in message
> > news:OIV9Vr35EHA.828@.TK2MSFTNGP14.phx.gbl...
> >> > Well, the problem is that the underlying table doesn't have a Primary
> > Key,
> >> > but in access it should.
> >> > I'm not allowed to change the udnerlying table, so I should put
> > something on
> >> > theView...
> >> >
> >> > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
wrote
> > in
> >> > message news:uVHfWi35EHA.272@.TK2MSFTNGP10.phx.gbl...
> >> >> I would assume that Access would pick up the underlying table's
primary
> >> > key definition. Do you have
> >> >> such?
> >> >> You can't define a PK on a view as the view doesn't store any data
in
> >> > itself. You can, in some
> >> >> cases, make the view with SCHEMABINING and create a unique index on
the
> >> > view. The question is, of
> >> >> course, whether Access would pick up on that. But that is a question
> > for
> >> > the Access experts.
> >> >>
> >> >> --
> >> >> Tibor Karaszi, SQL Server MVP
> >> >> http://www.karaszi.com/sqlserver/default.asp
> >> >> http://www.solidqualitylearning.com/
> >> >>
> >> >>
> >> >> "DraguVaso" <pietercoucke@.hotmail.com> wrote in message
> >> >> news:Opndze35EHA.3828@.TK2MSFTNGP09.phx.gbl...
> >> >> > Hi,
> >> >> >
> >> >> > I have a View like this in my SQL Server 2000:
> >> >> > CREATE VIEW vw_oas_linkhead
> >> >> > AS
> >> >> > SELECT *
> >> >> > FROM oas_linkhead
> >> >> > WHERE (cmpcode = SUSER_SNAME())
> >> >> > WITH CHECK OPTION
> >> >> >
> >> >> > The problem is: When, inside an Access-applciation, I put a link
to
> > this
> >> >> > View, I can't delete records from the View unless I have a Primary
> > Key
> >> >> > defined on the View.
> >> >> >
> >> >> > I can define that Primary Key in Access, but when I refresh the
> > Linked
> >> > Table
> >> >> > (View) the Primary Key disspaears. This doesn't happen when the
Table
> >> > itself
> >> >> > has a Primary Key on the SQL Server. So I wouldl ike to know if
there
> > is
> >> > a
> >> >> > possiblity to put a Primary Key on a View in Sql Server (I thought
> > this
> >> >> > isn't possible?) or to kind of simulate this on another way (with
a
> >> > check
> >> >> > constraint, ... ?)?
> >> >> >
> >> >> > Does anybody has any idea?
> >> >> >
> >> >> > Thanks a lot!
> >> >> >
> >> >> > Pieter
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >
> >> >
> >>
> >>
> >
> >
>