Showing posts with label tables. Show all posts
Showing posts with label tables. Show all posts

Monday, March 26, 2012

Login failed for user (null). Reason: Not associated with a trusted SQL

I am connecting to an Access 97 db on a network drive, in which all tables are linked to a SQL Server 2000 db through a DSN. I can access the tables fine from a Windows 2000 machine, but I get this error when I try to access the tables on an NT4 machine: Login failed for user '(null)'. Reason: Not associated with a trusted SQL. I do not want to use trusted security and the DSN does have a valid SQL Server user name and password. Please help!!!When you created the linked tables within the Access database you specify which DSN to use. That DSN must be defined on all machines that will use the linked tables within the Access database. Does the NT 4.0 workstation have the DSN defined on it? If so does it have trusted connection defined or Login/Password?|||I do have the dsn set up on both machines, but in further digging, I found this:

FIX: SQL Server ODBC Driver Ignores Authentication Setting (Q279526)

------------------------
The information in this article applies to:

Microsoft ODBC Driver for SQL Server, version 3.6
Microsoft SQL Server 2000 (all editions)
Microsoft Data Access Components version 2.6

------------------------

SYMPTOMS
When you use the SQL Server ODBC driver version 2000.080.0194, which was released with SQL Server 2000 and Microsoft Data Access Components (MDAC) 2.6 RTM, the authentication settings for ODBC data source names (DSNs) are ignored. The driver attempts to log directly into SQL Server using NTLM authentication (integrated security) without prompting for a user ID and password.

This can cause authentication failures, messages that database objects are not available, or unintentional modification of the wrong objects when copies of objects are maintained in multiple databases.

RESOLUTION
To resolve this problem, obtain the latest service pack for Microsoft Data Access Components 2.6. For additional information, please see the following article in the Microsoft Knowledge Base:

Friday, March 9, 2012

Logical Tables in Trigger?

Hi,
What are the Logical Tables in triggers?
Is there anything like that is available?
Please help me in this regard.
Thanks,
Shhyam
WHile you are in a trigger you have access to 2 tables, named inserted and
deleted. They are read-only and have the same structure as the table the
trigger is based on.
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Shyam" <Shyam@.discussions.microsoft.com> wrote in message
news:9F7FB9AF-6953-426C-9142-3F3BBEC61899@.microsoft.com...
> Hi,
> What are the Logical Tables in triggers?
> Is there anything like that is available?
> Please help me in this regard.
> Thanks,
> Shhyam
|||Hi Wayne,
I get your point,but it would be helpful for me,if you can provide more
details on this.Any Url/helpfile would be apperciated.
Regards,
shyam
"Wayne Snyder" wrote:

> WHile you are in a trigger you have access to 2 tables, named inserted and
> deleted. They are read-only and have the same structure as the table the
> trigger is based on.
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Shyam" <Shyam@.discussions.microsoft.com> wrote in message
> news:9F7FB9AF-6953-426C-9142-3F3BBEC61899@.microsoft.com...
>
>
|||Hi Shyam
The best helpfile is SQL Server's own documentation. Look up CREATE TRIGGER
in the Books Online and that should get you started, as there are quite a
few examples under that topic.
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Shyam" <Shyam@.discussions.microsoft.com> wrote in message
news:D95816D6-2BED-4E95-ADE2-B4AC3E6EF753@.microsoft.com...[vbcol=seagreen]
> Hi Wayne,
> I get your point,but it would be helpful for me,if you can provide more
> details on this.Any Url/helpfile would be apperciated.
> Regards,
> shyam
> "Wayne Snyder" wrote:
|||Thanks all for the quick help.
Regards,
shyam
"Kalen Delaney" wrote:

> Hi Shyam
> The best helpfile is SQL Server's own documentation. Look up CREATE TRIGGER
> in the Books Online and that should get you started, as there are quite a
> few examples under that topic.
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "Shyam" <Shyam@.discussions.microsoft.com> wrote in message
> news:D95816D6-2BED-4E95-ADE2-B4AC3E6EF753@.microsoft.com...
>
>

Logical Tables in Trigger?

Hi,
What are the Logical Tables in triggers?
Is there anything like that is available?
Please help me in this regard.
Thanks,
ShhyamWHile you are in a trigger you have access to 2 tables, named inserted and
deleted. They are read-only and have the same structure as the table the
trigger is based on.
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Shyam" <Shyam@.discussions.microsoft.com> wrote in message
news:9F7FB9AF-6953-426C-9142-3F3BBEC61899@.microsoft.com...
> Hi,
> What are the Logical Tables in triggers?
> Is there anything like that is available?
> Please help me in this regard.
> Thanks,
> Shhyam|||Hi Wayne,
I get your point,but it would be helpful for me,if you can provide more
details on this.Any Url/helpfile would be apperciated.
Regards,
shyam
"Wayne Snyder" wrote:
> WHile you are in a trigger you have access to 2 tables, named inserted and
> deleted. They are read-only and have the same structure as the table the
> trigger is based on.
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Shyam" <Shyam@.discussions.microsoft.com> wrote in message
> news:9F7FB9AF-6953-426C-9142-3F3BBEC61899@.microsoft.com...
> > Hi,
> >
> > What are the Logical Tables in triggers?
> > Is there anything like that is available?
> > Please help me in this regard.
> >
> > Thanks,
> > Shhyam
>
>|||Hi Shyam
The best helpfile is SQL Server's own documentation. Look up CREATE TRIGGER
in the Books Online and that should get you started, as there are quite a
few examples under that topic.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Shyam" <Shyam@.discussions.microsoft.com> wrote in message
news:D95816D6-2BED-4E95-ADE2-B4AC3E6EF753@.microsoft.com...
> Hi Wayne,
> I get your point,but it would be helpful for me,if you can provide more
> details on this.Any Url/helpfile would be apperciated.
> Regards,
> shyam
> "Wayne Snyder" wrote:
>> WHile you are in a trigger you have access to 2 tables, named inserted
>> and
>> deleted. They are read-only and have the same structure as the table the
>> trigger is based on.
>> --
>> Wayne Snyder, MCDBA, SQL Server MVP
>> Mariner, Charlotte, NC
>> www.mariner-usa.com
>> (Please respond only to the newsgroups.)
>> I support the Professional Association of SQL Server (PASS) and it's
>> community of SQL Server professionals.
>> www.sqlpass.org
>> "Shyam" <Shyam@.discussions.microsoft.com> wrote in message
>> news:9F7FB9AF-6953-426C-9142-3F3BBEC61899@.microsoft.com...
>> > Hi,
>> >
>> > What are the Logical Tables in triggers?
>> > Is there anything like that is available?
>> > Please help me in this regard.
>> >
>> > Thanks,
>> > Shhyam
>>|||Thanks all for the quick help.
Regards,
shyam
"Kalen Delaney" wrote:
> Hi Shyam
> The best helpfile is SQL Server's own documentation. Look up CREATE TRIGGER
> in the Books Online and that should get you started, as there are quite a
> few examples under that topic.
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "Shyam" <Shyam@.discussions.microsoft.com> wrote in message
> news:D95816D6-2BED-4E95-ADE2-B4AC3E6EF753@.microsoft.com...
> > Hi Wayne,
> >
> > I get your point,but it would be helpful for me,if you can provide more
> > details on this.Any Url/helpfile would be apperciated.
> > Regards,
> > shyam
> >
> > "Wayne Snyder" wrote:
> >
> >> WHile you are in a trigger you have access to 2 tables, named inserted
> >> and
> >> deleted. They are read-only and have the same structure as the table the
> >> trigger is based on.
> >>
> >> --
> >> Wayne Snyder, MCDBA, SQL Server MVP
> >> Mariner, Charlotte, NC
> >> www.mariner-usa.com
> >> (Please respond only to the newsgroups.)
> >>
> >> I support the Professional Association of SQL Server (PASS) and it's
> >> community of SQL Server professionals.
> >> www.sqlpass.org
> >>
> >> "Shyam" <Shyam@.discussions.microsoft.com> wrote in message
> >> news:9F7FB9AF-6953-426C-9142-3F3BBEC61899@.microsoft.com...
> >> > Hi,
> >> >
> >> > What are the Logical Tables in triggers?
> >> > Is there anything like that is available?
> >> > Please help me in this regard.
> >> >
> >> > Thanks,
> >> > Shhyam
> >>
> >>
> >>
>
>

Logical Tables in Trigger?

Hi,
What are the Logical Tables in triggers?
Is there anything like that is available?
Please help me in this regard.
Thanks,
ShhyamWHile you are in a trigger you have access to 2 tables, named inserted and
deleted. They are read-only and have the same structure as the table the
trigger is based on.
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Shyam" <Shyam@.discussions.microsoft.com> wrote in message
news:9F7FB9AF-6953-426C-9142-3F3BBEC61899@.microsoft.com...
> Hi,
> What are the Logical Tables in triggers?
> Is there anything like that is available?
> Please help me in this regard.
> Thanks,
> Shhyam|||Hi Wayne,
I get your point,but it would be helpful for me,if you can provide more
details on this.Any Url/helpfile would be apperciated.
Regards,
shyam
"Wayne Snyder" wrote:

> WHile you are in a trigger you have access to 2 tables, named inserted and
> deleted. They are read-only and have the same structure as the table the
> trigger is based on.
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Shyam" <Shyam@.discussions.microsoft.com> wrote in message
> news:9F7FB9AF-6953-426C-9142-3F3BBEC61899@.microsoft.com...
>
>|||Hi Shyam
The best helpfile is SQL Server's own documentation. Look up CREATE TRIGGER
in the Books Online and that should get you started, as there are quite a
few examples under that topic.
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Shyam" <Shyam@.discussions.microsoft.com> wrote in message
news:D95816D6-2BED-4E95-ADE2-B4AC3E6EF753@.microsoft.com...[vbcol=seagreen]
> Hi Wayne,
> I get your point,but it would be helpful for me,if you can provide more
> details on this.Any Url/helpfile would be apperciated.
> Regards,
> shyam
> "Wayne Snyder" wrote:
>|||Thanks all for the quick help.
Regards,
shyam
"Kalen Delaney" wrote:

> Hi Shyam
> The best helpfile is SQL Server's own documentation. Look up CREATE TRIGGE
R
> in the Books Online and that should get you started, as there are quite a
> few examples under that topic.
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "Shyam" <Shyam@.discussions.microsoft.com> wrote in message
> news:D95816D6-2BED-4E95-ADE2-B4AC3E6EF753@.microsoft.com...
>
>

Logical Scan Fragmentation..issue!

Hello,
I have some issue or problems I dont know?. I have tray DBCC SHOWCONTIG on
all tables on my database to see what is condition of index fragmentation.
For an example here is on of those tables:
DBCC SHOWCONTIG scanning 'studenti' table...
Table: 'studenti' (1635536910); index ID: 0, database ID: 5
TABLE level scan performed.
- Pages Scanned........................: 63
- Extents Scanned.......................: 11
- Extent Switches.......................: 10
- Avg. Pages per Extent..................: 5.7
- Scan Density [Best Count:Actual Count]......: 72.73% [8:11]
- Extent Scan Fragmentation ...............: 36.36%
- Avg. Bytes Free per Page................: 492.7
- Avg. Page Density (full)................: 93.91%
It's not big table..so far 1209 rows.
If you noticed there is not value for Logical Scan Fragmentation? All my
tables in database have that value (45 od them) and just 4 of them not.
Executin command DBCC INDEXDRAG on that 4 tables, with any fill factor,
doesn't change and of values in exemple above.
Other tables, with Logical Scan Fragmentation values shown, are ok and DBCC
INDEXDRAG do just fine..as expected.
What are possible reasons for this issue or problem!
Thanx
It's because the table is a heap (has no clustered index). You can tell
because the index ID is 0. If you check the other tables you should see that
you don't get Logical Scan Fragmentation for any heaps. Here's a quick query
that will determine tables with no clustered index
select [name] from sysobjects
where objectproperty(id,'IsUserTable')=1
and objectproperty(id,'TableHasClustIndex')=0
Logical Scan Fragmentation is not relavent for heaps
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Jasmin" <Jasmin@.discussions.microsoft.com> wrote in message
news:F729DB47-DA92-4319-AC14-7BADBE5AC17E@.microsoft.com...
> Hello,
> I have some issue or problems I dont know?. I have tray DBCC SHOWCONTIG on
> all tables on my database to see what is condition of index fragmentation.
> For an example here is on of those tables:
> DBCC SHOWCONTIG scanning 'studenti' table...
> Table: 'studenti' (1635536910); index ID: 0, database ID: 5
> TABLE level scan performed.
> - Pages Scanned........................: 63
> - Extents Scanned.......................: 11
> - Extent Switches.......................: 10
> - Avg. Pages per Extent..................: 5.7
> - Scan Density [Best Count:Actual Count]......: 72.73% [8:11]
> - Extent Scan Fragmentation ...............: 36.36%
> - Avg. Bytes Free per Page................: 492.7
> - Avg. Page Density (full)................: 93.91%
> It's not big table..so far 1209 rows.
> If you noticed there is not value for Logical Scan Fragmentation? All my
> tables in database have that value (45 od them) and just 4 of them not.
> Executin command DBCC INDEXDRAG on that 4 tables, with any fill factor,
> doesn't change and of values in exemple above.
> Other tables, with Logical Scan Fragmentation values shown, are ok and
> DBCC
> INDEXDRAG do just fine..as expected.
> What are possible reasons for this issue or problem!
> Thanx

Logical Scan Fragmentation..issue!

Hello,
I have some issue or problems I dont know?. I have tray DBCC SHOWCONTIG on
all tables on my database to see what is condition of index fragmentation.
For an example here is on of those tables:
DBCC SHOWCONTIG scanning 'studenti' table...
Table: 'studenti' (1635536910); index ID: 0, database ID: 5
TABLE level scan performed.
- Pages Scanned........................: 63
- Extents Scanned.......................: 11
- Extent Switches.......................: 10
- Avg. Pages per Extent..................: 5.7
- Scan Density [Best Count:Actual Count]......: 72.73% [8:11]
- Extent Scan Fragmentation ...............: 36.36%
- Avg. Bytes Free per Page................: 492.7
- Avg. Page Density (full)................: 93.91%
It's not big table..so far 1209 rows.
If you noticed there is not value for Logical Scan Fragmentation? All my
tables in database have that value (45 od them) and just 4 of them not.
Executin command DBCC INDEXDRAG on that 4 tables, with any fill factor,
doesn't change and of values in exemple above.
Other tables, with Logical Scan Fragmentation values shown, are ok and DBCC
INDEXDRAG do just fine..as expected.
What are possible reasons for this issue or problem!
ThanxIt's because the table is a heap (has no clustered index). You can tell
because the index ID is 0. If you check the other tables you should see that
you don't get Logical Scan Fragmentation for any heaps. Here's a quick query
that will determine tables with no clustered index
select [name] from sysobjects
where objectproperty(id,'IsUserTable')=1
and objectproperty(id,'TableHasClustIndex')=
0
Logical Scan Fragmentation is not relavent for heaps
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Jasmin" <Jasmin@.discussions.microsoft.com> wrote in message
news:F729DB47-DA92-4319-AC14-7BADBE5AC17E@.microsoft.com...
> Hello,
> I have some issue or problems I dont know?. I have tray DBCC SHOWCONTIG on
> all tables on my database to see what is condition of index fragmentation.
> For an example here is on of those tables:
> DBCC SHOWCONTIG scanning 'studenti' table...
> Table: 'studenti' (1635536910); index ID: 0, database ID: 5
> TABLE level scan performed.
> - Pages Scanned........................: 63
> - Extents Scanned.......................: 11
> - Extent Switches.......................: 10
> - Avg. Pages per Extent..................: 5.7
> - Scan Density [Best Count:Actual Count]......: 72.73% [8:11]
> - Extent Scan Fragmentation ...............: 36.36%
> - Avg. Bytes Free per Page................: 492.7
> - Avg. Page Density (full)................: 93.91%
> It's not big table..so far 1209 rows.
> If you noticed there is not value for Logical Scan Fragmentation? All my
> tables in database have that value (45 od them) and just 4 of them not.
> Executin command DBCC INDEXDRAG on that 4 tables, with any fill factor,
> doesn't change and of values in exemple above.
> Other tables, with Logical Scan Fragmentation values shown, are ok and
> DBCC
> INDEXDRAG do just fine..as expected.
> What are possible reasons for this issue or problem!
> Thanx

Logical Scan Fragmentation..issue!

Hello,
I have some issue or problems I dont know?. I have tray DBCC SHOWCONTIG on
all tables on my database to see what is condition of index fragmentation.
For an example here is on of those tables:
DBCC SHOWCONTIG scanning 'studenti' table...
Table: 'studenti' (1635536910); index ID: 0, database ID: 5
TABLE level scan performed.
- Pages Scanned........................: 63
- Extents Scanned.......................: 11
- Extent Switches.......................: 10
- Avg. Pages per Extent..................: 5.7
- Scan Density [Best Count:Actual Count]......: 72.73% [8:11]
- Extent Scan Fragmentation ...............: 36.36%
- Avg. Bytes Free per Page................: 492.7
- Avg. Page Density (full)................: 93.91%
It's not big table..so far 1209 rows.
If you noticed there is not value for Logical Scan Fragmentation? All my
tables in database have that value (45 od them) and just 4 of them not.
Executin command DBCC INDEXDRAG on that 4 tables, with any fill factor,
doesn't change and of values in exemple above.
Other tables, with Logical Scan Fragmentation values shown, are ok and DBCC
INDEXDRAG do just fine..as expected.
What are possible reasons for this issue or problem!
ThanxIt's because the table is a heap (has no clustered index). You can tell
because the index ID is 0. If you check the other tables you should see that
you don't get Logical Scan Fragmentation for any heaps. Here's a quick query
that will determine tables with no clustered index
select [name] from sysobjects
where objectproperty(id,'IsUserTable')=1
and objectproperty(id,'TableHasClustIndex')=0
Logical Scan Fragmentation is not relavent for heaps
--
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Jasmin" <Jasmin@.discussions.microsoft.com> wrote in message
news:F729DB47-DA92-4319-AC14-7BADBE5AC17E@.microsoft.com...
> Hello,
> I have some issue or problems I dont know?. I have tray DBCC SHOWCONTIG on
> all tables on my database to see what is condition of index fragmentation.
> For an example here is on of those tables:
> DBCC SHOWCONTIG scanning 'studenti' table...
> Table: 'studenti' (1635536910); index ID: 0, database ID: 5
> TABLE level scan performed.
> - Pages Scanned........................: 63
> - Extents Scanned.......................: 11
> - Extent Switches.......................: 10
> - Avg. Pages per Extent..................: 5.7
> - Scan Density [Best Count:Actual Count]......: 72.73% [8:11]
> - Extent Scan Fragmentation ...............: 36.36%
> - Avg. Bytes Free per Page................: 492.7
> - Avg. Page Density (full)................: 93.91%
> It's not big table..so far 1209 rows.
> If you noticed there is not value for Logical Scan Fragmentation? All my
> tables in database have that value (45 od them) and just 4 of them not.
> Executin command DBCC INDEXDRAG on that 4 tables, with any fill factor,
> doesn't change and of values in exemple above.
> Other tables, with Logical Scan Fragmentation values shown, are ok and
> DBCC
> INDEXDRAG do just fine..as expected.
> What are possible reasons for this issue or problem!
> Thanx

Friday, February 24, 2012

Logical

I would like to re-index two tables (t1 and t2) if the logical scan
fragmentation is greater 80% on these tables.
Please help me create a t-sql script to create this task.
Thank You,
Please don't post independently in separate newsgroups. You can add
multiple newsgroups to the header and then all the answers appear as one.
See my reply in the other newsgroup.
Andrew J. Kelly SQL MVP
"Joe K." <Joe K.@.discussions.microsoft.com> wrote in message
news:D219E592-9000-49FB-AFE1-B109678802AC@.microsoft.com...
> I would like to re-index two tables (t1 and t2) if the logical scan
> fragmentation is greater 80% on these tables.
> Please help me create a t-sql script to create this task.
> Thank You,

Logical

I would like to re-index two tables (t1 and t2) if the logical scan
fragmentation is greater 80% on these tables.
Please help me create a t-sql script to create this task.
Thank You,Please don't post independently in separate newsgroups. You can add
multiple newsgroups to the header and then all the answers appear as one.
See my reply in the other newsgroup.
Andrew J. Kelly SQL MVP
"Joe K." <Joe K.@.discussions.microsoft.com> wrote in message
news:D219E592-9000-49FB-AFE1-B109678802AC@.microsoft.com...
> I would like to re-index two tables (t1 and t2) if the logical scan
> fragmentation is greater 80% on these tables.
> Please help me create a t-sql script to create this task.
> Thank You,

Logical

I would like to re-index two tables (t1 and t2) if the logical scan
fragmentation is greater 80% on these tables.
Please help me create a t-sql script to create this task.
Thank You,Please don't post independently in separate newsgroups. You can add
multiple newsgroups to the header and then all the answers appear as one.
See my reply in the other newsgroup.
Andrew J. Kelly SQL MVP
"Joe K." <Joe K.@.discussions.microsoft.com> wrote in message
news:D219E592-9000-49FB-AFE1-B109678802AC@.microsoft.com...
> I would like to re-index two tables (t1 and t2) if the logical scan
> fragmentation is greater 80% on these tables.
> Please help me create a t-sql script to create this task.
> Thank You,

Logic on UPDATE query

I am dealing with two tables and I am trying to take one column from a table and match the records with another table and append the data of that column.

I used an update query that looks like this:

UPDATE Acct_table Set Acct_table.Score =
(Select Score_tbl.Score from Score_tbl
Where Acct_table.Acctnb = Score_tbl.Acctnb

This process has been running for over an hour and a half and is building a large log file. I am curious to know if there is a better command that I can use in order to join the tables and then just drop the column from one to the other. Both tables are indexed on Acctnb.

Any insight would truly help.
Thanks!UPDATE A Set A.Score = S.Score
from Acct_table A
JOIN Score_tbl S
ON A.Acctnb = S.Acctnb|||Does anyone else hear an echo?|||Does anyone else hear an echo?No, not a thing. Why?

Yes, I deleted Thrasy's duplicated post

-PatP|||aaaaaaaaaa

Logic Behind Object_ID

I have 2 basic requirements as below,

1) Comparing 2 versions of same database.

2) Keeping track of schema versions of Tables & Stored Procedures so that I can rollback to previous schema.

I have started with Sys.Objects, Sys.Tables & Sys.Columns and I kept things rely on Object_ID but the problem started whenever I change some part of Table. It assigns new Object_ID to the table whenever I change it; moreover creationdate of object is also changed. So I assume that it drops and creates new table.

Please throw some light on following questions,

1) When and How Object_ID Changes?

2) Is there any other thing in database which is Unique & Not Changing with alteration of object?

3) What should be the preferred way to Compare 2 Database?

I hate readymade tools as they charge per user and my requirements are very small.

Thanking you,

Object_ID is internal, and can definitely change when you call the ALTER TABLE / ALTER INDEX statements when the engine decides it is easier to create a new object than to modify the existing table.

The best way to keep track of different version of tables and stored procedures is to use a source control system (like VSTS/SourceSafe). Each time you load a new version in the database, you store the database script in the source control system. If you need to get back to an old version, you simply get the version from source control.

To compore 2 versions of the same database, you can use VSTS for database professionals, which contains this functionality.

Thanks,|||

Versioning is OK. We can easily maintain with Source Control

But Real Headache is DataBase Comparsion, We cannot afford to go for VSTS so there should be some other alternative.

Can you give a brick (clue) for object_id or anything else using which I can build building?

Thanks

|||Would it be possible to use the table name to compare, or do you need to do compares of tables with different names?

Thanks,|||I would definitely use objectname instead of id. Since it's not possible to have to objects with the same name for the same schema. You're guarantee to find the object you're looking for to compare.

Monday, February 20, 2012

Logging the control flow hierarchy

Hello,

I am using the event handling mechanism to do my custom logging. This works fine. Using the OnPreExecute and OnPostExecute my log tables fill up with the start- and enddates of all the containers and tasks in the complete package hierarchy.

However, what I am missing (e.g. in a system variable) is the source ID of the parent container that started the task or container. In other words, in my logging reports, I would like to build up a tree starting with the topmost package, like the progress indication in the IDE.

The built-in Logging features do not log this information either as far as I can tell.

Does anyone know how to do this?

Kind regards,
Jeroen

Watch the Kimball Webcast listed on the first page of this forum. Joy Mundy talks about auditing and she shares with us quite a bit about it and how she did it. One of the things she does is to log the parent package's information and then each child it executes logs its own information along with the parent ID so that everything is tied together.|||

Hi Jeroen,

If you enable logging in parent container this will be done automatically in log file created by SSIS. If you are looking for custom logs then you can use Dts.Log() method to write custom logs. I believe you will have to write your own logic using ScriptTask to build a tree structure for logs.

Thanks

Mohit

|||

MohitGupta wrote:

If you are looking for custom logs then you can use Dts.Log() method to write custom logs.

More information on how to create a custom log provider can be found here: http://msdn2.microsoft.com/en-us/library/ms136010.aspx

Logging table activity

Hi peeps,

We have a great big database (90gb) which has been populated (monopolised) by our finance team, and its full of tables that probably aren't being used at all. But know knows whats being used and what isn't or they don't have the time to go through it with me.

So I have decided to implement a procedure that logs table activity on this database, and if for example a table isn't used for a month then it will be archived off and zipped up.

I have a few ideas in my head how I can acheive this, but I am looking for some opinions and ideas from you guys?

Thanks in advancetriggers everywhere.|||Triggers won't do much for reporting

I'd say you need to use Profiler

Logging stored Procedure changes into file

Hello all,

I have a big stored procedure which is going to alter many tables,insert data, basically lot of changes.

So, i want to have a text file (or) any log file which will display, what all the changes does the stored procedure has done ( They dont want profiler output )

Can anybody know how to log the results of execution of stored procedure to a text file.

Thanks.

Is your stored just going to run once, or many times?

If it is just a one-time batch job type thing, you could create one or more logging tables, and then have your SP do inserts into the logging table that record what was done (like before and after values, etc.)

|||

Unless you use your own logging logic within the procedure or use the profiler or the trace procedure (like the profiler) you won′t be able to do such a tracing.

Jens K. Suessmeyer

http://www.sqlserver2005.de