Showing posts with label file. Show all posts
Showing posts with label file. Show all posts

Friday, March 30, 2012

Problem with Look up

Hi all;

I have created a SSIS package to import data from flat file to database table, which consists of
Flat file Source -> Look up -> OLE DB Destination.
I'm using Look Up in order to avoid duplicate records.
My database table contain around 35,00000 s of rows.
So when I'm running the package the above amount of data goes to Lookup cache, which require a large storage memory.
So I'm not able to execute my package.
I need to run the package in order to update my database.
So is there any solution, in which I can check the duplicate records to get into the database and time consumption to run the package will be less.

Thanks in advance...

Be sure that you are using a SQL statement to only select distinct keys from the table:

select primary_key from table

Then you just simply join the key fields.|||

Hi Sanidha,

You may want to consider key staging the lookup table. Prior to performing the lookup against a 35 million row table, create a staging table containing only the columns (and rows, if identifiable) needed to perform the lookup, then use it instead of the full table.

Hope this helps,
Andy

|||

Andy Leonard wrote:

Hi Sanidha,

You may want to consider key staging the lookup table. Prior to performing the lookup against a 35 million row table, create a staging table containing only the columns (and rows, if identifiable) needed to perform the lookup, then use it instead of the full table.

Hope this helps,
Andy

Why would this matter? Selecting the primary key of the full table (should be indexed!) should be less work than staging the keys first, and then selecting from there. That sounds like an extra, unnecessary step to me and will, in turn, cost more than my approach.

Am I missing something? Unless of course, you're talking about performing a SQL join against that staging table so as to avoid caching the keys in memory.|||

My apologies Sanidha,

I thought the lookup table contained too many rows to fully cache - it was an assumption on my part.

Andy

|||

Andy Leonard wrote:

My apologies Sanidha,

I thought the lookup table contained too many rows to fully cache - it was an assumption on my part.

Andy

Well, yeah, that's the one thing we don't know. I want to be sure the user is selecting *just* the key, and not the whole table.

Wednesday, March 28, 2012

Problem with Large SQL Log file

I'm having a problem with this file SQL log file
It appear by itself in the C: root directory and its filesize keep increasing while the SQL server is running even when I just open/ shutdown the SQL server. It had so far go up to 4GB in just a day.
I had actually keep log files of the SQL Server in another folder, so the SQL file is not created by me nor for any purpose. It keep coming back even when I remove it. Anyone can tell me what's the problem? Is it a virus or whatever?
Hi,
SQL file in C drive is not used by SQL Server. THis file is created by ODBC.
When ever we click the ODBC trace option, this SQL file will be updated and
have all the tracing information.
How to delete or move the file to a alternate location:-
1. Go to COntrol panel--Admin tools- Data sources (ODBC)
2. Double click on ODBC , CLick the Tracing Tab (In the top)
3. If it is Stop tracing then actually Tracing is going on.
4. In that case click "Stop Tracing"
5. Go to C drive root and delete the file or move the file to a diffrent
folder
6. When ever you require you can enable the tracing.
Thanks
Hari
MCDBA
"Kian" <anonymous@.discussions.microsoft.com> wrote in message
news:430A0105-2E68-4999-AEA7-B6D475828E33@.microsoft.com...
> I'm having a problem with this file SQL log file
> It appear by itself in the C: root directory and its filesize keep
increasing while the SQL server is running even when I just open/ shutdown
the SQL server. It had so far go up to 4GB in just a day.
> I had actually keep log files of the SQL Server in another folder, so the
SQL file is not created by me nor for any purpose. It keep coming back even
when I remove it. Anyone can tell me what's the problem? Is it a virus or
whatever?

Problem with Large SQL Log file

I'm having a problem with this file SQL log file
It appear by itself in the C: root directory and its filesize keep increasin
g while the SQL server is running even when I just open/ shutdown the SQL se
rver. It had so far go up to 4GB in just a day.
I had actually keep log files of the SQL Server in another folder, so the SQ
L file is not created by me nor for any purpose. It keep coming back even wh
en I remove it. Anyone can tell me what's the problem? Is it a virus or what
ever?Hi,
SQL file in C drive is not used by SQL Server. THis file is created by ODBC.
When ever we click the ODBC trace option, this SQL file will be updated and
have all the tracing information.
How to delete or move the file to a alternate location:-
1. Go to COntrol panel--Admin tools- Data sources (ODBC)
2. Double click on ODBC , CLick the Tracing Tab (In the top)
3. If it is Stop tracing then actually Tracing is going on.
4. In that case click "Stop Tracing"
5. Go to C drive root and delete the file or move the file to a diffrent
folder
6. When ever you require you can enable the tracing.
Thanks
Hari
MCDBA
"Kian" <anonymous@.discussions.microsoft.com> wrote in message
news:430A0105-2E68-4999-AEA7-B6D475828E33@.microsoft.com...
> I'm having a problem with this file SQL log file
> It appear by itself in the C: root directory and its filesize keep
increasing while the SQL server is running even when I just open/ shutdown
the SQL server. It had so far go up to 4GB in just a day.
> I had actually keep log files of the SQL Server in another folder, so the
SQL file is not created by me nor for any purpose. It keep coming back even
when I remove it. Anyone can tell me what's the problem? Is it a virus or
whatever?sql

Problem with Large SQL Log file

I'm having a problem with this file SQL log fil
It appear by itself in the C: root directory and its filesize keep increasing while the SQL server is running even when I just open/ shutdown the SQL server. It had so far go up to 4GB in just a day
I had actually keep log files of the SQL Server in another folder, so the SQL file is not created by me nor for any purpose. It keep coming back even when I remove it. Anyone can tell me what's the problem? Is it a virus or whatever?Hi,
SQL file in C drive is not used by SQL Server. THis file is created by ODBC.
When ever we click the ODBC trace option, this SQL file will be updated and
have all the tracing information.
How to delete or move the file to a alternate location:-
1. Go to COntrol panel--Admin tools- Data sources (ODBC)
2. Double click on ODBC , CLick the Tracing Tab (In the top)
3. If it is Stop tracing then actually Tracing is going on.
4. In that case click "Stop Tracing"
5. Go to C drive root and delete the file or move the file to a diffrent
folder
6. When ever you require you can enable the tracing.
Thanks
Hari
MCDBA
"Kian" <anonymous@.discussions.microsoft.com> wrote in message
news:430A0105-2E68-4999-AEA7-B6D475828E33@.microsoft.com...
> I'm having a problem with this file SQL log file
> It appear by itself in the C: root directory and its filesize keep
increasing while the SQL server is running even when I just open/ shutdown
the SQL server. It had so far go up to 4GB in just a day.
> I had actually keep log files of the SQL Server in another folder, so the
SQL file is not created by me nor for any purpose. It keep coming back even
when I remove it. Anyone can tell me what's the problem? Is it a virus or
whatever?

Monday, March 26, 2012

Problem with installing sp4

I can't install sp4. I got error :Error running script: replsys.sql (1)
looking in sqllog, I have this lines (at the end of file).
...
12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\setup.iss returned: 0, 0
12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlsp.log returned: 0, 0
12:13:12 SetFileSecuritySQLAndAdmin for returned: 3, 3
12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlsp.log returned: 0, 0
12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlstp.log returned: 0, 0
12:13:12 SetFileSecPerfAndLogUsers for C:\Program Files\Microsoft SQL
Server\MSSQL\Binn\SQLCTR80.DLL returned: 1332, 1332
12:13:12 Begin ServPriv (MSSQLSERVER)
12:13:12 End ServPriv()
12:13:13 Upgrading databases
12:13:13 Upgrading databases on instance 'MSSQLSERVER'
12:13:13 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\s cm.exe -Silent
1 -Action 6 -Service MSSQLSERVER
12:13:13 Process Exit Code: (0)
12:13:13 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\s cm.exe -Silent
1 -Action 6 -Service MSSQLSERVER
12:13:13 Process Exit Code: (0)
12:13:13 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\s cm.exe -Silent
1 -Action 1 -Service MSSQLSERVER -StartupOptions \-T4022 \-T4010 \-m
12:13:34 Process Exit Code: (0)
12:13:34 C:\SQL2KSP4\x86\BINN\osql.exe -Slpc:BOGIBATINA -b -n -d master -o
"C:\Program Files\Microsoft SQL Server\MSSQL\install\replsys.out" -i
"C:\Program Files\Microsoft SQL Server\MSSQL\install\replsys.sql" -Usa -P"
12:13:34 Process Exit Code: (1)
12:14:10 Error running script: replsys.sql (1)
12:14:10 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\s cm.exe -Silent
1 -Action 6 -Service MSSQLSERVER
12:14:25 Process Exit Code: (0)
12:14:25 Action CleanUpInstall:
12:14:25 Installation Failed.
Have you looked in this file?
C:\Program Files\Microsoft SQL Server\MSSQL\install\replsys.out
R.
"Radovan" <radovan@.servis24.hr> wrote in message
news:OWXdLAeuFHA.2072@.TK2MSFTNGP14.phx.gbl...
> I can't install sp4. I got error :Error running script: replsys.sql (1)
> looking in sqllog, I have this lines (at the end of file).
> ...
> 12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\setup.iss returned: 0, 0
> 12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlsp.log returned: 0, 0
> 12:13:12 SetFileSecuritySQLAndAdmin for returned: 3, 3
> 12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlsp.log returned: 0, 0
> 12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlstp.log returned: 0, 0
> 12:13:12 SetFileSecPerfAndLogUsers for C:\Program Files\Microsoft SQL
> Server\MSSQL\Binn\SQLCTR80.DLL returned: 1332, 1332
> 12:13:12 Begin ServPriv (MSSQLSERVER)
> 12:13:12 End ServPriv()
> 12:13:13 Upgrading databases
> 12:13:13 Upgrading databases on instance 'MSSQLSERVER'
> 12:13:13 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\s cm.exe -Silent
> 1 -Action 6 -Service MSSQLSERVER
> 12:13:13 Process Exit Code: (0)
> 12:13:13 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\s cm.exe -Silent
> 1 -Action 6 -Service MSSQLSERVER
> 12:13:13 Process Exit Code: (0)
> 12:13:13 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\s cm.exe -Silent
> 1 -Action 1 -Service MSSQLSERVER -StartupOptions \-T4022 \-T4010 \-m
> 12:13:34 Process Exit Code: (0)
> 12:13:34 C:\SQL2KSP4\x86\BINN\osql.exe -Slpc:BOGIBATINA -b -n -d master -o
> "C:\Program Files\Microsoft SQL Server\MSSQL\install\replsys.out" -i
> "C:\Program Files\Microsoft SQL Server\MSSQL\install\replsys.sql" -Usa -P"
> 12:13:34 Process Exit Code: (1)
> 12:14:10 Error running script: replsys.sql (1)
> 12:14:10 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\s cm.exe -Silent
> 1 -Action 6 -Service MSSQLSERVER
> 12:14:25 Process Exit Code: (0)
> 12:14:25 Action CleanUpInstall:
> 12:14:25 Installation Failed.
>
|||Check what other processes are running on your server. I had the same
problem updating to SP4. I had to stop MOM services, Windows update
processes, and end anything else that may be using SQL. Then the SP4
install will go OK.
Mike
R wrote:[vbcol=seagreen]
> Have you looked in this file?
> C:\Program Files\Microsoft SQL Server\MSSQL\install\replsys.out
> R.
> "Radovan" <radovan@.servis24.hr> wrote in message
> news:OWXdLAeuFHA.2072@.TK2MSFTNGP14.phx.gbl...
|||Thanks that helps.
Radovan
"inqbbus" <inqbbus@.gmail.com> wrote in message
news:1126820621.538655.83620@.g47g2000cwa.googlegro ups.com...
> Check what other processes are running on your server. I had the same
> problem updating to SP4. I had to stop MOM services, Windows update
> processes, and end anything else that may be using SQL. Then the SP4
> install will go OK.
> Mike
> R wrote:
>

Problem with installing sp4

I can't install sp4. I got error :Error running script: replsys.sql (1)
looking in sqllog, I have this lines (at the end of file).
...
12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\setup.iss returned: 0, 0
12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlsp.log returned: 0, 0
12:13:12 SetFileSecuritySQLAndAdmin for returned: 3, 3
12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlsp.log returned: 0, 0
12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlstp.log returned: 0, 0
12:13:12 SetFileSecPerfAndLogUsers for C:\Program Files\Microsoft SQL
Server\MSSQL\Binn\SQLCTR80.DLL returned: 1332, 1332
12:13:12 Begin ServPriv (MSSQLSERVER)
12:13:12 End ServPriv()
12:13:13 Upgrading databases
12:13:13 Upgrading databases on instance 'MSSQLSERVER'
12:13:13 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlS
etup\Bin\scm.exe -Silent
1 -Action 6 -Service MSSQLSERVER
12:13:13 Process Exit Code: (0)
12:13:13 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlS
etup\Bin\scm.exe -Silent
1 -Action 6 -Service MSSQLSERVER
12:13:13 Process Exit Code: (0)
12:13:13 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlS
etup\Bin\scm.exe -Silent
1 -Action 1 -Service MSSQLSERVER -StartupOptions \-T4022 \-T4010 \-m
12:13:34 Process Exit Code: (0)
12:13:34 C:\SQL2KSP4\x86\BINN\osql.exe -Slpc:BOGIBATINA -b -n -d master -o
"C:\Program Files\Microsoft SQL Server\MSSQL\install\replsys.out" -i
"C:\Program Files\Microsoft SQL Server\MSSQL\install\replsys.sql" -Usa -P"
12:13:34 Process Exit Code: (1)
12:14:10 Error running script: replsys.sql (1)
12:14:10 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlS
etup\Bin\scm.exe -Silent
1 -Action 6 -Service MSSQLSERVER
12:14:25 Process Exit Code: (0)
12:14:25 Action CleanUpInstall:
12:14:25 Installation Failed.Have you looked in this file?
C:\Program Files\Microsoft SQL Server\MSSQL\install\replsys.out
R.
"Radovan" <radovan@.servis24.hr> wrote in message
news:OWXdLAeuFHA.2072@.TK2MSFTNGP14.phx.gbl...
> I can't install sp4. I got error :Error running script: replsys.sql (1)
> looking in sqllog, I have this lines (at the end of file).
> ...
> 12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\setup.iss returned: 0, 0
> 12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlsp.log returned: 0, 0
> 12:13:12 SetFileSecuritySQLAndAdmin for returned: 3, 3
> 12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlsp.log returned: 0, 0
> 12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlstp.log returned: 0, 0
> 12:13:12 SetFileSecPerfAndLogUsers for C:\Program Files\Microsoft SQL
> Server\MSSQL\Binn\SQLCTR80.DLL returned: 1332, 1332
> 12:13:12 Begin ServPriv (MSSQLSERVER)
> 12:13:12 End ServPriv()
> 12:13:13 Upgrading databases
> 12:13:13 Upgrading databases on instance 'MSSQLSERVER'
> 12:13:13 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlS
etup\Bin\scm.exe -Silent
> 1 -Action 6 -Service MSSQLSERVER
> 12:13:13 Process Exit Code: (0)
> 12:13:13 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlS
etup\Bin\scm.exe -Silent
> 1 -Action 6 -Service MSSQLSERVER
> 12:13:13 Process Exit Code: (0)
> 12:13:13 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlS
etup\Bin\scm.exe -Silent
> 1 -Action 1 -Service MSSQLSERVER -StartupOptions \-T4022 \-T4010 \-m
> 12:13:34 Process Exit Code: (0)
> 12:13:34 C:\SQL2KSP4\x86\BINN\osql.exe -Slpc:BOGIBATINA -b -n -d master -o
> "C:\Program Files\Microsoft SQL Server\MSSQL\install\replsys.out" -i
> "C:\Program Files\Microsoft SQL Server\MSSQL\install\replsys.sql" -Usa -P"
> 12:13:34 Process Exit Code: (1)
> 12:14:10 Error running script: replsys.sql (1)
> 12:14:10 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlS
etup\Bin\scm.exe -Silent
> 1 -Action 6 -Service MSSQLSERVER
> 12:14:25 Process Exit Code: (0)
> 12:14:25 Action CleanUpInstall:
> 12:14:25 Installation Failed.
>|||Check what other processes are running on your server. I had the same
problem updating to SP4. I had to stop MOM services, Windows update
processes, and end anything else that may be using SQL. Then the SP4
install will go OK.
Mike
R wrote:[vbcol=seagreen]
> Have you looked in this file?
> C:\Program Files\Microsoft SQL Server\MSSQL\install\replsys.out
> R.
> "Radovan" <radovan@.servis24.hr> wrote in message
> news:OWXdLAeuFHA.2072@.TK2MSFTNGP14.phx.gbl...|||Thanks that helps.
Radovan
"inqbbus" <inqbbus@.gmail.com> wrote in message
news:1126820621.538655.83620@.g47g2000cwa.googlegroups.com...
> Check what other processes are running on your server. I had the same
> problem updating to SP4. I had to stop MOM services, Windows update
> processes, and end anything else that may be using SQL. Then the SP4
> install will go OK.
> Mike
> R wrote:
>sql

Problem with installing sp4

I can't install sp4. I got error :Error running script: replsys.sql (1)
looking in sqllog, I have this lines (at the end of file).
...
12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\setup.iss returned: 0, 0
12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlsp.log returned: 0, 0
12:13:12 SetFileSecuritySQLAndAdmin for returned: 3, 3
12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlsp.log returned: 0, 0
12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlstp.log returned: 0, 0
12:13:12 SetFileSecPerfAndLogUsers for C:\Program Files\Microsoft SQL
Server\MSSQL\Binn\SQLCTR80.DLL returned: 1332, 1332
12:13:12 Begin ServPriv (MSSQLSERVER)
12:13:12 End ServPriv()
12:13:13 Upgrading databases
12:13:13 Upgrading databases on instance 'MSSQLSERVER'
12:13:13 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\scm.exe -Silent
1 -Action 6 -Service MSSQLSERVER
12:13:13 Process Exit Code: (0)
12:13:13 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\scm.exe -Silent
1 -Action 6 -Service MSSQLSERVER
12:13:13 Process Exit Code: (0)
12:13:13 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\scm.exe -Silent
1 -Action 1 -Service MSSQLSERVER -StartupOptions \-T4022 \-T4010 \-m
12:13:34 Process Exit Code: (0)
12:13:34 C:\SQL2KSP4\x86\BINN\osql.exe -Slpc:BOGIBATINA -b -n -d master -o
"C:\Program Files\Microsoft SQL Server\MSSQL\install\replsys.out" -i
"C:\Program Files\Microsoft SQL Server\MSSQL\install\replsys.sql" -Usa -P"
12:13:34 Process Exit Code: (1)
12:14:10 Error running script: replsys.sql (1)
12:14:10 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\scm.exe -Silent
1 -Action 6 -Service MSSQLSERVER
12:14:25 Process Exit Code: (0)
12:14:25 Action CleanUpInstall:
12:14:25 Installation Failed.Have you looked in this file?
C:\Program Files\Microsoft SQL Server\MSSQL\install\replsys.out
R.
"Radovan" <radovan@.servis24.hr> wrote in message
news:OWXdLAeuFHA.2072@.TK2MSFTNGP14.phx.gbl...
> I can't install sp4. I got error :Error running script: replsys.sql (1)
> looking in sqllog, I have this lines (at the end of file).
> ...
> 12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\setup.iss returned: 0, 0
> 12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlsp.log returned: 0, 0
> 12:13:12 SetFileSecuritySQLAndAdmin for returned: 3, 3
> 12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlsp.log returned: 0, 0
> 12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlstp.log returned: 0, 0
> 12:13:12 SetFileSecPerfAndLogUsers for C:\Program Files\Microsoft SQL
> Server\MSSQL\Binn\SQLCTR80.DLL returned: 1332, 1332
> 12:13:12 Begin ServPriv (MSSQLSERVER)
> 12:13:12 End ServPriv()
> 12:13:13 Upgrading databases
> 12:13:13 Upgrading databases on instance 'MSSQLSERVER'
> 12:13:13 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\scm.exe -Silent
> 1 -Action 6 -Service MSSQLSERVER
> 12:13:13 Process Exit Code: (0)
> 12:13:13 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\scm.exe -Silent
> 1 -Action 6 -Service MSSQLSERVER
> 12:13:13 Process Exit Code: (0)
> 12:13:13 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\scm.exe -Silent
> 1 -Action 1 -Service MSSQLSERVER -StartupOptions \-T4022 \-T4010 \-m
> 12:13:34 Process Exit Code: (0)
> 12:13:34 C:\SQL2KSP4\x86\BINN\osql.exe -Slpc:BOGIBATINA -b -n -d master -o
> "C:\Program Files\Microsoft SQL Server\MSSQL\install\replsys.out" -i
> "C:\Program Files\Microsoft SQL Server\MSSQL\install\replsys.sql" -Usa -P"
> 12:13:34 Process Exit Code: (1)
> 12:14:10 Error running script: replsys.sql (1)
> 12:14:10 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\scm.exe -Silent
> 1 -Action 6 -Service MSSQLSERVER
> 12:14:25 Process Exit Code: (0)
> 12:14:25 Action CleanUpInstall:
> 12:14:25 Installation Failed.
>|||Check what other processes are running on your server. I had the same
problem updating to SP4. I had to stop MOM services, Windows update
processes, and end anything else that may be using SQL. Then the SP4
install will go OK.
Mike
R wrote:
> Have you looked in this file?
> C:\Program Files\Microsoft SQL Server\MSSQL\install\replsys.out
> R.
> "Radovan" <radovan@.servis24.hr> wrote in message
> news:OWXdLAeuFHA.2072@.TK2MSFTNGP14.phx.gbl...
> > I can't install sp4. I got error :Error running script: replsys.sql (1)
> >
> > looking in sqllog, I have this lines (at the end of file).
> >
> > ...
> > 12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\setup.iss returned: 0, 0
> > 12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlsp.log returned: 0, 0
> >
> > 12:13:12 SetFileSecuritySQLAndAdmin for returned: 3, 3
> >
> > 12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlsp.log returned: 0, 0
> >
> > 12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlstp.log returned: 0, 0
> >
> > 12:13:12 SetFileSecPerfAndLogUsers for C:\Program Files\Microsoft SQL
> > Server\MSSQL\Binn\SQLCTR80.DLL returned: 1332, 1332
> >
> > 12:13:12 Begin ServPriv (MSSQLSERVER)
> >
> > 12:13:12 End ServPriv()
> >
> > 12:13:13 Upgrading databases
> >
> > 12:13:13 Upgrading databases on instance 'MSSQLSERVER'
> >
> > 12:13:13 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\scm.exe -Silent
> > 1 -Action 6 -Service MSSQLSERVER
> >
> > 12:13:13 Process Exit Code: (0)
> >
> > 12:13:13 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\scm.exe -Silent
> > 1 -Action 6 -Service MSSQLSERVER
> >
> > 12:13:13 Process Exit Code: (0)
> >
> > 12:13:13 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\scm.exe -Silent
> > 1 -Action 1 -Service MSSQLSERVER -StartupOptions \-T4022 \-T4010 \-m
> >
> > 12:13:34 Process Exit Code: (0)
> >
> > 12:13:34 C:\SQL2KSP4\x86\BINN\osql.exe -Slpc:BOGIBATINA -b -n -d master -o
> > "C:\Program Files\Microsoft SQL Server\MSSQL\install\replsys.out" -i
> > "C:\Program Files\Microsoft SQL Server\MSSQL\install\replsys.sql" -Usa -P"
> >
> > 12:13:34 Process Exit Code: (1)
> >
> > 12:14:10 Error running script: replsys.sql (1)
> >
> > 12:14:10 C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\scm.exe -Silent
> > 1 -Action 6 -Service MSSQLSERVER
> >
> > 12:14:25 Process Exit Code: (0)
> >
> > 12:14:25 Action CleanUpInstall:
> >
> > 12:14:25 Installation Failed.
> >
> >|||Thanks that helps.
Radovan
"inqbbus" <inqbbus@.gmail.com> wrote in message
news:1126820621.538655.83620@.g47g2000cwa.googlegroups.com...
> Check what other processes are running on your server. I had the same
> problem updating to SP4. I had to stop MOM services, Windows update
> processes, and end anything else that may be using SQL. Then the SP4
> install will go OK.
> Mike
> R wrote:
>> Have you looked in this file?
>> C:\Program Files\Microsoft SQL Server\MSSQL\install\replsys.out
>> R.
>> "Radovan" <radovan@.servis24.hr> wrote in message
>> news:OWXdLAeuFHA.2072@.TK2MSFTNGP14.phx.gbl...
>> > I can't install sp4. I got error :Error running script: replsys.sql (1)
>> >
>> > looking in sqllog, I have this lines (at the end of file).
>> >
>> > ...
>> > 12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\setup.iss returned: 0,
>> > 0
>> > 12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlsp.log returned: 0,
>> > 0
>> >
>> > 12:13:12 SetFileSecuritySQLAndAdmin for returned: 3, 3
>> >
>> > 12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlsp.log returned: 0,
>> > 0
>> >
>> > 12:13:12 SetFileSecuritySQLAndAdmin for C:\WINNT\sqlstp.log returned:
>> > 0, 0
>> >
>> > 12:13:12 SetFileSecPerfAndLogUsers for C:\Program Files\Microsoft SQL
>> > Server\MSSQL\Binn\SQLCTR80.DLL returned: 1332, 1332
>> >
>> > 12:13:12 Begin ServPriv (MSSQLSERVER)
>> >
>> > 12:13:12 End ServPriv()
>> >
>> > 12:13:13 Upgrading databases
>> >
>> > 12:13:13 Upgrading databases on instance 'MSSQLSERVER'
>> >
>> > 12:13:13
>> > C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\scm.exe -Silent
>> > 1 -Action 6 -Service MSSQLSERVER
>> >
>> > 12:13:13 Process Exit Code: (0)
>> >
>> > 12:13:13
>> > C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\scm.exe -Silent
>> > 1 -Action 6 -Service MSSQLSERVER
>> >
>> > 12:13:13 Process Exit Code: (0)
>> >
>> > 12:13:13
>> > C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\scm.exe -Silent
>> > 1 -Action 1 -Service MSSQLSERVER -StartupOptions \-T4022 \-T4010 \-m
>> >
>> > 12:13:34 Process Exit Code: (0)
>> >
>> > 12:13:34 C:\SQL2KSP4\x86\BINN\osql.exe -Slpc:BOGIBATINA -b -n -d
>> > master -o
>> > "C:\Program Files\Microsoft SQL Server\MSSQL\install\replsys.out" -i
>> > "C:\Program Files\Microsoft SQL
>> > Server\MSSQL\install\replsys.sql" -Usa -P"
>> >
>> > 12:13:34 Process Exit Code: (1)
>> >
>> > 12:14:10 Error running script: replsys.sql (1)
>> >
>> > 12:14:10
>> > C:\DOCUME~1\radovan\LOCALS~1\Temp\1\SqlSetup\Bin\scm.exe -Silent
>> > 1 -Action 6 -Service MSSQLSERVER
>> >
>> > 12:14:25 Process Exit Code: (0)
>> >
>> > 12:14:25 Action CleanUpInstall:
>> >
>> > 12:14:25 Installation Failed.
>> >
>> >
>

Friday, March 23, 2012

Problem with Index Tuning Wizard

Hi,
Before using the ITW, you should get a load of the queries
you are running. You can capture the events in profiler
and then use that load file for the ITW to use.
hth
DeeJay
>--Original Message--
>When running the Index Tuning Wizard (ITW) on our SQL
Server we got a
>error message : 'Could not complete cursor operation
because the table
>schema changed after the cursor was declared'
>The ITW was used only to advice new indexes. I know that
it creates
>hypothetical indexes in the sysindexes table, but what
are the changes
>in the user-tables ?
>How do you use the ITW without interfering with the real
>schema-definitions ?
>thanks,
>Robbert
>.
>
I know how to use the ITW. The problem is the tuning part. According to
the error-message, the ITW makes changes. What are these changes and why
are they interfering?
Robbert
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
sql

Problem with Index Tuning Wizard

Hi,
Before using the ITW, you should get a load of the queries
you are running. You can capture the events in profiler
and then use that load file for the ITW to use.
hth
DeeJay
>--Original Message--
>When running the Index Tuning Wizard (ITW) on our SQL
Server we got a
>error message : 'Could not complete cursor operation
because the table
>schema changed after the cursor was declared'
>The ITW was used only to advice new indexes. I know that
it creates
>hypothetical indexes in the sysindexes table, but what
are the changes
>in the user-tables ?
>How do you use the ITW without interfering with the real
>schema-definitions ?
>thanks,
>Robbert
>.
>I know how to use the ITW. The problem is the tuning part. According to
the error-message, the ITW makes changes. What are these changes and why
are they interfering?
Robbert
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!

Problem with importing TXT file to SQL Server

I have a .TXT file that I would like to import to SQL Server on my machine.
The .TXT file is comma (,) delimited, with only 4 rows and 185 fields
(columns). The size of the TXT file is 4 KB.
A sample of 1 of the row in the TXT file is as follows:
"A","B"," B1","B0001","F1","OMAAA,"D",.........
In SQL Server I created a new database called "maint". I right click - All
Tasks - Import Data.
On the question "From where do you want to copy the data, I selected "Text
File" for "Data Source" and enter the filename "C:\MN.TXT"
On the file format, I selected all the default : "Delimited", File Type =
ANSI, Row Delimiter = {CR}{LF}, Text Qualifier = Double Quote {"}, Skip Rows
= 0.
On the Column delimiter, I selected the default = Comma
On the destination, I selected "Microsoft OLE DB Provider for SQL Server"
and selected my server (Local) and my database "maint".
When I run it, on the step "copy data from MN to [maint].[dbo].MN" I got an
error "Not enough storage is available to complete this operation". It
successfully created the tables and fields (columns) in the "maint"
database.
I have 24 G of free space in my machine.
Am I importing this TXT file incorrectly ?
Thanks.
Sorry, I posted too early. I found out my problem. I have to click on
"Transform" to change the field from varchar(8000) to varchar(30). This
fixed the problem. Thanks.
"fniles" <fniles@.pfmail.com> wrote in message
news:%23LxAn89rEHA.3428@.TK2MSFTNGP11.phx.gbl...
>I have a .TXT file that I would like to import to SQL Server on my machine.
> The .TXT file is comma (,) delimited, with only 4 rows and 185 fields
> (columns). The size of the TXT file is 4 KB.
> A sample of 1 of the row in the TXT file is as follows:
> "A","B"," B1","B0001","F1","OMAAA,"D",.........
> In SQL Server I created a new database called "maint". I right click - All
> Tasks - Import Data.
> On the question "From where do you want to copy the data, I selected "Text
> File" for "Data Source" and enter the filename "C:\MN.TXT"
> On the file format, I selected all the default : "Delimited", File Type =
> ANSI, Row Delimiter = {CR}{LF}, Text Qualifier = Double Quote {"}, Skip
> Rows = 0.
> On the Column delimiter, I selected the default = Comma
> On the destination, I selected "Microsoft OLE DB Provider for SQL Server"
> and selected my server (Local) and my database "maint".
> When I run it, on the step "copy data from MN to [maint].[dbo].MN" I got
> an error "Not enough storage is available to complete this operation". It
> successfully created the tables and fields (columns) in the "maint"
> database.
> I have 24 G of free space in my machine.
> Am I importing this TXT file incorrectly ?
> Thanks.
>
>
sql

Problem with importing TXT file to SQL Server

I have a .TXT file that I would like to import to SQL Server on my machine.
The .TXT file is comma (,) delimited, with only 4 rows and 185 fields
(columns). The size of the TXT file is 4 KB.
A sample of 1 of the row in the TXT file is as follows:
"A","B"," B1","B0001","F1","OMAAA,"D",.........
In SQL Server I created a new database called "maint". I right click - All
Tasks - Import Data.
On the question "From where do you want to copy the data, I selected "Text
File" for "Data Source" and enter the filename "C:\MN.TXT"
On the file format, I selected all the default : "Delimited", File Type =
ANSI, Row Delimiter = {CR}{LF}, Text Qualifier = Double Quote
3;"}, Skip Rows
= 0.
On the Column delimiter, I selected the default = Comma
On the destination, I selected "Microsoft OLE DB Provider for SQL Server"
and selected my server (Local) and my database "maint".
When I run it, on the step "copy data from MN to [maint].[dbo].MN" I
got an
error "Not enough storage is available to complete this operation". It
successfully created the tables and fields (columns) in the "maint"
database.
I have 24 G of free space in my machine.
Am I importing this TXT file incorrectly ?
Thanks.Sorry, I posted too early. I found out my problem. I have to click on
"Transform" to change the field from varchar(8000) to varchar(30). This
fixed the problem. Thanks.
"fniles" <fniles@.pfmail.com> wrote in message
news:%23LxAn89rEHA.3428@.TK2MSFTNGP11.phx.gbl...
>I have a .TXT file that I would like to import to SQL Server on my machine.
> The .TXT file is comma (,) delimited, with only 4 rows and 185 fields
> (columns). The size of the TXT file is 4 KB.
> A sample of 1 of the row in the TXT file is as follows:
> "A","B"," B1","B0001","F1","OMAAA,"D",.........
> In SQL Server I created a new database called "maint". I right click - All
> Tasks - Import Data.
> On the question "From where do you want to copy the data, I selected "Text
> File" for "Data Source" and enter the filename "C:\MN.TXT"
> On the file format, I selected all the default : "Delimited", File Type =
> ANSI, Row Delimiter = {CR}{LF}, Text Qualifier = Double Quote &#
123;"}, Skip
> Rows = 0.
> On the Column delimiter, I selected the default = Comma
> On the destination, I selected "Microsoft OLE DB Provider for SQL Server"
> and selected my server (Local) and my database "maint".
> When I run it, on the step "copy data from MN to [maint].[dbo].MN"
I got
> an error "Not enough storage is available to complete this operation". It
> successfully created the tables and fields (columns) in the "maint"
> database.
> I have 24 G of free space in my machine.
> Am I importing this TXT file incorrectly ?
> Thanks.
>
>

Problem with importing TXT file to SQL Server

I have a .TXT file that I would like to import to SQL Server on my machine.
The .TXT file is comma (,) delimited, with only 4 rows and 185 fields
(columns). The size of the TXT file is 4 KB.
A sample of 1 of the row in the TXT file is as follows:
"A","B"," B1","B0001","F1","OMAAA,"D",.........
In SQL Server I created a new database called "maint". I right click - All
Tasks - Import Data.
On the question "From where do you want to copy the data, I selected "Text
File" for "Data Source" and enter the filename "C:\MN.TXT"
On the file format, I selected all the default : "Delimited", File Type = ANSI, Row Delimiter = {CR}{LF}, Text Qualifier = Double Quote {"}, Skip Rows
= 0.
On the Column delimiter, I selected the default = Comma
On the destination, I selected "Microsoft OLE DB Provider for SQL Server"
and selected my server (Local) and my database "maint".
When I run it, on the step "copy data from MN to [maint].[dbo].MN" I got an
error "Not enough storage is available to complete this operation". It
successfully created the tables and fields (columns) in the "maint"
database.
I have 24 G of free space in my machine.
Am I importing this TXT file incorrectly ?
Thanks.Sorry, I posted too early. I found out my problem. I have to click on
"Transform" to change the field from varchar(8000) to varchar(30). This
fixed the problem. Thanks.
"fniles" <fniles@.pfmail.com> wrote in message
news:%23LxAn89rEHA.3428@.TK2MSFTNGP11.phx.gbl...
>I have a .TXT file that I would like to import to SQL Server on my machine.
> The .TXT file is comma (,) delimited, with only 4 rows and 185 fields
> (columns). The size of the TXT file is 4 KB.
> A sample of 1 of the row in the TXT file is as follows:
> "A","B"," B1","B0001","F1","OMAAA,"D",.........
> In SQL Server I created a new database called "maint". I right click - All
> Tasks - Import Data.
> On the question "From where do you want to copy the data, I selected "Text
> File" for "Data Source" and enter the filename "C:\MN.TXT"
> On the file format, I selected all the default : "Delimited", File Type => ANSI, Row Delimiter = {CR}{LF}, Text Qualifier = Double Quote {"}, Skip
> Rows = 0.
> On the Column delimiter, I selected the default = Comma
> On the destination, I selected "Microsoft OLE DB Provider for SQL Server"
> and selected my server (Local) and my database "maint".
> When I run it, on the step "copy data from MN to [maint].[dbo].MN" I got
> an error "Not enough storage is available to complete this operation". It
> successfully created the tables and fields (columns) in the "maint"
> database.
> I have 24 G of free space in my machine.
> Am I importing this TXT file incorrectly ?
> Thanks.
>
>

problem with importing the excel file SQL Server 2k5

I got the following error when importing file to sql server 2005. I reinstalled the MDAC as well.

Please help.

TITLE: SQL Server Import and Export Wizard

An error occurred which the SQL Server Integration Services Wizard was not prepared to handle.


ADDITIONAL INFORMATION:

Exception has been thrown by the target of an invocation. (mscorlib)

The connection type "EXCEL" specified for connection manager "{E3861233-443A-439A-BB8D-2777D84DB343}" is not recognized as a valid connection manager type. This error is returned when an attempt is made to create a connection manager for an unknown connection type. Check the spelling in the connection type name.
({C3728B0D-B172-4246-9B14-6EEDAB60F191})

The connection type "EXCEL" specified for connection manager "{E3861233-443A-439A-BB8D-2777D84DB343}" is not recognized as a valid connection manager type. This error is returned when an attempt is made to create a connection manager for an unknown connection type. Check the spelling in the connection type name.
({C3728B0D-B172-4246-9B14-6EEDAB60F191})


BUTTONS:

OK

Have you removed any connection manager that was used by some task(s)?

Since the error message shows the ID of the connection manager; it looks like that a connection manager was delete it but the references to it have not been removed. Make sure all tasks/source/destiantions in the mapping are pointing to a valid connection manager.

|||what do u mean by connection manager? I've no idea.|||Ok. Let's back to the basics. How did you create the package? are you running it in BIDS?|||

Could you tell us what version of SQL Server you have installed (RTM, SP1, SP2)?

Also, could you describe how you configured each page of the Import/Export wizard?

Thanks,

Bob

|||

I am having the similar problem: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1867309&SiteID=1

I would like to provide a greater detailed info if needed. I am looking for solutions.

Problem with importing a CSV into database

Hi,

Presenlty Iam facing problem while trying to import a .csv file into the database.
Issue is that... I am able to achieve my functionality when i import a file from D:\
But when i run the same program... and try to import from C:\ its throwing an exception.

I am coding in VB (Visual Studio 2005 ) and database is Microsoft SQL SERVER 2005.
My project is currently running on local machine in C:\Inetpub\wwwroot

Im using the following code to query the database...

SELECT employeeid, IDCubeID, ClockTime, ClockType, CreatedDate, Status, EntryType, ' ' as Remark,YardID,YardName,' ' as UserModify,' ' as UserCreate,DateModify,JobNo FROM & File1.PostedFile.FileName.ToString

where File1.PostedFile.FileName.ToString = D:\RawData_ClockTime.csv

when i import from C drive .. (File1.PostedFile.FileName.ToString = C:\RawData_ClockTime.csv)
it is throwing an exception as follows...

The Microsoft Jet database engine could not find the object 'RawData_ClockTime.csv'. Make sure the object exists and that you spell its name and the path name correctly.Always remember that C: drive on your local machine and on your server is not the same.

Use \\machine_name\.... instead.

Good Luck.

Problem with import data from excel format file.

Hi All

I have a huge excel format file wants to export to sql server
database. One of the field has combination of numeric and
alphanumeric. When I import the excel format to sql server database,
the numeric is successfully imported but the alphanumeric does not
import at all.

Does anyone know how to solve my problem?

I am using SQL 2k and the spreadsheet is excel 2003

Thanks

Rich

You may have to use Data Conversion to convert data suitable to your SQL data type.sql

Problem with import data from excel format file.

Hi all,

I have a huge excel format file wants to export to sql server
database. One of the field has combination of numeric and
alphanumeric. When I import the excel format to sql server database,
the numeric is successfully imported but the alphanumeric does not
import at all.

Does anyone know how to solve my problem?

Thanks.

-HS PhuahOn 2 Dec 2003 02:21:24 -0800, hsphuah@.usa.com (Hon Seng Phuah) wrote:

>Hi all,
>I have a huge excel format file wants to export to sql server
>database. One of the field has combination of numeric and
>alphanumeric. When I import the excel format to sql server database,
>the numeric is successfully imported but the alphanumeric does not
>import at all.
>Does anyone know how to solve my problem?
>Thanks.
>-HS Phuah
Is the data in that column in the first row to be processed completely
numeric? Maybe if you sorted it such that this was alpha, sql server
would recognize the column as being alphanumeric and bring the lot in.

I'm assuming that you haven't defined the table in your db, and are
letting some tool do it for you.|||hsphuah@.usa.com (Hon Seng Phuah) wrote in message news:<3898598f.0312020221.e23a72c@.posting.google.com>...
> Hi all,
> I have a huge excel format file wants to export to sql server
> database. One of the field has combination of numeric and
> alphanumeric. When I import the excel format to sql server database,
> the numeric is successfully imported but the alphanumeric does not
> import at all.
> Does anyone know how to solve my problem?
> Thanks.
> -HS Phuah

You really need to give some more information - what version of SQL
Server, how are you importing the file, what format are the source
data in, what is the DDL for the target table, what does "not import"
mean?

One possibility is that the data type of the target column doesn't
allow alpanumeric characters. Another is that you're seeing this
issue:

http://www.sqldts.com/default.aspx?254

Simon

Wednesday, March 21, 2012

Problem with HOST_NAME Function with Linked View

I have an Access 2000 MDB file with a SQL 7 back end. I have a main table
with 50,000 records; and I have a selections table with 50,000 records for
each machine that uses the database (about 25-50). This allows each user to
have their own set of selections.
The selections table has three fields: ID (int), Sel (bit), MachName
(varchar). ID and MachName comprise the primary key.
I have a view that combines the main table and the entries for the
selections table for the current machine (SQL below). The view works fine
when opened in EM and QA. And if I create a pass-through query from my
Access MDB file, the results are displayed fine.
However, if I link the view to the Access MDB file, I get "#Deleted" in
every field of every record (which seems to indicate that the records were
there and then they were gone). However, if I hard-code the machine name
into the same view instead of using HOST_NAME and then relink the view to
the MDB file, the linked view opens fine. Only when I use HOST_NAME as a
parameter in the view is there a problem with it.
Anyone have any idea what's going on here, or have heard of any issues with
HOST_NAME and ODBC linked objects? SQL for the view is below.
Thanks!
Neil
SELECT INVTRY.*, InvtrySelections.Sel, InvtrySelections.MachName
FROM dbo.INVTRY INNER JOIN
dbo.InvtrySelections ON
dbo.INVTRY.ID = dbo.InvtrySelections.ID
WHERE (dbo.InvtrySelections.MachName = HOST_NAME())
Neil wrote:

> I have a view that combines the main table and the entries for the
> selections table for the current machine (SQL below). The view works fine
> when opened in EM and QA. And if I create a pass-through query from my
> Access MDB file, the results are displayed fine.
HOST_NAME() is a T-SQL function. Enterprise Manager, Query Analyzer and
Access Pass-Through querys are direct interfaces to SQL Server and thus
T-SQL

> However, if I link the view to the Access MDB file, I get "#Deleted" in
> every field of every record (which seems to indicate that the records were
> there and then they were gone). However, if I hard-code the machine name
> into the same view instead of using HOST_NAME and then relink the view to
> the MDB file, the linked view opens fine. Only when I use HOST_NAME as a
> parameter in the view is there a problem with it.
Does this not imply that T-SQL cannot construct HOST_NAME() from
Access/Jet SQL?
|||First, you shouldn't crosspost to newsgroups not relevant to your problem.
Second, create a view that will simply select and display the value of
HOST_NAME() and you will you see if there is a problem with it and
SQL-Server 7 and a MDB file.
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF
"Neil" <nospam@.nospam.net> wrote in message
news:lra9f.1731$8c5.1137@.newsread3.news.pas.earthl ink.net...
>I have an Access 2000 MDB file with a SQL 7 back end. I have a main table
>with 50,000 records; and I have a selections table with 50,000 records for
>each machine that uses the database (about 25-50). This allows each user to
>have their own set of selections.
> The selections table has three fields: ID (int), Sel (bit), MachName
> (varchar). ID and MachName comprise the primary key.
> I have a view that combines the main table and the entries for the
> selections table for the current machine (SQL below). The view works fine
> when opened in EM and QA. And if I create a pass-through query from my
> Access MDB file, the results are displayed fine.
> However, if I link the view to the Access MDB file, I get "#Deleted" in
> every field of every record (which seems to indicate that the records were
> there and then they were gone). However, if I hard-code the machine name
> into the same view instead of using HOST_NAME and then relink the view to
> the MDB file, the linked view opens fine. Only when I use HOST_NAME as a
> parameter in the view is there a problem with it.
> Anyone have any idea what's going on here, or have heard of any issues
> with HOST_NAME and ODBC linked objects? SQL for the view is below.
> Thanks!
> Neil
> SELECT INVTRY.*, InvtrySelections.Sel, InvtrySelections.MachName
> FROM dbo.INVTRY INNER JOIN
> dbo.InvtrySelections ON
> dbo.INVTRY.ID = dbo.InvtrySelections.ID
> WHERE (dbo.InvtrySelections.MachName = HOST_NAME())
>
|||Neil (nospam@.nospam.net) writes:
> SELECT INVTRY.*, InvtrySelections.Sel, InvtrySelections.MachName
> FROM dbo.INVTRY INNER JOIN
> dbo.InvtrySelections ON
> dbo.INVTRY.ID = dbo.InvtrySelections.ID
> WHERE (dbo.InvtrySelections.MachName = HOST_NAME())
Now that I see the entire view, I repeat what I said before: make
MachName nvarchar, and put the clustered index on this column.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
|||Ananda Sim (AnandaSim@.gmail.com.invalid) writes:
> Does this not imply that T-SQL cannot construct HOST_NAME() from
> Access/Jet SQL?
Indeed, the host name must be set through the connection string. I don't
know how it works through Access, but the mechanism is such that the
client tells SQL Server about the name, and lie as much as it want.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
|||Neil wrote:
> I have an Access 2000 MDB file with a SQL 7 back end. I have a main table
> with 50,000 records; and I have a selections table with 50,000 records for
> each machine that uses the database (about 25-50). This allows each user to
> have their own set of selections.
> The selections table has three fields: ID (int), Sel (bit), MachName
> (varchar). ID and MachName comprise the primary key.
> I have a view that combines the main table and the entries for the
> selections table for the current machine (SQL below). The view works fine
> when opened in EM and QA. And if I create a pass-through query from my
> Access MDB file, the results are displayed fine.
> However, if I link the view to the Access MDB file, I get "#Deleted" in
> every field of every record (which seems to indicate that the records were
> there and then they were gone). However, if I hard-code the machine name
> into the same view instead of using HOST_NAME and then relink the view to
> the MDB file, the linked view opens fine. Only when I use HOST_NAME as a
> parameter in the view is there a problem with it.
> Anyone have any idea what's going on here, or have heard of any issues with
> HOST_NAME and ODBC linked objects? SQL for the view is below.
I've not had any problems with Host_name() as a parameter, as the only
records I retrieve are for my particular machine there is very little
point in returning that column so I never ask the server for it as I
know the value already.
A couple of things you need to know about Access and SQL Server, firstly
bit fields should be made NOT NULL and default to 0 as Access interprets
these as Jet Yes/No columns and treats them accordingly so it expects a
value to be there (In Access/Jet, a Yes/No column cannot be null and
defaults to 0). The results otherwise can be unpredictable.
Secondly, if you have any floating point columns in your data (including
datetime as these are stored as floating point numbers) then you most
probably need a timestamp column as floating point errors can cause the
#Deleted condition you describe.
|||Hello, everyone.
I've made some progress with this strange situation. I played around with
different scenarios of the view with HOST_NAME that won't work when linked
to the MDB file, removing most fields, trying just one table, then the
other, and kept getting the "#Deleted" results. However, I found then when I
didn't assign a logical primary key when I linked the view, the results
displayed fine!
That only makes the situation stranger. But there it is.
In another post here I noted that I had created a test table with a
two-field PK, one of which contained the HOST_NAME value, and created a view
which returned records from this test table, with HOST_NAME() as a parameter
for that field. When I linked that view to the MDB file, selecting the two
PK fields as the logical primary key, it worked fine. So it's not all
logical primary keys that it has problems with.
Neil
"Neil" <nospam@.nospam.net> wrote in message
news:lra9f.1731$8c5.1137@.newsread3.news.pas.earthl ink.net...
>I have an Access 2000 MDB file with a SQL 7 back end. I have a main table
>with 50,000 records; and I have a selections table with 50,000 records for
>each machine that uses the database (about 25-50). This allows each user to
>have their own set of selections.
> The selections table has three fields: ID (int), Sel (bit), MachName
> (varchar). ID and MachName comprise the primary key.
> I have a view that combines the main table and the entries for the
> selections table for the current machine (SQL below). The view works fine
> when opened in EM and QA. And if I create a pass-through query from my
> Access MDB file, the results are displayed fine.
> However, if I link the view to the Access MDB file, I get "#Deleted" in
> every field of every record (which seems to indicate that the records were
> there and then they were gone). However, if I hard-code the machine name
> into the same view instead of using HOST_NAME and then relink the view to
> the MDB file, the linked view opens fine. Only when I use HOST_NAME as a
> parameter in the view is there a problem with it.
> Anyone have any idea what's going on here, or have heard of any issues
> with HOST_NAME and ODBC linked objects? SQL for the view is below.
> Thanks!
> Neil
> SELECT INVTRY.*, InvtrySelections.Sel, InvtrySelections.MachName
> FROM dbo.INVTRY INNER JOIN
> dbo.InvtrySelections ON
> dbo.INVTRY.ID = dbo.InvtrySelections.ID
> WHERE (dbo.InvtrySelections.MachName = HOST_NAME())
>
|||One possible cause for seeing things like #deleted is a missing primary key
or Access is not able to determine which field is the primary key.
You have said in your first post that you have defined a composite primary
key on two field. This is quite possibly the source of your problem: you
should try replacing it with a single field primary key. From past
experience, Access seems to have a lot of trouble with linked tables or
views having composite primary keys.
Also, take a look at the following article; in case it might help you:
http://support.microsoft.com/kb/q209123/
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF
"Neil" <nospam@.nospam.net> wrote in message
news:hFf9f.3901$yX2.1657@.newsread2.news.pas.earthl ink.net...
> "Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
> wrote in message news:uQV0$Ra3FHA.2432@.TK2MSFTNGP10.phx.gbl...
> I wasn't aware that I had done that.
>
> Good point. I created a view that returned the value of HOST_NAME(), and
> it linked fine into the MDB. I also created a new table, gave it a
> two-field PK, and used HOST_NAME() as a parameter for one of the fields in
> a view. That view also linked and displayed records fine. (Didn't do a
> two-table test, which would be similar to what I'm working with. But it
> shows that HOST_NAME() works fine with MDB linked views.)
> Neil
>
>
|||Also, if possible, that a look on the SQL-Server with the Profiler or
activate the ODBC tracing option. This will give you the possibility of
seeing what Access is trying to do.
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF
"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
wrote in message news:uTA0rGd3FHA.2640@.TK2MSFTNGP09.phx.gbl...
> One possible cause for seeing things like #deleted is a missing primary
> key or Access is not able to determine which field is the primary key.
> You have said in your first post that you have defined a composite primary
> key on two field. This is quite possibly the source of your problem: you
> should try replacing it with a single field primary key. From past
> experience, Access seems to have a lot of trouble with linked tables or
> views having composite primary keys.
> Also, take a look at the following article; in case it might help you:
> http://support.microsoft.com/kb/q209123/
> --
> Sylvain Lafontaine, ing.
> MVP - Technologies Virtual-PC
> E-mail: http://cerbermail.com/?QugbLEWINF
>
> "Neil" <nospam@.nospam.net> wrote in message
> news:hFf9f.3901$yX2.1657@.newsread2.news.pas.earthl ink.net...
>
|||Re. the composite primary key, note that in my test I did create a table
with a composite primary key, to simulate the situation, and it worked fine.
I followed up on that in my more recent post in this thread, which shows
that the situation is now even more bizarre.
Regarding changing to a single field primary key, I do not believe that is
possible. The main table has a single-field primary key (int, identity), and
the other table (which has a one-to-one relationship with the main table)
has a dual primary key -- one field corresponding to the main table's
primary key, and the other containing the machine name. That table has to
have both fields in the primary key.
The resulting view can have a one-field or two-field virtual primary key
when linked in access, depending on whether or not I include the machine
name field in the resultset. Seems to me that it's better to include it and
have a two-field primary key, so that Access can determine the record.
Neil
"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
wrote in message news:uTA0rGd3FHA.2640@.TK2MSFTNGP09.phx.gbl...
> One possible cause for seeing things like #deleted is a missing primary
> key or Access is not able to determine which field is the primary key.
> You have said in your first post that you have defined a composite primary
> key on two field. This is quite possibly the source of your problem: you
> should try replacing it with a single field primary key. From past
> experience, Access seems to have a lot of trouble with linked tables or
> views having composite primary keys.
> Also, take a look at the following article; in case it might help you:
> http://support.microsoft.com/kb/q209123/
> --
> Sylvain Lafontaine, ing.
> MVP - Technologies Virtual-PC
> E-mail: http://cerbermail.com/?QugbLEWINF
>
> "Neil" <nospam@.nospam.net> wrote in message
> news:hFf9f.3901$yX2.1657@.newsread2.news.pas.earthl ink.net...
>

Problem with HOST_NAME Function with Linked View

I have an Access 2000 MDB file with a SQL 7 back end. I have a main table
with 50,000 records; and I have a selections table with 50,000 records for
each machine that uses the database (about 25-50). This allows each user to
have their own set of selections.
The selections table has three fields: ID (int), Sel (bit), MachName
(varchar). ID and MachName comprise the primary key.
I have a view that combines the main table and the entries for the
selections table for the current machine (SQL below). The view works fine
when opened in EM and QA. And if I create a pass-through query from my
Access MDB file, the results are displayed fine.
However, if I link the view to the Access MDB file, I get "#Deleted" in
every field of every record (which seems to indicate that the records were
there and then they were gone). However, if I hard-code the machine name
into the same view instead of using HOST_NAME and then relink the view to
the MDB file, the linked view opens fine. Only when I use HOST_NAME as a
parameter in the view is there a problem with it.
Anyone have any idea what's going on here, or have heard of any issues with
HOST_NAME and ODBC linked objects? SQL for the view is below.
Thanks!
Neil
SELECT INVTRY.*, InvtrySelections.Sel, InvtrySelections.MachName
FROM dbo.INVTRY INNER JOIN
dbo.InvtrySelections ON
dbo.INVTRY.ID = dbo.InvtrySelections.ID
WHERE (dbo.InvtrySelections.MachName = HOST_NAME())Neil wrote:

> I have a view that combines the main table and the entries for the
> selections table for the current machine (SQL below). The view works fine
> when opened in EM and QA. And if I create a pass-through query from my
> Access MDB file, the results are displayed fine.
HOST_NAME() is a T-SQL function. Enterprise Manager, Query Analyzer and
Access Pass-Through querys are direct interfaces to SQL Server and thus
T-SQL

> However, if I link the view to the Access MDB file, I get "#Deleted" in
> every field of every record (which seems to indicate that the records were
> there and then they were gone). However, if I hard-code the machine name
> into the same view instead of using HOST_NAME and then relink the view to
> the MDB file, the linked view opens fine. Only when I use HOST_NAME as a
> parameter in the view is there a problem with it.
Does this not imply that T-SQL cannot construct HOST_NAME() from
Access/Jet SQL?|||First, you shouldn't crosspost to newsgroups not relevant to your problem.
Second, create a view that will simply select and display the value of
HOST_NAME() and you will you see if there is a problem with it and
SQL-Server 7 and a MDB file.
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF
"Neil" <nospam@.nospam.net> wrote in message
news:lra9f.1731$8c5.1137@.newsread3.news.pas.earthlink.net...
>I have an Access 2000 MDB file with a SQL 7 back end. I have a main table
>with 50,000 records; and I have a selections table with 50,000 records for
>each machine that uses the database (about 25-50). This allows each user to
>have their own set of selections.
> The selections table has three fields: ID (int), Sel (bit), MachName
> (varchar). ID and MachName comprise the primary key.
> I have a view that combines the main table and the entries for the
> selections table for the current machine (SQL below). The view works fine
> when opened in EM and QA. And if I create a pass-through query from my
> Access MDB file, the results are displayed fine.
> However, if I link the view to the Access MDB file, I get "#Deleted" in
> every field of every record (which seems to indicate that the records were
> there and then they were gone). However, if I hard-code the machine name
> into the same view instead of using HOST_NAME and then relink the view to
> the MDB file, the linked view opens fine. Only when I use HOST_NAME as a
> parameter in the view is there a problem with it.
> Anyone have any idea what's going on here, or have heard of any issues
> with HOST_NAME and ODBC linked objects? SQL for the view is below.
> Thanks!
> Neil
> SELECT INVTRY.*, InvtrySelections.Sel, InvtrySelections.MachName
> FROM dbo.INVTRY INNER JOIN
> dbo.InvtrySelections ON
> dbo.INVTRY.ID = dbo.InvtrySelections.ID
> WHERE (dbo.InvtrySelections.MachName = HOST_NAME())
>|||Neil (nospam@.nospam.net) writes:
> SELECT INVTRY.*, InvtrySelections.Sel, InvtrySelections.MachName
> FROM dbo.INVTRY INNER JOIN
> dbo.InvtrySelections ON
> dbo.INVTRY.ID = dbo.InvtrySelections.ID
> WHERE (dbo.InvtrySelections.MachName = HOST_NAME())
Now that I see the entire view, I repeat what I said before: make
MachName nvarchar, and put the clustered index on this column.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Ananda Sim (AnandaSim@.gmail.com.invalid) writes:
> Does this not imply that T-SQL cannot construct HOST_NAME() from
> Access/Jet SQL?
Indeed, the host name must be set through the connection string. I don't
know how it works through Access, but the mechanism is such that the
client tells SQL Server about the name, and lie as much as it want.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Neil wrote:
> I have an Access 2000 MDB file with a SQL 7 back end. I have a main table
> with 50,000 records; and I have a selections table with 50,000 records for
> each machine that uses the database (about 25-50). This allows each user t
o
> have their own set of selections.
> The selections table has three fields: ID (int), Sel (bit), MachName
> (varchar). ID and MachName comprise the primary key.
> I have a view that combines the main table and the entries for the
> selections table for the current machine (SQL below). The view works fine
> when opened in EM and QA. And if I create a pass-through query from my
> Access MDB file, the results are displayed fine.
> However, if I link the view to the Access MDB file, I get "#Deleted" in
> every field of every record (which seems to indicate that the records were
> there and then they were gone). However, if I hard-code the machine name
> into the same view instead of using HOST_NAME and then relink the view to
> the MDB file, the linked view opens fine. Only when I use HOST_NAME as a
> parameter in the view is there a problem with it.
> Anyone have any idea what's going on here, or have heard of any issues wit
h
> HOST_NAME and ODBC linked objects? SQL for the view is below.
I've not had any problems with Host_name() as a parameter, as the only
records I retrieve are for my particular machine there is very little
point in returning that column so I never ask the server for it as I
know the value already.
A couple of things you need to know about Access and SQL Server, firstly
bit fields should be made NOT NULL and default to 0 as Access interprets
these as Jet Yes/No columns and treats them accordingly so it expects a
value to be there (In Access/Jet, a Yes/No column cannot be null and
defaults to 0). The results otherwise can be unpredictable.
Secondly, if you have any floating point columns in your data (including
datetime as these are stored as floating point numbers) then you most
probably need a timestamp column as floating point errors can cause the
#Deleted condition you describe.|||Obscure footnote:
> any floating point columns in your data (including
> datetime as these are stored as floating point numbers)
SQL Server doesn't store datetime as double. Access does,
and the problem arises because of the rounding error in
the conversion between the Access version and the SQL
Server version, even when values are not 'stored' in Access
at all.
(david)
"Trevor Best" <nospam@.localhost.invalid> wrote in message
news:43656dd0$0$345$da0feed9@.news.zen.co.uk...
> Neil wrote:
.>
> I've not had any problems with Host_name() as a parameter, as the only
> records I retrieve are for my particular machine there is very little
> point in returning that column so I never ask the server for it as I
> know the value already.
> A couple of things you need to know about Access and SQL Server, firstly
> bit fields should be made NOT NULL and default to 0 as Access interprets
> these as Jet Yes/No columns and treats them accordingly so it expects a
> value to be there (In Access/Jet, a Yes/No column cannot be null and
> defaults to 0). The results otherwise can be unpredictable.
> Secondly, if you have any floating point columns in your data (including
> datetime as these are stored as floating point numbers) then you most
> probably need a timestamp column as floating point errors can cause the
> #Deleted condition you describe.|||"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
wrote in message news:uQV0$Ra3FHA.2432@.TK2MSFTNGP10.phx.gbl...
> First, you shouldn't crosspost to newsgroups not relevant to your problem.
I wasn't aware that I had done that.

> Second, create a view that will simply select and display the value of
> HOST_NAME() and you will you see if there is a problem with it and
> SQL-Server 7 and a MDB file.
Good point. I created a view that returned the value of HOST_NAME(), and it
linked fine into the MDB. I also created a new table, gave it a two-field
PK, and used HOST_NAME() as a parameter for one of the fields in a view.
That view also linked and displayed records fine. (Didn't do a two-table
test, which would be similar to what I'm working with. But it shows that
HOST_NAME() works fine with MDB linked views.)
Neil

> --
> Sylvain Lafontaine, ing.
> MVP - Technologies Virtual-PC
> E-mail: http://cerbermail.com/?QugbLEWINF
>
> "Neil" <nospam@.nospam.net> wrote in message
> news:lra9f.1731$8c5.1137@.newsread3.news.pas.earthlink.net...
>|||After I got your note I did go ahead and make MachName nchar, as BOL says
that HOST_NAME() returns that type, and the sample it showed of storing its
return value in a table used an nchar(30) field.
The InvtrySelections table had the PK (ID/MachName) as the clustered index.
I created a second index on MachName alone, and it made it the clustered
index.
With the above two changes, the results were the same. Still getting
"#Deleted".
Neil
"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns970061F02065Yazorman@.127.0.0.1...
> Neil (nospam@.nospam.net) writes:
> Now that I see the entire view, I repeat what I said before: make
> MachName nvarchar, and put the clustered index on this column.
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techin.../2000/books.asp
>|||"Ananda Sim" <AnandaSim@.gmail.com.invalid> wrote in message
news:43653cd2$0$25855$afc38c87@.news.optusnet.com.au...
> Neil wrote:
>
> HOST_NAME() is a T-SQL function. Enterprise Manager, Query Analyzer and
> Access Pass-Through querys are direct interfaces to SQL Server and thus
> T-SQL
>
> Does this not imply that T-SQL cannot construct HOST_NAME() from
> Access/Jet SQL?
In a test, I created a view that returned the HOST_NAME() value, and another
view that used HOST_NAME() as a parameter. Both worked fine when linked to
the MDB file, so the problem's not with T-SQL not being able to construct
HOST_NAME from Jet SQL.
Neil

Problem with HOST_NAME Function with Linked View

I have an Access 2000 MDB file with a SQL 7 back end. I have a main table
with 50,000 records; and I have a selections table with 50,000 records for
each machine that uses the database (about 25-50). This allows each user to
have their own set of selections.

The selections table has three fields: ID (int), Sel (bit), MachName
(varchar). ID and MachName comprise the primary key.

I have a view that combines the main table and the entries for the
selections table for the current machine (SQL below). The view works fine
when opened in EM and QA. And if I create a pass-through query from my
Access MDB file, the results are displayed fine.

However, if I link the view to the Access MDB file, I get "#Deleted" in
every field of every record (which seems to indicate that the records were
there and then they were gone). However, if I hard-code the machine name
into the same view instead of using HOST_NAME and then relink the view to
the MDB file, the linked view opens fine. Only when I use HOST_NAME as a
parameter in the view is there a problem with it.

Anyone have any idea what's going on here, or have heard of any issues with
HOST_NAME and ODBC linked objects? SQL for the view is below.

Thanks!

Neil

SELECT INVTRY.*, InvtrySelections.Sel, InvtrySelections.MachName
FROM dbo.INVTRY INNER JOIN
dbo.InvtrySelections ON
dbo.INVTRY.ID = dbo.InvtrySelections.ID
WHERE (dbo.InvtrySelections.MachName = HOST_NAME())First, you shouldn't crosspost to newsgroups not relevant to your problem.

Second, create a view that will simply select and display the value of
HOST_NAME() and you will you see if there is a problem with it and
SQL-Server 7 and a MDB file.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF

"Neil" <nospam@.nospam.net> wrote in message
news:lra9f.1731$8c5.1137@.newsread3.news.pas.earthl ink.net...
>I have an Access 2000 MDB file with a SQL 7 back end. I have a main table
>with 50,000 records; and I have a selections table with 50,000 records for
>each machine that uses the database (about 25-50). This allows each user to
>have their own set of selections.
> The selections table has three fields: ID (int), Sel (bit), MachName
> (varchar). ID and MachName comprise the primary key.
> I have a view that combines the main table and the entries for the
> selections table for the current machine (SQL below). The view works fine
> when opened in EM and QA. And if I create a pass-through query from my
> Access MDB file, the results are displayed fine.
> However, if I link the view to the Access MDB file, I get "#Deleted" in
> every field of every record (which seems to indicate that the records were
> there and then they were gone). However, if I hard-code the machine name
> into the same view instead of using HOST_NAME and then relink the view to
> the MDB file, the linked view opens fine. Only when I use HOST_NAME as a
> parameter in the view is there a problem with it.
> Anyone have any idea what's going on here, or have heard of any issues
> with HOST_NAME and ODBC linked objects? SQL for the view is below.
> Thanks!
> Neil
> SELECT INVTRY.*, InvtrySelections.Sel, InvtrySelections.MachName
> FROM dbo.INVTRY INNER JOIN
> dbo.InvtrySelections ON
> dbo.INVTRY.ID = dbo.InvtrySelections.ID
> WHERE (dbo.InvtrySelections.MachName = HOST_NAME())|||Neil (nospam@.nospam.net) writes:
> SELECT INVTRY.*, InvtrySelections.Sel, InvtrySelections.MachName
> FROM dbo.INVTRY INNER JOIN
> dbo.InvtrySelections ON
> dbo.INVTRY.ID = dbo.InvtrySelections.ID
> WHERE (dbo.InvtrySelections.MachName = HOST_NAME())

Now that I see the entire view, I repeat what I said before: make
MachName nvarchar, and put the clustered index on this column.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Neil wrote:
> I have an Access 2000 MDB file with a SQL 7 back end. I have a main table
> with 50,000 records; and I have a selections table with 50,000 records for
> each machine that uses the database (about 25-50). This allows each user to
> have their own set of selections.
> The selections table has three fields: ID (int), Sel (bit), MachName
> (varchar). ID and MachName comprise the primary key.
> I have a view that combines the main table and the entries for the
> selections table for the current machine (SQL below). The view works fine
> when opened in EM and QA. And if I create a pass-through query from my
> Access MDB file, the results are displayed fine.
> However, if I link the view to the Access MDB file, I get "#Deleted" in
> every field of every record (which seems to indicate that the records were
> there and then they were gone). However, if I hard-code the machine name
> into the same view instead of using HOST_NAME and then relink the view to
> the MDB file, the linked view opens fine. Only when I use HOST_NAME as a
> parameter in the view is there a problem with it.
> Anyone have any idea what's going on here, or have heard of any issues with
> HOST_NAME and ODBC linked objects? SQL for the view is below.

I've not had any problems with Host_name() as a parameter, as the only
records I retrieve are for my particular machine there is very little
point in returning that column so I never ask the server for it as I
know the value already.

A couple of things you need to know about Access and SQL Server, firstly
bit fields should be made NOT NULL and default to 0 as Access interprets
these as Jet Yes/No columns and treats them accordingly so it expects a
value to be there (In Access/Jet, a Yes/No column cannot be null and
defaults to 0). The results otherwise can be unpredictable.

Secondly, if you have any floating point columns in your data (including
datetime as these are stored as floating point numbers) then you most
probably need a timestamp column as floating point errors can cause the
#Deleted condition you describe.|||"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
wrote in message news:uQV0$Ra3FHA.2432@.TK2MSFTNGP10.phx.gbl...
> First, you shouldn't crosspost to newsgroups not relevant to your problem.

I wasn't aware that I had done that.

> Second, create a view that will simply select and display the value of
> HOST_NAME() and you will you see if there is a problem with it and
> SQL-Server 7 and a MDB file.

Good point. I created a view that returned the value of HOST_NAME(), and it
linked fine into the MDB. I also created a new table, gave it a two-field
PK, and used HOST_NAME() as a parameter for one of the fields in a view.
That view also linked and displayed records fine. (Didn't do a two-table
test, which would be similar to what I'm working with. But it shows that
HOST_NAME() works fine with MDB linked views.)

Neil

> --
> Sylvain Lafontaine, ing.
> MVP - Technologies Virtual-PC
> E-mail: http://cerbermail.com/?QugbLEWINF
>
> "Neil" <nospam@.nospam.net> wrote in message
> news:lra9f.1731$8c5.1137@.newsread3.news.pas.earthl ink.net...
>>I have an Access 2000 MDB file with a SQL 7 back end. I have a main table
>>with 50,000 records; and I have a selections table with 50,000 records for
>>each machine that uses the database (about 25-50). This allows each user
>>to have their own set of selections.
>>
>> The selections table has three fields: ID (int), Sel (bit), MachName
>> (varchar). ID and MachName comprise the primary key.
>>
>> I have a view that combines the main table and the entries for the
>> selections table for the current machine (SQL below). The view works fine
>> when opened in EM and QA. And if I create a pass-through query from my
>> Access MDB file, the results are displayed fine.
>>
>> However, if I link the view to the Access MDB file, I get "#Deleted" in
>> every field of every record (which seems to indicate that the records
>> were there and then they were gone). However, if I hard-code the machine
>> name into the same view instead of using HOST_NAME and then relink the
>> view to the MDB file, the linked view opens fine. Only when I use
>> HOST_NAME as a parameter in the view is there a problem with it.
>>
>> Anyone have any idea what's going on here, or have heard of any issues
>> with HOST_NAME and ODBC linked objects? SQL for the view is below.
>>
>> Thanks!
>>
>> Neil
>>
>> SELECT INVTRY.*, InvtrySelections.Sel, InvtrySelections.MachName
>> FROM dbo.INVTRY INNER JOIN
>> dbo.InvtrySelections ON
>> dbo.INVTRY.ID = dbo.InvtrySelections.ID
>> WHERE (dbo.InvtrySelections.MachName = HOST_NAME())
>>|||Obscure footnote:
> any floating point columns in your data (including
> datetime as these are stored as floating point numbers)

SQL Server doesn't store datetime as double. Access does,
and the problem arises because of the rounding error in
the conversion between the Access version and the SQL
Server version, even when values are not 'stored' in Access
at all.

(david)

"Trevor Best" <nospam@.localhost.invalid> wrote in message
news:43656dd0$0$345$da0feed9@.news.zen.co.uk...
> Neil wrote:
..>
> I've not had any problems with Host_name() as a parameter, as the only
> records I retrieve are for my particular machine there is very little
> point in returning that column so I never ask the server for it as I
> know the value already.
> A couple of things you need to know about Access and SQL Server, firstly
> bit fields should be made NOT NULL and default to 0 as Access interprets
> these as Jet Yes/No columns and treats them accordingly so it expects a
> value to be there (In Access/Jet, a Yes/No column cannot be null and
> defaults to 0). The results otherwise can be unpredictable.
> Secondly, if you have any floating point columns in your data (including
> datetime as these are stored as floating point numbers) then you most
> probably need a timestamp column as floating point errors can cause the
> #Deleted condition you describe.|||After I got your note I did go ahead and make MachName nchar, as BOL says
that HOST_NAME() returns that type, and the sample it showed of storing its
return value in a table used an nchar(30) field.

The InvtrySelections table had the PK (ID/MachName) as the clustered index.
I created a second index on MachName alone, and it made it the clustered
index.

With the above two changes, the results were the same. Still getting
"#Deleted".

Neil

"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns970061F02065Yazorman@.127.0.0.1...
> Neil (nospam@.nospam.net) writes:
>> SELECT INVTRY.*, InvtrySelections.Sel, InvtrySelections.MachName
>> FROM dbo.INVTRY INNER JOIN
>> dbo.InvtrySelections ON
>> dbo.INVTRY.ID = dbo.InvtrySelections.ID
>> WHERE (dbo.InvtrySelections.MachName = HOST_NAME())
> Now that I see the entire view, I repeat what I said before: make
> MachName nvarchar, and put the clustered index on this column.
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techin.../2000/books.asp|||> I've not had any problems with Host_name() as a parameter, as the only
> records I retrieve are for my particular machine there is very little
> point in returning that column so I never ask the server for it as I know
> the value already.
> A couple of things you need to know about Access and SQL Server, firstly
> bit fields should be made NOT NULL and default to 0 as Access interprets
> these as Jet Yes/No columns and treats them accordingly so it expects a
> value to be there (In Access/Jet, a Yes/No column cannot be null and
> defaults to 0). The results otherwise can be unpredictable.

Yes, the bit field is Not Null and defaults to zero.

> Secondly, if you have any floating point columns in your data (including
> datetime as these are stored as floating point numbers) then you most
> probably need a timestamp column as floating point errors can cause the
> #Deleted condition you describe.

I don't have any floating point columns in my table. However, I went ahead
and added a timestamp field anyway. Same results.

Neil|||Hello, everyone.

I've made some progress with this strange situation. I played around with
different scenarios of the view with HOST_NAME that won't work when linked
to the MDB file, removing most fields, trying just one table, then the
other, and kept getting the "#Deleted" results. However, I found then when I
didn't assign a logical primary key when I linked the view, the results
displayed fine!

That only makes the situation stranger. But there it is.

In another post here I noted that I had created a test table with a
two-field PK, one of which contained the HOST_NAME value, and created a view
which returned records from this test table, with HOST_NAME() as a parameter
for that field. When I linked that view to the MDB file, selecting the two
PK fields as the logical primary key, it worked fine. So it's not all
logical primary keys that it has problems with.

Neil

"Neil" <nospam@.nospam.net> wrote in message
news:lra9f.1731$8c5.1137@.newsread3.news.pas.earthl ink.net...
>I have an Access 2000 MDB file with a SQL 7 back end. I have a main table
>with 50,000 records; and I have a selections table with 50,000 records for
>each machine that uses the database (about 25-50). This allows each user to
>have their own set of selections.
> The selections table has three fields: ID (int), Sel (bit), MachName
> (varchar). ID and MachName comprise the primary key.
> I have a view that combines the main table and the entries for the
> selections table for the current machine (SQL below). The view works fine
> when opened in EM and QA. And if I create a pass-through query from my
> Access MDB file, the results are displayed fine.
> However, if I link the view to the Access MDB file, I get "#Deleted" in
> every field of every record (which seems to indicate that the records were
> there and then they were gone). However, if I hard-code the machine name
> into the same view instead of using HOST_NAME and then relink the view to
> the MDB file, the linked view opens fine. Only when I use HOST_NAME as a
> parameter in the view is there a problem with it.
> Anyone have any idea what's going on here, or have heard of any issues
> with HOST_NAME and ODBC linked objects? SQL for the view is below.
> Thanks!
> Neil
> SELECT INVTRY.*, InvtrySelections.Sel, InvtrySelections.MachName
> FROM dbo.INVTRY INNER JOIN
> dbo.InvtrySelections ON
> dbo.INVTRY.ID = dbo.InvtrySelections.ID
> WHERE (dbo.InvtrySelections.MachName = HOST_NAME())|||One possible cause for seeing things like #deleted is a missing primary key
or Access is not able to determine which field is the primary key.

You have said in your first post that you have defined a composite primary
key on two field. This is quite possibly the source of your problem: you
should try replacing it with a single field primary key. From past
experience, Access seems to have a lot of trouble with linked tables or
views having composite primary keys.

Also, take a look at the following article; in case it might help you:
http://support.microsoft.com/kb/q209123/

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF

"Neil" <nospam@.nospam.net> wrote in message
news:hFf9f.3901$yX2.1657@.newsread2.news.pas.earthl ink.net...
> "Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
> wrote in message news:uQV0$Ra3FHA.2432@.TK2MSFTNGP10.phx.gbl...
>> First, you shouldn't crosspost to newsgroups not relevant to your
>> problem.
> I wasn't aware that I had done that.
>>
>> Second, create a view that will simply select and display the value of
>> HOST_NAME() and you will you see if there is a problem with it and
>> SQL-Server 7 and a MDB file.
> Good point. I created a view that returned the value of HOST_NAME(), and
> it linked fine into the MDB. I also created a new table, gave it a
> two-field PK, and used HOST_NAME() as a parameter for one of the fields in
> a view. That view also linked and displayed records fine. (Didn't do a
> two-table test, which would be similar to what I'm working with. But it
> shows that HOST_NAME() works fine with MDB linked views.)
> Neil
>
>>
>> --
>> Sylvain Lafontaine, ing.
>> MVP - Technologies Virtual-PC
>> E-mail: http://cerbermail.com/?QugbLEWINF
>>
>>
>> "Neil" <nospam@.nospam.net> wrote in message
>> news:lra9f.1731$8c5.1137@.newsread3.news.pas.earthl ink.net...
>>>I have an Access 2000 MDB file with a SQL 7 back end. I have a main table
>>>with 50,000 records; and I have a selections table with 50,000 records
>>>for each machine that uses the database (about 25-50). This allows each
>>>user to have their own set of selections.
>>>
>>> The selections table has three fields: ID (int), Sel (bit), MachName
>>> (varchar). ID and MachName comprise the primary key.
>>>
>>> I have a view that combines the main table and the entries for the
>>> selections table for the current machine (SQL below). The view works
>>> fine when opened in EM and QA. And if I create a pass-through query from
>>> my Access MDB file, the results are displayed fine.
>>>
>>> However, if I link the view to the Access MDB file, I get "#Deleted" in
>>> every field of every record (which seems to indicate that the records
>>> were there and then they were gone). However, if I hard-code the machine
>>> name into the same view instead of using HOST_NAME and then relink the
>>> view to the MDB file, the linked view opens fine. Only when I use
>>> HOST_NAME as a parameter in the view is there a problem with it.
>>>
>>> Anyone have any idea what's going on here, or have heard of any issues
>>> with HOST_NAME and ODBC linked objects? SQL for the view is below.
>>>
>>> Thanks!
>>>
>>> Neil
>>>
>>> SELECT INVTRY.*, InvtrySelections.Sel, InvtrySelections.MachName
>>> FROM dbo.INVTRY INNER JOIN
>>> dbo.InvtrySelections ON
>>> dbo.INVTRY.ID = dbo.InvtrySelections.ID
>>> WHERE (dbo.InvtrySelections.MachName = HOST_NAME())
>>>
>>
>>|||Also, if possible, that a look on the SQL-Server with the Profiler or
activate the ODBC tracing option. This will give you the possibility of
seeing what Access is trying to do.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF

"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
wrote in message news:uTA0rGd3FHA.2640@.TK2MSFTNGP09.phx.gbl...
> One possible cause for seeing things like #deleted is a missing primary
> key or Access is not able to determine which field is the primary key.
> You have said in your first post that you have defined a composite primary
> key on two field. This is quite possibly the source of your problem: you
> should try replacing it with a single field primary key. From past
> experience, Access seems to have a lot of trouble with linked tables or
> views having composite primary keys.
> Also, take a look at the following article; in case it might help you:
> http://support.microsoft.com/kb/q209123/
> --
> Sylvain Lafontaine, ing.
> MVP - Technologies Virtual-PC
> E-mail: http://cerbermail.com/?QugbLEWINF
>
> "Neil" <nospam@.nospam.net> wrote in message
> news:hFf9f.3901$yX2.1657@.newsread2.news.pas.earthl ink.net...
>>
>> "Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
>> wrote in message news:uQV0$Ra3FHA.2432@.TK2MSFTNGP10.phx.gbl...
>>> First, you shouldn't crosspost to newsgroups not relevant to your
>>> problem.
>>
>> I wasn't aware that I had done that.
>>
>>>
>>> Second, create a view that will simply select and display the value of
>>> HOST_NAME() and you will you see if there is a problem with it and
>>> SQL-Server 7 and a MDB file.
>>
>> Good point. I created a view that returned the value of HOST_NAME(), and
>> it linked fine into the MDB. I also created a new table, gave it a
>> two-field PK, and used HOST_NAME() as a parameter for one of the fields
>> in a view. That view also linked and displayed records fine. (Didn't do a
>> two-table test, which would be similar to what I'm working with. But it
>> shows that HOST_NAME() works fine with MDB linked views.)
>>
>> Neil
>>
>>
>>>
>>> --
>>> Sylvain Lafontaine, ing.
>>> MVP - Technologies Virtual-PC
>>> E-mail: http://cerbermail.com/?QugbLEWINF
>>>
>>>
>>> "Neil" <nospam@.nospam.net> wrote in message
>>> news:lra9f.1731$8c5.1137@.newsread3.news.pas.earthl ink.net...
>>>>I have an Access 2000 MDB file with a SQL 7 back end. I have a main
>>>>table with 50,000 records; and I have a selections table with 50,000
>>>>records for each machine that uses the database (about 25-50). This
>>>>allows each user to have their own set of selections.
>>>>
>>>> The selections table has three fields: ID (int), Sel (bit), MachName
>>>> (varchar). ID and MachName comprise the primary key.
>>>>
>>>> I have a view that combines the main table and the entries for the
>>>> selections table for the current machine (SQL below). The view works
>>>> fine when opened in EM and QA. And if I create a pass-through query
>>>> from my Access MDB file, the results are displayed fine.
>>>>
>>>> However, if I link the view to the Access MDB file, I get "#Deleted" in
>>>> every field of every record (which seems to indicate that the records
>>>> were there and then they were gone). However, if I hard-code the
>>>> machine name into the same view instead of using HOST_NAME and then
>>>> relink the view to the MDB file, the linked view opens fine. Only when
>>>> I use HOST_NAME as a parameter in the view is there a problem with it.
>>>>
>>>> Anyone have any idea what's going on here, or have heard of any issues
>>>> with HOST_NAME and ODBC linked objects? SQL for the view is below.
>>>>
>>>> Thanks!
>>>>
>>>> Neil
>>>>
>>>> SELECT INVTRY.*, InvtrySelections.Sel, InvtrySelections.MachName
>>>> FROM dbo.INVTRY INNER JOIN
>>>> dbo.InvtrySelections ON
>>>> dbo.INVTRY.ID = dbo.InvtrySelections.ID
>>>> WHERE (dbo.InvtrySelections.MachName = HOST_NAME())
>>>>
>>>
>>>
>>
>>|||Re. the composite primary key, note that in my test I did create a table
with a composite primary key, to simulate the situation, and it worked fine.
I followed up on that in my more recent post in this thread, which shows
that the situation is now even more bizarre.

Regarding changing to a single field primary key, I do not believe that is
possible. The main table has a single-field primary key (int, identity), and
the other table (which has a one-to-one relationship with the main table)
has a dual primary key -- one field corresponding to the main table's
primary key, and the other containing the machine name. That table has to
have both fields in the primary key.

The resulting view can have a one-field or two-field virtual primary key
when linked in access, depending on whether or not I include the machine
name field in the resultset. Seems to me that it's better to include it and
have a two-field primary key, so that Access can determine the record.

Neil

"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
wrote in message news:uTA0rGd3FHA.2640@.TK2MSFTNGP09.phx.gbl...
> One possible cause for seeing things like #deleted is a missing primary
> key or Access is not able to determine which field is the primary key.
> You have said in your first post that you have defined a composite primary
> key on two field. This is quite possibly the source of your problem: you
> should try replacing it with a single field primary key. From past
> experience, Access seems to have a lot of trouble with linked tables or
> views having composite primary keys.
> Also, take a look at the following article; in case it might help you:
> http://support.microsoft.com/kb/q209123/
> --
> Sylvain Lafontaine, ing.
> MVP - Technologies Virtual-PC
> E-mail: http://cerbermail.com/?QugbLEWINF
>
> "Neil" <nospam@.nospam.net> wrote in message
> news:hFf9f.3901$yX2.1657@.newsread2.news.pas.earthl ink.net...
>>
>> "Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
>> wrote in message news:uQV0$Ra3FHA.2432@.TK2MSFTNGP10.phx.gbl...
>>> First, you shouldn't crosspost to newsgroups not relevant to your
>>> problem.
>>
>> I wasn't aware that I had done that.
>>
>>>
>>> Second, create a view that will simply select and display the value of
>>> HOST_NAME() and you will you see if there is a problem with it and
>>> SQL-Server 7 and a MDB file.
>>
>> Good point. I created a view that returned the value of HOST_NAME(), and
>> it linked fine into the MDB. I also created a new table, gave it a
>> two-field PK, and used HOST_NAME() as a parameter for one of the fields
>> in a view. That view also linked and displayed records fine. (Didn't do a
>> two-table test, which would be similar to what I'm working with. But it
>> shows that HOST_NAME() works fine with MDB linked views.)
>>
>> Neil
>>
>>
>>>
>>> --
>>> Sylvain Lafontaine, ing.
>>> MVP - Technologies Virtual-PC
>>> E-mail: http://cerbermail.com/?QugbLEWINF
>>>
>>>
>>> "Neil" <nospam@.nospam.net> wrote in message
>>> news:lra9f.1731$8c5.1137@.newsread3.news.pas.earthl ink.net...
>>>>I have an Access 2000 MDB file with a SQL 7 back end. I have a main
>>>>table with 50,000 records; and I have a selections table with 50,000
>>>>records for each machine that uses the database (about 25-50). This
>>>>allows each user to have their own set of selections.
>>>>
>>>> The selections table has three fields: ID (int), Sel (bit), MachName
>>>> (varchar). ID and MachName comprise the primary key.
>>>>
>>>> I have a view that combines the main table and the entries for the
>>>> selections table for the current machine (SQL below). The view works
>>>> fine when opened in EM and QA. And if I create a pass-through query
>>>> from my Access MDB file, the results are displayed fine.
>>>>
>>>> However, if I link the view to the Access MDB file, I get "#Deleted" in
>>>> every field of every record (which seems to indicate that the records
>>>> were there and then they were gone). However, if I hard-code the
>>>> machine name into the same view instead of using HOST_NAME and then
>>>> relink the view to the MDB file, the linked view opens fine. Only when
>>>> I use HOST_NAME as a parameter in the view is there a problem with it.
>>>>
>>>> Anyone have any idea what's going on here, or have heard of any issues
>>>> with HOST_NAME and ODBC linked objects? SQL for the view is below.
>>>>
>>>> Thanks!
>>>>
>>>> Neil
>>>>
>>>> SELECT INVTRY.*, InvtrySelections.Sel, InvtrySelections.MachName
>>>> FROM dbo.INVTRY INNER JOIN
>>>> dbo.InvtrySelections ON
>>>> dbo.INVTRY.ID = dbo.InvtrySelections.ID
>>>> WHERE (dbo.InvtrySelections.MachName = HOST_NAME())
>>>>
>>>
>>>
>>
>>|||ODBC tracing might show something. Now sure what Profiler would yield, since
SQL Server seems to be returning the records without any problem.

Neil

"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
wrote in message news:%23sye%23Id3FHA.4076@.TK2MSFTNGP15.phx.gbl...
> Also, if possible, that a look on the SQL-Server with the Profiler or
> activate the ODBC tracing option. This will give you the possibility of
> seeing what Access is trying to do.
> --
> Sylvain Lafontaine, ing.
> MVP - Technologies Virtual-PC
> E-mail: http://cerbermail.com/?QugbLEWINF
>
> "Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
> wrote in message news:uTA0rGd3FHA.2640@.TK2MSFTNGP09.phx.gbl...
>> One possible cause for seeing things like #deleted is a missing primary
>> key or Access is not able to determine which field is the primary key.
>>
>> You have said in your first post that you have defined a composite
>> primary key on two field. This is quite possibly the source of your
>> problem: you should try replacing it with a single field primary key.
>> From past experience, Access seems to have a lot of trouble with linked
>> tables or views having composite primary keys.
>>
>> Also, take a look at the following article; in case it might help you:
>> http://support.microsoft.com/kb/q209123/
>>
>> --
>> Sylvain Lafontaine, ing.
>> MVP - Technologies Virtual-PC
>> E-mail: http://cerbermail.com/?QugbLEWINF
>>
>>
>> "Neil" <nospam@.nospam.net> wrote in message
>> news:hFf9f.3901$yX2.1657@.newsread2.news.pas.earthl ink.net...
>>>
>>> "Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
>>> wrote in message news:uQV0$Ra3FHA.2432@.TK2MSFTNGP10.phx.gbl...
>>>> First, you shouldn't crosspost to newsgroups not relevant to your
>>>> problem.
>>>
>>> I wasn't aware that I had done that.
>>>
>>>>
>>>> Second, create a view that will simply select and display the value of
>>>> HOST_NAME() and you will you see if there is a problem with it and
>>>> SQL-Server 7 and a MDB file.
>>>
>>> Good point. I created a view that returned the value of HOST_NAME(), and
>>> it linked fine into the MDB. I also created a new table, gave it a
>>> two-field PK, and used HOST_NAME() as a parameter for one of the fields
>>> in a view. That view also linked and displayed records fine. (Didn't do
>>> a two-table test, which would be similar to what I'm working with. But
>>> it shows that HOST_NAME() works fine with MDB linked views.)
>>>
>>> Neil
>>>
>>>
>>>>
>>>> --
>>>> Sylvain Lafontaine, ing.
>>>> MVP - Technologies Virtual-PC
>>>> E-mail: http://cerbermail.com/?QugbLEWINF
>>>>
>>>>
>>>> "Neil" <nospam@.nospam.net> wrote in message
>>>> news:lra9f.1731$8c5.1137@.newsread3.news.pas.earthl ink.net...
>>>>>I have an Access 2000 MDB file with a SQL 7 back end. I have a main
>>>>>table with 50,000 records; and I have a selections table with 50,000
>>>>>records for each machine that uses the database (about 25-50). This
>>>>>allows each user to have their own set of selections.
>>>>>
>>>>> The selections table has three fields: ID (int), Sel (bit), MachName
>>>>> (varchar). ID and MachName comprise the primary key.
>>>>>
>>>>> I have a view that combines the main table and the entries for the
>>>>> selections table for the current machine (SQL below). The view works
>>>>> fine when opened in EM and QA. And if I create a pass-through query
>>>>> from my Access MDB file, the results are displayed fine.
>>>>>
>>>>> However, if I link the view to the Access MDB file, I get "#Deleted"
>>>>> in every field of every record (which seems to indicate that the
>>>>> records were there and then they were gone). However, if I hard-code
>>>>> the machine name into the same view instead of using HOST_NAME and
>>>>> then relink the view to the MDB file, the linked view opens fine. Only
>>>>> when I use HOST_NAME as a parameter in the view is there a problem
>>>>> with it.
>>>>>
>>>>> Anyone have any idea what's going on here, or have heard of any issues
>>>>> with HOST_NAME and ODBC linked objects? SQL for the view is below.
>>>>>
>>>>> Thanks!
>>>>>
>>>>> Neil
>>>>>
>>>>> SELECT INVTRY.*, InvtrySelections.Sel, InvtrySelections.MachName
>>>>> FROM dbo.INVTRY INNER JOIN
>>>>> dbo.InvtrySelections ON
>>>>> dbo.INVTRY.ID = dbo.InvtrySelections.ID
>>>>> WHERE (dbo.InvtrySelections.MachName = HOST_NAME())
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>|||It is not a requirement for relationships to be based on primary keys; so
nothing forbid you to a add a new field as the primary key for the other
table and keep the two other fields for your relationship.

Using a machine name as part of an index is also a bad idea: you should
create another table, put these machine names there and use their identity
values for the second table.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF

"Neil" <nospam@.nospam.net> wrote in message
news:U7h9f.1895$8c5.1662@.newsread3.news.pas.earthl ink.net...
> Re. the composite primary key, note that in my test I did create a table
> with a composite primary key, to simulate the situation, and it worked
> fine. I followed up on that in my more recent post in this thread, which
> shows that the situation is now even more bizarre.
> Regarding changing to a single field primary key, I do not believe that is
> possible. The main table has a single-field primary key (int, identity),
> and the other table (which has a one-to-one relationship with the main
> table) has a dual primary key -- one field corresponding to the main
> table's primary key, and the other containing the machine name. That table
> has to have both fields in the primary key.
> The resulting view can have a one-field or two-field virtual primary key
> when linked in access, depending on whether or not I include the machine
> name field in the resultset. Seems to me that it's better to include it
> and have a two-field primary key, so that Access can determine the record.
> Neil
>
> "Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
> wrote in message news:uTA0rGd3FHA.2640@.TK2MSFTNGP09.phx.gbl...
>> One possible cause for seeing things like #deleted is a missing primary
>> key or Access is not able to determine which field is the primary key.
>>
>> You have said in your first post that you have defined a composite
>> primary key on two field. This is quite possibly the source of your
>> problem: you should try replacing it with a single field primary key.
>> From past experience, Access seems to have a lot of trouble with linked
>> tables or views having composite primary keys.
>>
>> Also, take a look at the following article; in case it might help you:
>> http://support.microsoft.com/kb/q209123/
>>
>> --
>> Sylvain Lafontaine, ing.
>> MVP - Technologies Virtual-PC
>> E-mail: http://cerbermail.com/?QugbLEWINF
>>
>>
>> "Neil" <nospam@.nospam.net> wrote in message
>> news:hFf9f.3901$yX2.1657@.newsread2.news.pas.earthl ink.net...
>>>
>>> "Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
>>> wrote in message news:uQV0$Ra3FHA.2432@.TK2MSFTNGP10.phx.gbl...
>>>> First, you shouldn't crosspost to newsgroups not relevant to your
>>>> problem.
>>>
>>> I wasn't aware that I had done that.
>>>
>>>>
>>>> Second, create a view that will simply select and display the value of
>>>> HOST_NAME() and you will you see if there is a problem with it and
>>>> SQL-Server 7 and a MDB file.
>>>
>>> Good point. I created a view that returned the value of HOST_NAME(), and
>>> it linked fine into the MDB. I also created a new table, gave it a
>>> two-field PK, and used HOST_NAME() as a parameter for one of the fields
>>> in a view. That view also linked and displayed records fine. (Didn't do
>>> a two-table test, which would be similar to what I'm working with. But
>>> it shows that HOST_NAME() works fine with MDB linked views.)
>>>
>>> Neil
>>>
>>>
>>>>
>>>> --
>>>> Sylvain Lafontaine, ing.
>>>> MVP - Technologies Virtual-PC
>>>> E-mail: http://cerbermail.com/?QugbLEWINF
>>>>
>>>>
>>>> "Neil" <nospam@.nospam.net> wrote in message
>>>> news:lra9f.1731$8c5.1137@.newsread3.news.pas.earthl ink.net...
>>>>>I have an Access 2000 MDB file with a SQL 7 back end. I have a main
>>>>>table with 50,000 records; and I have a selections table with 50,000
>>>>>records for each machine that uses the database (about 25-50). This
>>>>>allows each user to have their own set of selections.
>>>>>
>>>>> The selections table has three fields: ID (int), Sel (bit), MachName
>>>>> (varchar). ID and MachName comprise the primary key.
>>>>>
>>>>> I have a view that combines the main table and the entries for the
>>>>> selections table for the current machine (SQL below). The view works
>>>>> fine when opened in EM and QA. And if I create a pass-through query
>>>>> from my Access MDB file, the results are displayed fine.
>>>>>
>>>>> However, if I link the view to the Access MDB file, I get "#Deleted"
>>>>> in every field of every record (which seems to indicate that the
>>>>> records were there and then they were gone). However, if I hard-code
>>>>> the machine name into the same view instead of using HOST_NAME and
>>>>> then relink the view to the MDB file, the linked view opens fine. Only
>>>>> when I use HOST_NAME as a parameter in the view is there a problem
>>>>> with it.
>>>>>
>>>>> Anyone have any idea what's going on here, or have heard of any issues
>>>>> with HOST_NAME and ODBC linked objects? SQL for the view is below.
>>>>>
>>>>> Thanks!
>>>>>
>>>>> Neil
>>>>>
>>>>> SELECT INVTRY.*, InvtrySelections.Sel, InvtrySelections.MachName
>>>>> FROM dbo.INVTRY INNER JOIN
>>>>> dbo.InvtrySelections ON
>>>>> dbo.INVTRY.ID = dbo.InvtrySelections.ID
>>>>> WHERE (dbo.InvtrySelections.MachName = HOST_NAME())
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>|||david@.epsomdotcomdotau wrote:
> Obscure footnote:
>>any floating point columns in your data (including
>>datetime as these are stored as floating point numbers)
>
> SQL Server doesn't store datetime as double. Access does,
> and the problem arises because of the rounding error in
> the conversion between the Access version and the SQL
> Server version, even when values are not 'stored' in Access
> at all.

Sorry, my bad. It's 2 ints (or Longs in AccessSpeak).|||Neil (nospam@.nospam.net) writes:
> After I got your note I did go ahead and make MachName nchar, as BOL
> says that HOST_NAME() returns that type, and the sample it showed of
> storing its return value in a table used an nchar(30) field.
> The InvtrySelections table had the PK (ID/MachName) as the clustered
> index. I created a second index on MachName alone, and it made it the
> clustered index.
> With the above two changes, the results were the same. Still getting
> "#Deleted".

As I said, I did not really expect that. I more had performance in mind.

But now it occurred to me, that it's a bit of a non-issue for you. To
wit, the rules for implicit conversion are different in SQL 7 and
SQL 2000. The potential performance problem I saw, probably only exists
in SQL 2000. Then again, it's good to be prepared, in case you upgrade
to SQL 2005 one day. :-)

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||You're saying that SQL 2000 performs implicit conversions, but SQL 7
doesn't? That seems like a step backwards for MS. I wish Access didn't
perform implicit conversions.

"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns97011305379Yazorman@.127.0.0.1...
> Neil (nospam@.nospam.net) writes:
>> After I got your note I did go ahead and make MachName nchar, as BOL
>> says that HOST_NAME() returns that type, and the sample it showed of
>> storing its return value in a table used an nchar(30) field.
>>
>> The InvtrySelections table had the PK (ID/MachName) as the clustered
>> index. I created a second index on MachName alone, and it made it the
>> clustered index.
>>
>> With the above two changes, the results were the same. Still getting
>> "#Deleted".
> As I said, I did not really expect that. I more had performance in mind.
> But now it occurred to me, that it's a bit of a non-issue for you. To
> wit, the rules for implicit conversion are different in SQL 7 and
> SQL 2000. The potential performance problem I saw, probably only exists
> in SQL 2000. Then again, it's good to be prepared, in case you upgrade
> to SQL 2005 one day. :-)
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techin.../2000/books.asp|||Neil (nospam@.nospam.net) writes:
> You're saying that SQL 2000 performs implicit conversions, but SQL 7
> doesn't? That seems like a step backwards for MS. I wish Access didn't
> perform implicit conversions.

That step backwards was taken with SQL 7 from SQL 6.5. A few more implicit
conversions were added in SQL 2005.

Of course, sometimes you do want implicit conversions. It's convenient
to have explicit conversions from character to datetime, or from integer
to bit. But from string to number and numbers to string? That's only bad.

This particular case is about an implicit conversion between varchar
and nvarchar. (or char/nchar), which can occur in both SQL 7 and SQL 2000.
What is different are the rules of what is being converted. In SQL 2000
there is a strict data-type precendence, so a type with low precendence is
always converted to a higher. Thus, a varchar value is converted to
nvarchar, since nvarchar is higher up. I don't know the rules for SQL 7,
as I never worked much with this version, but I know they are different,
and it might be that values are converted rather than columns.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||(Removed most groups from way too long crosspost list)

On Tue, 1 Nov 2005 08:06:22 +0000 (UTC), Erland Sommarskog wrote:

>What is different are the rules of what is being converted. In SQL 2000
>there is a strict data-type precendence, so a type with low precendence is
>always converted to a higher. Thus, a varchar value is converted to
>nvarchar, since nvarchar is higher up. I don't know the rules for SQL 7,
>as I never worked much with this version, but I know they are different,
>and it might be that values are converted rather than columns.

Hi Erland,

What I understood is that the difference is related to expressions of
the type
column_name = constant (value or expression)

In SQL Server 7.0, the constant would (sometimes? always?) be converted
to match the column's datatype, regardless of datatype precedence rules.
In SQL Server 2000, datatype precedence determines if the column or the
constant has to be converted.

The nice thing about the "old" method was that the implicit conversion
of the constant enabled the optimizer to use an index that was defined
on the column; in SQL Server 2000, the implicit conversion of the column
would preclude the use of that index.
Of course, the price one paid for the index use in the old version was
that the database didn't always do what you'd expect after perusing the
precedence rules.

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)|||Hugo Kornelis (hugo@.pe_NO_rFact.in_SPAM_fo) writes:
> The nice thing about the "old" method was that the implicit conversion
> of the constant enabled the optimizer to use an index that was defined
> on the column; in SQL Server 2000, the implicit conversion of the column
> would preclude the use of that index.

But what happened if two columns of different data types met?

> Of course, the price one paid for the index use in the old version was
> that the database didn't always do what you'd expect after perusing the
> precedence rules.

As I said, I basically slept over SQL 7, so missed the problem.

Of course, in many cases, these problems could be avoided by not
having implicit conversions at all.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||On Wed, 2 Nov 2005 22:47:00 +0000 (UTC), Erland Sommarskog wrote:

>Hugo Kornelis (hugo@.pe_NO_rFact.in_SPAM_fo) writes:
>> The nice thing about the "old" method was that the implicit conversion
>> of the constant enabled the optimizer to use an index that was defined
>> on the column; in SQL Server 2000, the implicit conversion of the column
>> would preclude the use of that index.
>But what happened if two columns of different data types met?

Hi Erland,

I'm sorry, but I don't know that.

I've learned what I posted when figuring out why queries that ran
smoothly on SQL 7 were going at snail pace after upgrading. Turned out
that the converting a column instead of converting the constant meant
that a table scan was chosen instead of an index seek.

I've never witnessed similar problems for column to column comparisons,
so I don't know how they were executed.

>> Of course, the price one paid for the index use in the old version was
>> that the database didn't always do what you'd expect after perusing the
>> precedence rules.
>As I said, I basically slept over SQL 7, so missed the problem.
>Of course, in many cases, these problems could be avoided by not
>having implicit conversions at all.

I couldn't agree more!

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)