显示标签为“hii”的博文。显示所有博文
显示标签为“hii”的博文。显示所有博文

2012年3月25日星期日

Disk or network error

Hi

I have written an application in VB through which I can convert DBASE
IV database to MS SQL Server database. Also, the application provides
database manipulation features to the user like addition, deletion etc
of records.
I am using OPENROWSET for conversion purposes. Also the server is MS
SQL Server 2000.
Now this application workks fine when I have installed the instance of
MS SQL Server on my local machine. It converts the database and stores
it on the server perfectly and there are no isues.
However, when I try to use the application to connect with MS SQL
Server on another machine, there are a few problems. I connect to the
other MS SQL Server on other machine through named pipes. My
application successfully accesses the database and allows user to
modify it according to his needs.
For this I created the user account of that user on the machine.
But when I try to convert the database, I get the following error
message:

[Microsoft ODBC Dbase driver]Disk or Network Error

Here is the line in VB code which is causing all the trouble:

con.Execute "select * into " & UCase(X) & " from
OPENROWSET('MSDASQL','Driver={Microsoft dBASE Driver
(*.dbf)};DEFAULTDIR=" & BaseData & ";SourceType=DBF','select * from " &
UCase(X) & "')"

Here, X is the dbf file name, BaseData is the path name of file.
I gave the user full rights but i am still getting this error message.
Now, what am I doing wrong here?

Regards,
ShwetabhHi

You don't say of you can open the DBASE file from DBASE on the remote
machine? Are you using a mapped drive or UNC name? Have you checked that the
permissions are correct for the SQL Server service account?

John
"Shwetabh" <shwetabhgoel@.gmail.com> wrote in message
news:1144529567.672831.5960@.v46g2000cwv.googlegrou ps.com...
> Hi
> I have written an application in VB through which I can convert DBASE
> IV database to MS SQL Server database. Also, the application provides
> database manipulation features to the user like addition, deletion etc
> of records.
> I am using OPENROWSET for conversion purposes. Also the server is MS
> SQL Server 2000.
> Now this application workks fine when I have installed the instance of
> MS SQL Server on my local machine. It converts the database and stores
> it on the server perfectly and there are no isues.
> However, when I try to use the application to connect with MS SQL
> Server on another machine, there are a few problems. I connect to the
> other MS SQL Server on other machine through named pipes. My
> application successfully accesses the database and allows user to
> modify it according to his needs.
> For this I created the user account of that user on the machine.
> But when I try to convert the database, I get the following error
> message:
> [Microsoft ODBC Dbase driver]Disk or Network Error
> Here is the line in VB code which is causing all the trouble:
> con.Execute "select * into " & UCase(X) & " from
> OPENROWSET('MSDASQL','Driver={Microsoft dBASE Driver
> (*.dbf)};DEFAULTDIR=" & BaseData & ";SourceType=DBF','select * from " &
> UCase(X) & "')"
> Here, X is the dbf file name, BaseData is the path name of file.
> I gave the user full rights but i am still getting this error message.
> Now, what am I doing wrong here?
> Regards,
> Shwetabh|||Hi,

Actually, the DBASE files are stored in a seperate folder on the remote
machine (remote in the sense that though it is in the intranet, SQL
server 2000 isnt installed on it). I have made the drive shared. Also,
in my effort to get it to work, I gave the user all rights on the SQL
server. But it still doesnt work.
And yes, I am using UNC name.

Regards,
Shwetabh|||Hi Shwetabh

If you service account is a domain account then log onto the SQL Server
machine as this account and see if you can access the DBASE files.

John

Shwetabh wrote:
> Hi,
> Actually, the DBASE files are stored in a seperate folder on the remote
> machine (remote in the sense that though it is in the intranet, SQL
> server 2000 isnt installed on it). I have made the drive shared. Also,
> in my effort to get it to work, I gave the user all rights on the SQL
> server. But it still doesnt work.
> And yes, I am using UNC name.
> Regards,
> Shwetabh|||Hi,
Sorry for taking so long to reply.
Actually, I can access the database from my application.
But I am unable to import my DBASE database to sql server.
when I try to do so, using OPENROWSET I get the error message.
Also, since the end product will be used by many other people,
their individual accounts will be created, I dont think using domain
account will be a good idea.

Regards,
Shwetabh|||Hi

To access network resources you will need a domain account with the
appropriate privileges otherwise you will not be able to connect.

John
"Shwetabh" <shwetabhgoel@.gmail.com> wrote in message
news:1145602062.263512.306870@.e56g2000cwe.googlegr oups.com...
> Hi,
> Sorry for taking so long to reply.
> Actually, I can access the database from my application.
> But I am unable to import my DBASE database to sql server.
> when I try to do so, using OPENROWSET I get the error message.
> Also, since the end product will be used by many other people,
> their individual accounts will be created, I dont think using domain
> account will be a good idea.
> Regards,
> Shwetabh|||Hi,

Lets consider this,
I have the DBASE files on the local machine.
Now I want to convert them and store them in MS SQL
Server.
Now for doing this, I use OPENROWSET.
I can access the already converted database (which I converted
manually on the server for testing purpose). I can read, write, delete
that data. I get no errors when I do that.
Now when I try to convert database from DBF (stored on local disk)
to SQL using OPENROWSET, I get the error: Disk or Network Error.

How should I resolve this?

Shwetabh|||Shwetabh (shwetabhgoel@.gmail.com) writes:
> Sorry for taking so long to reply.
> Actually, I can access the database from my application.
> But I am unable to import my DBASE database to sql server.
> when I try to do so, using OPENROWSET I get the error message.
> Also, since the end product will be used by many other people,
> their individual accounts will be created, I dont think using domain
> account will be a good idea.

When John talked about domain account, he referred to the account
under which SQL Server itself is running. To access resources on
the network, the account should be a domain account. Running SQL
Server under a domain account is a very common thing to do, even
in multi-user enviroments.

To review the service accont for SQL Server, right-click My Computer
on the server, select Manage. Find Services, and in the list of
services, find MSSQL Server. Double-click, and go the log on tab.
Make sure that the user there has access to the remote drive
where the DBASE files are located.

Or move the DBASE files to a local disk on the server.

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

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Hi,

I tried to access the database stored on a machine running Windows 2000
+ MS SQL Server 2000 and it worked fine.
Infact, it worked fine when used by any machine which would connect to
Windows 2000 server.
I was easily able to import the data on servers running Windows 2k.
But I am getting this error by connecting onto the servers running
Windows 2003.

Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [Microsoft][ODBC dBase Driver] The
Microsoft Jet database engine could not find the object 'ACE'. Make
sure the object exists and that you spell its name and the path name
correctly.]

How can I resolve this problem?

Regards,
Shwetabh|||Hi,

I tried to access the database stored on a machine running Windows 2000
+ MS SQL Server 2000 and it worked fine.
Infact, it worked fine when used by any machine which would connect to
Windows 2000 server.
I was easily able to import the data on servers running Windows 2k.
But I am getting this error by connecting onto the servers running
Windows 2003.

Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [Microsoft][ODBC dBase Driver] The
Microsoft Jet database engine could not find the object 'ACE'. Make
sure the object exists and that you spell its name and the path name
correctly.]

Windows 2003 server is also running MS SQL Server 2000. But I cant get
it to work.
How can I resolve this problem?

Regards,
Shwetabh|||Shwetabh (shwetabhgoel@.gmail.com) writes:
> I tried to access the database stored on a machine running Windows 2000
> + MS SQL Server 2000 and it worked fine.
> Infact, it worked fine when used by any machine which would connect to
> Windows 2000 server.
> I was easily able to import the data on servers running Windows 2k.
> But I am getting this error by connecting onto the servers running
> Windows 2003.
> Server: Msg 7399, Level 16, State 1, Line 1
> OLE DB provider 'MSDASQL' reported an error.
> [OLE/DB provider returned message: [Microsoft][ODBC dBase Driver] The
> Microsoft Jet database engine could not find the object 'ACE'. Make
> sure the object exists and that you spell its name and the path name
> correctly.]
> How can I resolve this problem?

Not that I am sure that I can help anyway, but it would definitely help if
you can give full details, both when it is working and when it is not.

1) Where is the dBase file located in relation to the SQL Server? Local
disk or an a network share?

2) Under what account is SQL Server running?

3) Do you get the error when you run under any account on SQL Server,
even as administrator?

In the end this may have more to do with Windows or Active Directory that
I know very little about.

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

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Disk exchange on two-node MS SQL 2000 active/active cluster

Hi!
I have two-node cluster on Windows 2000 Adv Server sp4. There are two
instanses of MS SQL 2000 Server sp3, one on each node. I have one
physical disk owened by the first node, that is not used. I need to
transfer it to the second node, name it with the letter this node
already has (removing the disk with this letter from the node by
renaming it or just by deleting) and place on it SQL Server logs that
were located on the disk with this letter.
This is my plan:
1. Transfer disk Z: from node SQL1 to node SQL2
2. Stop sql server and agent services on node SQL2 (or take them
offline with cluster administrator) WHich is better?
3. Copy log files from disk V: to disk Z: on node SQL2
4. Delete disk V: (or rename it as lets say P: ) - I plan to remove
the mirror with the former V: disk from storage
5. Rename disk Z: to disk V: on node SQL2
6. Start sql server and agent services on node SQL2 (or take them
online with cluster administrator)
Is the plan correct? Are there any dangers like (suppose) node signs
its drives and will not accept another disk because of it or because
the disks are a bit different in size? Anything else?
Thanks.
I will be doing something similar this Sunday morning, but with a 2003
cluster. Comments inline.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Roust_m" <roustam@.hotbox.ru> wrote in message
news:a388fd78.0405210601.2d69da11@.posting.google.c om...
> Hi!
> I have two-node cluster on Windows 2000 Adv Server sp4. There are two
> instanses of MS SQL 2000 Server sp3, one on each node. I have one
> physical disk owened by the first node, that is not used. I need to
> transfer it to the second node, name it with the letter this node
> already has (removing the disk with this letter from the node by
> renaming it or just by deleting) and place on it SQL Server logs that
> were located on the disk with this letter.
> This is my plan:
> 1. Transfer disk Z: from node SQL1 to node SQL2
> 2. Stop sql server and agent services on node SQL2 (or take them
> offline with cluster administrator) WHich is better?
Use Cluster administrator to take the SQL service offline but leave the disk
resources online.
> 3. Copy log files from disk V: to disk Z: on node SQL2
>
Good.
> 4. Delete disk V: (or rename it as lets say P: ) - I plan to remove
> the mirror with the former V: disk from storage
>
Reletter it. Take it out of the SQL resource group.
> 5. Rename disk Z: to disk V: on node SQL2
>
Add this disk to the SQL resource group. Make SQL Server dependant on this
disk resource.
> 6. Start sql server and agent services on node SQL2 (or take them
> online with cluster administrator)
> Is the plan correct? Are there any dangers like (suppose) node signs
> its drives and will not accept another disk because of it or because
> the disks are a bit different in size? Anything else?
>
I have tested this once with a complete disk replacement using a test build.
Everything worked as expected. Make sure SQL stays offline while you are
moving things around. Make double sure you have fixed the dependancies.
Backup the universe before trying anything.
> Thanks.
|||Trying to transfer disk Z: from node SQL1 to node SQL2 (right mouse
button, change group, choose SQL2) get a window:
Are you sure the 'SQL1 Backup Z:' resource should be moved from the
''SQL1' group to the ''SQL2' group?
Choose "Yes"
Get another message:
Move Resources
The group will be changed for the following resources:
SQL1 Backup Z: (Only this resource, that means that I removed SQL
Server and dependancies from it)
Choose "Yes" again:
Get an error:
An error occured attempting to change the group of the 'Node2_BACKUP
Z:' resource to 'Node1'
The cluster node is not the owner of the group.
Error ID: 5016 (00001398).
Could not find how to change this.
"Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message news:<urKIL3zPEHA.3012@.TK2MSFTNGP09.phx.gbl>...[vbcol=seagreen]
> I will be doing something similar this Sunday morning, but with a 2003
> cluster. Comments inline.
> --
> Geoff N. Hiten
> Microsoft SQL Server MVP
> Senior Database Administrator
> Careerbuilder.com
> I support the Professional Association for SQL Server
> www.sqlpass.org
> "Roust_m" <roustam@.hotbox.ru> wrote in message
> news:a388fd78.0405210601.2d69da11@.posting.google.c om...
> Use Cluster administrator to take the SQL service offline but leave the disk
> resources online.
> Good.
> Reletter it. Take it out of the SQL resource group.
> Add this disk to the SQL resource group. Make SQL Server dependant on this
> disk resource.
> I have tested this once with a complete disk replacement using a test build.
> Everything worked as expected. Make sure SQL stays offline while you are
> moving things around. Make double sure you have fixed the dependancies.
> Backup the universe before trying anything.
|||Bring both resource groups to the node you are logged into. Do the group
changes from that machine.
FYI, my changeover went smoothly. No issues with a replacement partition as
long as the group membership and dependancies are correct.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Roust_m" <roustam@.hotbox.ru> wrote in message
news:a388fd78.0405220639.1bc712da@.posting.google.c om...
> Trying to transfer disk Z: from node SQL1 to node SQL2 (right mouse
> button, change group, choose SQL2) get a window:
> Are you sure the 'SQL1 Backup Z:' resource should be moved from the
> ''SQL1' group to the ''SQL2' group?
> Choose "Yes"
> Get another message:
> Move Resources
> The group will be changed for the following resources:
> SQL1 Backup Z: (Only this resource, that means that I removed SQL
> Server and dependancies from it)
> Choose "Yes" again:
> Get an error:
> An error occured attempting to change the group of the 'Node2_BACKUP
> Z:' resource to 'Node1'
> The cluster node is not the owner of the group.
> Error ID: 5016 (00001398).
> Could not find how to change this.
> "Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message
news:<urKIL3zPEHA.3012@.TK2MSFTNGP09.phx.gbl>...[vbcol=seagreen]
disk[vbcol=seagreen]
this[vbcol=seagreen]
build.[vbcol=seagreen]
are[vbcol=seagreen]
|||Hi!
I tried to bring everything to the node I was loged on and the node I
was trying to give ownership of the disk (the same node) - the same
error. Just deleted this resource and recreated it on the correct node.
After this all went fine.
Thanks.
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!

2012年3月19日星期一

Disconnected app with sql server compact

Hi
I am developing an app in vb.net 2008 with sql server 2000 backend. I also
need disconnected version of the app for laptop users who would connect off
and on with LAN and thereby with the company sql server 2000. I am wondering
if I can use sql server compact 3.5 for local caching when laptops are
disconnected. My question is; how would my app use views and stored
procedures in disconnected mode as sql server compact does not support
either of these. Any help to clarify this would be appreciated.
Thanks
Regards
The local Compact Edition database could be used for data caching. You could
write your own managed code to access it but as you found, there is no
support for SPs or Views. Your only other alternative would be to use the
Express edition on the client system which does support SPs and Views. In
either case you would want to use one of the various synchronization
paradigms to keep the two databases in sync.
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
------
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O5clkypMIHA.4480@.TK2MSFTNGP06.phx.gbl...
> Hi
> I am developing an app in vb.net 2008 with sql server 2000 backend. I also
> need disconnected version of the app for laptop users who would connect
> off and on with LAN and thereby with the company sql server 2000. I am
> wondering if I can use sql server compact 3.5 for local caching when
> laptops are disconnected. My question is; how would my app use views and
> stored procedures in disconnected mode as sql server compact does not
> support either of these. Any help to clarify this would be appreciated.
> Thanks
> Regards
>
|||Like Bill V said, the main point is that you'd need to synchronize your
data. since there aren't views or stored procs, there's no way to do it
directly. You can create a backgroun thread or other mechanism to determine
when you are connected to the network, and when you are, flip a flag and
then use your DALC to talk directly to the big sql server.
You can mimick views (although not anything close to the real thing) by
filling a datatable with a query that corresponds to what the view was.
Although I'm not going to even touch the stored proc vs dynamic sql debate,
I can say that much of the benefit of using stored procs diminishes when
you're using a local db like Compact Edition in this manner.
You can also just bypass CE altogether. Pull down the data from sql server
into a dataset that contains everything you need to work with, interact with
that local data, buy some persistence by saving it to XML using writexml and
then when you're connected again, you can just run your Update() on the full
sql server. There's a ton of tradeoffs here so don't take this is a
recommendation, rather it's just a statement saying if you only need a
local cache of data, you don't necessarily need Compact Edition at all.
If it were mine though, i'd do as Mr Vaughn says and use it w/
synchronization.
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O5clkypMIHA.4480@.TK2MSFTNGP06.phx.gbl...
> Hi
> I am developing an app in vb.net 2008 with sql server 2000 backend. I also
> need disconnected version of the app for laptop users who would connect
> off and on with LAN and thereby with the company sql server 2000. I am
> wondering if I can use sql server compact 3.5 for local caching when
> laptops are disconnected. My question is; how would my app use views and
> stored procedures in disconnected mode as sql server compact does not
> support either of these. Any help to clarify this would be appreciated.
> Thanks
> Regards
>

Disconnected app with sql server compact

Hi
I am developing an app in vb.net 2008 with sql server 2000 backend. I also
need disconnected version of the app for laptop users who would connect off
and on with LAN and thereby with the company sql server 2000. I am wondering
if I can use sql server compact 3.5 for local caching when laptops are
disconnected. My question is; how would my app use views and stored
procedures in disconnected mode as sql server compact does not support
either of these. Any help to clarify this would be appreciated.
Thanks
Regards
If you want to use views and stored procedures, then SQL Server Compact is
not an option. However, you can use SQL Server Express, which supports
procedural T-SQL.
HTH,
Plamen Ratchev
http://www.SQLStudio.com
|||The local Compact Edition database could be used for data caching. You could
write your own managed code to access it but as you found, there is no
support for SPs or Views. Your only other alternative would be to use the
Express edition on the client system which does support SPs and Views. In
either case you would want to use one of the various synchronization
paradigms to keep the two databases in sync.
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
------
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O5clkypMIHA.4480@.TK2MSFTNGP06.phx.gbl...
> Hi
> I am developing an app in vb.net 2008 with sql server 2000 backend. I also
> need disconnected version of the app for laptop users who would connect
> off and on with LAN and thereby with the company sql server 2000. I am
> wondering if I can use sql server compact 3.5 for local caching when
> laptops are disconnected. My question is; how would my app use views and
> stored procedures in disconnected mode as sql server compact does not
> support either of these. Any help to clarify this would be appreciated.
> Thanks
> Regards
>
|||Like Bill V said, the main point is that you'd need to synchronize your
data. since there aren't views or stored procs, there's no way to do it
directly. You can create a backgroun thread or other mechanism to determine
when you are connected to the network, and when you are, flip a flag and
then use your DALC to talk directly to the big sql server.
You can mimick views (although not anything close to the real thing) by
filling a datatable with a query that corresponds to what the view was.
Although I'm not going to even touch the stored proc vs dynamic sql debate,
I can say that much of the benefit of using stored procs diminishes when
you're using a local db like Compact Edition in this manner.
You can also just bypass CE altogether. Pull down the data from sql server
into a dataset that contains everything you need to work with, interact with
that local data, buy some persistence by saving it to XML using writexml and
then when you're connected again, you can just run your Update() on the full
sql server. There's a ton of tradeoffs here so don't take this is a
recommendation, rather it's just a statement saying if you only need a
local cache of data, you don't necessarily need Compact Edition at all.
If it were mine though, i'd do as Mr Vaughn says and use it w/
synchronization.
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O5clkypMIHA.4480@.TK2MSFTNGP06.phx.gbl...
> Hi
> I am developing an app in vb.net 2008 with sql server 2000 backend. I also
> need disconnected version of the app for laptop users who would connect
> off and on with LAN and thereby with the company sql server 2000. I am
> wondering if I can use sql server compact 3.5 for local caching when
> laptops are disconnected. My question is; how would my app use views and
> stored procedures in disconnected mode as sql server compact does not
> support either of these. Any help to clarify this would be appreciated.
> Thanks
> Regards
>

Disconnected app with sql server compact

Hi
I am developing an app in vb.net 2008 with sql server 2000 backend. I also
need disconnected version of the app for laptop users who would connect off
and on with LAN and thereby with the company sql server 2000. I am wondering
if I can use sql server compact 3.5 for local caching when laptops are
disconnected. My question is; how would my app use views and stored
procedures in disconnected mode as sql server compact does not support
either of these. Any help to clarify this would be appreciated.
Thanks
RegardsIf you want to use views and stored procedures, then SQL Server Compact is
not an option. However, you can use SQL Server Express, which supports
procedural T-SQL.
HTH,
Plamen Ratchev
http://www.SQLStudio.com|||The local Compact Edition database could be used for data caching. You could
write your own managed code to access it but as you found, there is no
support for SPs or Views. Your only other alternative would be to use the
Express edition on the client system which does support SPs and Views. In
either case you would want to use one of the various synchronization
paradigms to keep the two databases in sync.
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
----
---
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O5clkypMIHA.4480@.TK2MSFTNGP06.phx.gbl...
> Hi
> I am developing an app in vb.net 2008 with sql server 2000 backend. I also
> need disconnected version of the app for laptop users who would connect
> off and on with LAN and thereby with the company sql server 2000. I am
> wondering if I can use sql server compact 3.5 for local caching when
> laptops are disconnected. My question is; how would my app use views and
> stored procedures in disconnected mode as sql server compact does not
> support either of these. Any help to clarify this would be appreciated.
> Thanks
> Regards
>|||Like Bill V said, the main point is that you'd need to synchronize your
data. since there aren't views or stored procs, there's no way to do it
directly. You can create a backgroun thread or other mechanism to determine
when you are connected to the network, and when you are, flip a flag and
then use your DALC to talk directly to the big sql server.
You can mimick views (although not anything close to the real thing) by
filling a datatable with a query that corresponds to what the view was.
Although I'm not going to even touch the stored proc vs dynamic sql debate,
I can say that much of the benefit of using stored procs diminishes when
you're using a local db like Compact Edition in this manner.
You can also just bypass CE altogether. Pull down the data from sql server
into a dataset that contains everything you need to work with, interact with
that local data, buy some persistence by saving it to XML using writexml and
then when you're connected again, you can just run your Update() on the full
sql server. There's a ton of tradeoffs here so don't take this is a
recommendation, rather it's just a statement saying if you only need a
local cache of data, you don't necessarily need Compact Edition at all.
If it were mine though, i'd do as Mr Vaughn says and use it w/
synchronization.
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O5clkypMIHA.4480@.TK2MSFTNGP06.phx.gbl...
> Hi
> I am developing an app in vb.net 2008 with sql server 2000 backend. I also
> need disconnected version of the app for laptop users who would connect
> off and on with LAN and thereby with the company sql server 2000. I am
> wondering if I can use sql server compact 3.5 for local caching when
> laptops are disconnected. My question is; how would my app use views and
> stored procedures in disconnected mode as sql server compact does not
> support either of these. Any help to clarify this would be appreciated.
> Thanks
> Regards
>

Disconnect from sql server database

Hi
I have c# application that uses SQL SERVER databases.
The problem is that after I close all connections to a database in order to
make actions (detach, copy or delete) on the current database I get a
message saying that the database still has connections.
At the Enterprise manager I can see that the current database still has 2
connections although I closed them in my application.
I would like to disconnect from the database through the application and
make the actions that were mentioned above, how can I do that?
Thanks,
Eyal
On SQL SERVER 2000, you can disconnect all the current connections with:
ALTER DATABASE your_database SET SINGLE_USER WITH ROLLBACK IMMEDIATE
USE master
DROP DATABASE your_database etc..
You need USE master, otherwise you're still connected yourself.
Jacco Schalkwijk
SQL Server MVP
"Eyal" <eg@.margan.com> wrote in message
news:eYltEA3BFHA.3592@.TK2MSFTNGP09.phx.gbl...
> Hi
>
> I have c# application that uses SQL SERVER databases.
> The problem is that after I close all connections to a database in order
> to
> make actions (detach, copy or delete) on the current database I get a
> message saying that the database still has connections.
>
> At the Enterprise manager I can see that the current database still has 2
> connections although I closed them in my application.
>
> I would like to disconnect from the database through the application and
> make the actions that were mentioned above, how can I do that?
>
> Thanks,
> Eyal
>

Disconnect from sql server database

Hi
I have c# application that uses SQL SERVER databases.
The problem is that after I close all connections to a database in order to
make actions (detach, copy or delete) on the current database I get a
message saying that the database still has connections.
At the Enterprise manager I can see that the current database still has 2
connections although I closed them in my application.
I would like to disconnect from the database through the application and
make the actions that were mentioned above, how can I do that?
Thanks,
Eyal
My guess is that you are using connection pooling. This is the default
setting for SqlClient. Do please check about connection pooling in .Net
documentation if this is your problem.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
"Eyal" <eg@.margan.com> wrote in message
news:eAAkq$2BFHA.3236@.TK2MSFTNGP15.phx.gbl...
> Hi
>
> I have c# application that uses SQL SERVER databases.
> The problem is that after I close all connections to a database in order
to
> make actions (detach, copy or delete) on the current database I get a
> message saying that the database still has connections.
>
> At the Enterprise manager I can see that the current database still has 2
> connections although I closed them in my application.
>
> I would like to disconnect from the database through the application and
> make the actions that were mentioned above, how can I do that?
>
> Thanks,
> Eyal
>

Disconnect from sql server database

Hi
I have c# application that uses SQL SERVER databases.
The problem is that after I close all connections to a database in order to
make actions (detach, copy or delete) on the current database I get a
message saying that the database still has connections.
At the Enterprise manager I can see that the current database still has 2
connections although I closed them in my application.
I would like to disconnect from the database through the application and
make the actions that were mentioned above, how can I do that?
Thanks,
EyalMy guess is that you are using connection pooling. This is the default
setting for SqlClient. Do please check about connection pooling in .Net
documentation if this is your problem.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
"Eyal" <eg@.margan.com> wrote in message
news:eAAkq$2BFHA.3236@.TK2MSFTNGP15.phx.gbl...
> Hi
>
> I have c# application that uses SQL SERVER databases.
> The problem is that after I close all connections to a database in order
to
> make actions (detach, copy or delete) on the current database I get a
> message saying that the database still has connections.
>
> At the Enterprise manager I can see that the current database still has 2
> connections although I closed them in my application.
>
> I would like to disconnect from the database through the application and
> make the actions that were mentioned above, how can I do that?
>
> Thanks,
> Eyal
>

2012年2月25日星期六

Disabling primary key


Hi
i have a table with primary key defined on col1 and col2. now i want to
have col3 also included in primary key. when i alter the table it gives
me error for duplicate rows. there is an option for 'with nocheck' but
it only works with check or foreign key constraint. is there any option
in sql server like in oracle 'no validate' which doesnt validate the
existing data and force the data validation from new records.
thanx
Farid

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!"Ghulam Farid" <gfaryd@.yahoo.com> wrote in message
news:40b49d58$0$209$75868355@.news.frii.net...
>
> Hi
> i have a table with primary key defined on col1 and col2. now i want to
> have col3 also included in primary key. when i alter the table it gives
> me error for duplicate rows. there is an option for 'with nocheck' but
> it only works with check or foreign key constraint. is there any option
> in sql server like in oracle 'no validate' which doesnt validate the
> existing data and force the data validation from new records.
> thanx
> Farid
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

No - CHECK/NOCHECK is for foreign keys and check constraints only. I'm not
entirely sure I understand your post - are you saying that you want to allow
duplicate values in a primary key? If so, then it's not possible, and
shouldn't be. Perhaps if you can post some more details (the table DDL and
sample data), someone may be able to suggest an alternative approach.

Simon|||"Simon Hayes" <sql@.hayes.ch> wrote in message
news:40b4d73d_1@.news.bluewin.ch...
> "Ghulam Farid" <gfaryd@.yahoo.com> wrote in message
> news:40b49d58$0$209$75868355@.news.frii.net...
> > Hi
> > i have a table with primary key defined on col1 and col2. now i want to
> > have col3 also included in primary key. when i alter the table it gives
> > me error for duplicate rows. there is an option for 'with nocheck' but
> > it only works with check or foreign key constraint. is there any option
> > in sql server like in oracle 'no validate' which doesnt validate the
> > existing data and force the data validation from new records.
> > thanx
> > Farid
> > *** Sent via Developersdex http://www.developersdex.com ***
> > Don't just participate in USENET...get rewarded for it!
> No - CHECK/NOCHECK is for foreign keys and check constraints only. I'm not
> entirely sure I understand your post - are you saying that you want to
allow
> duplicate values in a primary key? If so, then it's not possible, and
> shouldn't be. Perhaps if you can post some more details (the table DDL and
> sample data), someone may be able to suggest an alternative approach.

I think he wants: SET IDENTITY_INSERT.

> Simon|||>> I have a table with primary key defined on col1 and col2. Now I
want to
have col3 also included in primary key. When I alter the table it
gives me error for duplicate rows. <<

That does not make sense to me. Given this

CREATE TABLE Foobar
(col1 INTEGER NOT NULL,
col2 INTEGER NOT NULL,
col3 INTEGER NOT NULL,
PRIMARY KEY (col1, col2),
..);

Then a superkey is still unique:

CREATE TABLE Foobar
(col1 INTEGER NOT NULL,
col2 INTEGER NOT NULL,
col3 INTEGER NOT NULL,
PRIMARY KEY (col1, col2, col3),
..);|||i think u people didn't understand the problem.
i have created table
create table test(col1 int, col2 int, col3 int,col4...)
Primary key(col1,col2)
as there is primary key on col1 and col2 no duolicate data can exist in
them now the scenario changed i have to change the primary key on the
table. now when i alter the table
alter table test primary key (col1, col3, col4) it gives me error
duplicate rows exist.
but in my scenario i want the existing duplication to remain in the
table. and the primary key enforcement starts from new data.
in oracle there is an option of 'no validate' which doesnt check the
existing data in the table but enforce the uniqueness of data from new
records. i want to know is there any option available in sql server
which doesnt check the existing data but enforces the uniqueness of
records from new records.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||Ghulam Farid <gfaryd@.yahoo.com> wrote in message news:<40b57e55$0$207$75868355@.news.frii.net>...
> i think u people didn't understand the problem.
> i have created table
> create table test(col1 int, col2 int, col3 int,col4...)
> Primary key(col1,col2)
> as there is primary key on col1 and col2 no duolicate data can exist in
> them now the scenario changed i have to change the primary key on the
> table. now when i alter the table
> alter table test primary key (col1, col3, col4) it gives me error
> duplicate rows exist.
> but in my scenario i want the existing duplication to remain in the
> table. and the primary key enforcement starts from new data.
> in oracle there is an option of 'no validate' which doesnt check the
> existing data in the table but enforce the uniqueness of data from new
> records. i want to know is there any option available in sql server
> which doesnt check the existing data but enforces the uniqueness of
> records from new records.
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

It sounds like you want to place a primary key on columns which
contain duplicates, but you want to ignore those duplicates and only
enforce the primary key for new values? If so, then it's not possible
- all values in a primary key must always be unique, otherwise it
couldn't be a primary key.

Simon

create table dbo.Test (
col1 int not null,
col2 int not null,
col3 int not null,
col4 int not null,
constraint PK_Test primary key (col1, col2)
)
go

insert into dbo.Test
select 1,1,1,1
union all
select 1,2,1,1
union all
select 3,1,1,1
go

alter table dbo.Test
drop constraint PK_Test

-- This will always fail because of duplicate data
alter table dbo.Test
add constraint PK_Test primary key (col1, col3, col4)
go

drop table dbo.Test
go

2012年2月19日星期日

Disable SQL

Hi
I use SPSS for Windows on XP (HE). My system nearly came
to a halt recently, and I noticed SQL.LOG was a
fragmented text file (830 Mb) on C drive. I opened a new
text file and saved it as SQL.LOG in the same location.
This solved my problem, but I don't know how to disable
SQL and I don't know what would happen if I did.
Hope you can help.
VintageRad
It sounds to me like ODBC Tracing is enabled on this computer. You can turn
it off from Control Panel. In my case, running on Windows XP, it's Control
Panel/Administrative Tools/Data Sources (ODBC), and the Tracing tab. After
you've turned it off, you can delete that file.
Sincerely,
Stephen Dybing
This posting is provided "AS IS" with no warranties, and confers no rights.
"VintageRad" <vintage_rad@.msn.com> wrote in message
news:680d01c493eb$adc65370$a601280a@.phx.gbl...
> Hi
> I use SPSS for Windows on XP (HE). My system nearly came
> to a halt recently, and I noticed SQL.LOG was a
> fragmented text file (830 Mb) on C drive. I opened a new
> text file and saved it as SQL.LOG in the same location.
> This solved my problem, but I don't know how to disable
> SQL and I don't know what would happen if I did.
> Hope you can help.
> VintageRad
|||*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
|||Stephen
That advice was very helpful. The SQL.LOG txt file is no longer filling
up.
VintageRad
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!

2012年2月17日星期五

Disable Job Steps

Hi
I have a job setup in SQL Server Agent (SQL 2005) that runs multiple
packages. Each package is run as a separate step in the job. I am busy
testing the job and want to skip some of the longer running packages for now
.
Is there a way to disable a job step and then enable it again when I am
ready. Deleting the step and recreating it again is one option, but there
must be a better way
ThanksTake a look at
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/e158802c-c347-4a5d-bf75-
c03e5ae56e6b.htm
"Trevor Howe" <TrevorHowe@.discussions.microsoft.com> wrote in message
news:13A6603B-003D-4BD8-805F-F37C8AC23A6F@.microsoft.com...
> Hi
> I have a job setup in SQL Server Agent (SQL 2005) that runs multiple
> packages. Each package is run as a separate step in the job. I am busy
> testing the job and want to skip some of the longer running packages for
> now.
> Is there a way to disable a job step and then enable it again when I am
> ready. Deleting the step and recreating it again is one option, but there
> must be a better way
> Thanks|||Trevor Howe wrote:
> Hi
> I have a job setup in SQL Server Agent (SQL 2005) that runs multiple
> packages. Each package is run as a separate step in the job. I am busy
> testing the job and want to skip some of the longer running packages for n
ow.
> Is there a way to disable a job step and then enable it again when I am
> ready. Deleting the step and recreating it again is one option, but there
> must be a better way
> Thanks
On each job step you have to option to decide what to do on "Success"
and on "Failure". Here you can choose to go to certain step in the job
on e.g. "Success".
Regards
Steen Schlüter Persson
Database Administrator / System Administrator|||Thanks guys. That was fast!! I also found the solution about five minutes
after I sent out the original post. Would'nt it be nice if all responses wer
e
as successful and quick as this one. Now for my next mind bender: What is th
e
first name of the founder of Microsoft - :0) - Jokes
""Steen Schlüter Persson (DK)"" wrote:

> Trevor Howe wrote:
> On each job step you have to option to decide what to do on "Success"
> and on "Failure". Here you can choose to go to certain step in the job
> on e.g. "Success".
> --
> Regards
> Steen Schlüter Persson
> Database Administrator / System Administrator
>