Showing posts with label local. Show all posts
Showing posts with label local. Show all posts

Friday, March 30, 2012

How can i connect to sql sever 2005 express from the command prompt.

Iam trying to connect to local copy of sql sever express from the command prompt with this command(sqlcmd) but i get the error below. What should i do to overcome the error. Basically what i want to do is to try out some commandline backup utilities and i deadly want to know how to do a backup from the command prompt. Help is greatly appreciated.

HResult 0x2, level 16, state 1

Named pipes provider: could not open a connection to sql sever [2]

sqlcmd: Error: Microsft sql native client: An error has occurred while estarblishing a connection to the sever. When connecting to sql sever 2005, this failure may be caused by the fact that under the default settings SQL sever does not allow remote connections..

Sqlcmd: Error: Microsoft sql native client: Login time out expired.

Assuming you have the server name correct I would check in the control panel --> administrative tools --> Services and make sure that sql express is running|||I got it right. Looks like it was a typing mistake. But i have one question here, backingup a database from the command prompt to me looks tiresome. What is likely to go wrong if i just copied my projects folder from the production sever to a nother machine where i want the backup to be insteady of going through all these good but confusing steps. I i just copied the folder to a nother location or computer, are the end results not the same with if i had follwed all these database backup procedures. Dont laugh at me, iam still new to this stuff.|||

Hi,

This might be caused since SQL Server 2005 does not allow remote connection under default configuration. Please enable this according to the following KB article.

http://support.microsoft.com/kb/914277/en-us

HTH. If this does not answer your question, please feel free to mark the post as Not Answered and reply. Thank you!

Monday, March 26, 2012

How can I change a local connectionstring??

Hi,
this is my connectionstring:
mySqlConnection.ConnectionString = "Data
Source=. \SQLEXPRESS;AttachDbFilename='C:\Documen
ts and Settings\me\Mis
documentos\Visual Studio
2005\Projects\Conferencia\Conferencia\db
Conferencia.mdf';Integrated
Security=True;User Instance=True;"
and the problems comes when I publish the project, because it is not
possible to access to the database which path is in my local computer.
how can I change 'C:\Documents and Settings\me\Mis documentos\Visual
Studio 2005\Projects\Conferencia\Conferencia\db
Conferencia.mdf' for
something like .\dbConferencia.mdf?
I've tried a few different ways, but i didn't get it
Thanks
davidTry putting the mdf in a App_Dat folder in your project/site
and change the connection string from C:Documnet ...
to App_Data\dbConferencia.mdf'
--
Paul Zanbaka
www.mycodekb.com
"dsoto@.plus-supermercados.es" wrote:

> Hi,
> this is my connectionstring:
> mySqlConnection.ConnectionString = "Data
> Source=. \SQLEXPRESS;AttachDbFilename='C:\Documen
ts and Settings\me\Mis
> documentos\Visual Studio
> 2005\Projects\Conferencia\Conferencia\db
Conferencia.mdf';Integrated
> Security=True;User Instance=True;"
> and the problems comes when I publish the project, because it is not
> possible to access to the database which path is in my local computer.
> how can I change 'C:\Documents and Settings\me\Mis documentos\Visual
> Studio 2005\Projects\Conferencia\Conferencia\db
Conferencia.mdf' for
> something like .\dbConferencia.mdf?
> I've tried a few different ways, but i didn't get it
> Thanks
> david
>

How can I change a local connectionstring??

Hi,
this is my connectionstring:
mySqlConnection.ConnectionString = "Data
Source=.\SQLEXPRESS;AttachDbFilename='C:\Documents and Settings\me\Mis
documentos\Visual Studio
2005\Projects\Conferencia\Conferencia\dbConferenci a.mdf';Integrated
Security=True;User Instance=True;"
and the problems comes when I publish the project, because it is not
possible to access to the database which path is in my local computer.
how can I change 'C:\Documents and Settings\me\Mis documentos\Visual
Studio 2005\Projects\Conferencia\Conferencia\dbConferenci a.mdf' for
something like .\dbConferencia.mdf?
I've tried a few different ways, but i didn't get it
Thanks
david
Try putting the mdf in a App_Dat folder in your project/site
and change the connection string from C:Documnet ...
to App_Data\dbConferencia.mdf'
Paul Zanbaka
www.mycodekb.com
"dsoto@.plus-supermercados.es" wrote:

> Hi,
> this is my connectionstring:
> mySqlConnection.ConnectionString = "Data
> Source=.\SQLEXPRESS;AttachDbFilename='C:\Documents and Settings\me\Mis
> documentos\Visual Studio
> 2005\Projects\Conferencia\Conferencia\dbConferenci a.mdf';Integrated
> Security=True;User Instance=True;"
> and the problems comes when I publish the project, because it is not
> possible to access to the database which path is in my local computer.
> how can I change 'C:\Documents and Settings\me\Mis documentos\Visual
> Studio 2005\Projects\Conferencia\Conferencia\dbConferenci a.mdf' for
> something like .\dbConferencia.mdf?
> I've tried a few different ways, but i didn't get it
> Thanks
> david
>

How can I change a local connectionstring??

Hi,
this is my connectionstring:
mySqlConnection.ConnectionString = "Data
Source=.\SQLEXPRESS;AttachDbFilename='C:\Documents and Settings\me\Mis
documentos\Visual Studio
2005\Projects\Conferencia\Conferencia\dbConferencia.mdf';Integrated
Security=True;User Instance=True;"
and the problems comes when I publish the project, because it is not
possible to access to the database which path is in my local computer.
how can I change 'C:\Documents and Settings\me\Mis documentos\Visual
Studio 2005\Projects\Conferencia\Conferencia\dbConferencia.mdf' for
something like .\dbConferencia.mdf?
I've tried a few different ways, but i didn't get it :(
Thanks
davidTry putting the mdf in a App_Dat folder in your project/site
and change the connection string from C:Documnet ...
to App_Data\dbConferencia.mdf'
--
Paul Zanbaka
www.mycodekb.com
"dsoto@.plus-supermercados.es" wrote:
> Hi,
> this is my connectionstring:
> mySqlConnection.ConnectionString = "Data
> Source=.\SQLEXPRESS;AttachDbFilename='C:\Documents and Settings\me\Mis
> documentos\Visual Studio
> 2005\Projects\Conferencia\Conferencia\dbConferencia.mdf';Integrated
> Security=True;User Instance=True;"
> and the problems comes when I publish the project, because it is not
> possible to access to the database which path is in my local computer.
> how can I change 'C:\Documents and Settings\me\Mis documentos\Visual
> Studio 2005\Projects\Conferencia\Conferencia\dbConferencia.mdf' for
> something like .\dbConferencia.mdf?
> I've tried a few different ways, but i didn't get it :(
> Thanks
> david
>

Wednesday, March 21, 2012

How can I attach database files from outside the local server?

Hi,all here,

I got a problem that I can only attach database files created on my local server, while database files from outside the local server cant be attached. So what is the problem then?

Thanks a lot in advance for any guidance and help.

Which error do you get ?

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de
|||

Hi, Jens, the error I always got is as below:

could not find row in sysindexes for database ID 21, object ID 1, index ID 1, Run DBCC CHECKTABLE on sysindexes.

Thanks a lot.

|||Any help? Thank a lot.|||

it happened to me that I was not able to re-attach database when logged in to the server under login B, different from login A used to detach the database. Login A also happened to be a dbo for this database.

try this:

1) re-attach the files to their original server,

2) create a new login that log in using SQL authentication,

3) set this login a dbo for the database you are transferring

4) on the new PC, create the same login (with the same pwd), assign it a sysadmin role, and log into the server with this login

5) try again attaching the file(s).

|||Hi, Lolik, thanks a lot.

How can I access SQL Server Compact Edition with SQL Server Management Studio Express?

Hello,

I just installed SQL Server Compact Edition, since I am considering using it instead of SQL Server Express for a local database in my application. The documentation mentioned that I could use SQL Server Management Studio Express to connect to the Compact Edition and create and manipulate databases.

To try to connect, I run Management Studio and bring up the "Connect to Server" dialog. Unfortunately, the pull-down list of "Server name"s does not include the SQL Server Compact Edition server. I do not know how to type in the server name manually, so I cannot connect.

To install Compact Edition, I downloaded it and ran "SQLServerCE31-EN.msi". This installed, and I assume registered, a number of DLLs in "C:\Program Files\Microsoft SQL Server Compact Edition\v3.1\".

Is there perhaps an additional step that I left out to complete the installation?

Might I need an upgrade to some other components? My Management Studio Version is:

- Microsoft SQL Server Management Studio Express 9.00.2047.00

I would appreciate any help you can provide.

Thank you,

WTW

The support for SQL Server 2005 Compact Edition was added in Microsoft SQL Server Management Studio Express (SSMSE). SSMSE is available for download at:

http://www.microsoft.com/downloads/details.aspx?FamilyId=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&displaylang=en

SSMSE shipped with SQL Server 2005 SP2. SQL Server 2005 SP2 information is at

http://technet.microsoft.com/en-us/sqlserver/bb426877.aspx#3

Regards

Ambrish

|||

WTW,

I've written a blog post about this, you can see it at http://arcanecode.wordpress.com/2007/04/11/create-a-sql-server-compact-edition-database-using-sql-server-2005-management-studio/ . I've also written an article that describes all the components you'll want to install to make everything work right, http://arcanecode.wordpress.com/2007/04/24/sql-server-2005-compact-edition-important-component/ .

You might also want to check the Arcane Lessons page for more SSCE tutorials.

Arcane

|||

Thanks for your reply. I uninstalled SSMSE and downloaded and installed it again. However, I still cannot access a SQL Server 2005 Compact Edition database.

When I bring up the "Connect to Server" dialog, the "Server Type" is fixed at "Database Engine", and I cannot determine how to change it. I've tried most of the menus and buttons, and I cannot find a setting for this.

I am missing some other component or configuration option?

Thanks for your help.

WTW

|||

Thanks for your very helpful reply. Thanks to your blog, I now have all of the proper components installed to make Compact Edition work properly. Your blog was the only place where I have found a complete list of all of the necessary components.

I have even purchased the E-book that you recommended, and it is very helpful.

However, I still am not able to access a Compact Edition database through SQL Server Management Studio Express. When I bring up the "Connect to Server" dialog, the "Server Type" is fixed at "Database Engine", and I cannot determine how to change it to Compact Edition or something similar.

The E-book demonstrates how to access a Compact Edition database through Management Studio. However, it shows a "Connect" menu in Management Studio that does not exist on my version. According to the E-book screen shots, the "Connect" menu should allow you to select "SQL Server Mobile", which will then bring up a "Connect to Server" dialog that shows a "Server Type" of "SQL Server Mobile". The next line allows selection of a "Database file" instead of a "Server name".

My version of Management Studio does not have the "Connect" menu. I even tried reinstalling Management Studio from the Microsoft website. However, I discovered that I already had the latest version, 9.00.2047.00.

I would appreciate any additional help you can provide.

Regards,

WTW

|||In typical microsoft style, the documentation is horrible on this. I was only able to get it to work by installing SP2 of SSMSE (of which there is no mention on the regular SSMSE download page) at:

http://www.microsoft.com/downloads/details.aspx?familyid=6053C6F8-82C8-479C-B25B-9ACA13141C9E&displaylang=en

and the SQL CE SDK found at:

http://www.microsoft.com/downloads/details.aspx?familyid=E9AA3F8D-363D-49F3-AE89-64E1D149E09B&displaylang=en

You will know you have SP2 of SSMSE installed if you version is 9.00.3042.00
|||

SP2 did the trick. Thank you so much.

Regards,

WTW

Friday, March 9, 2012

How allow normal users using profiler

Hi guys,
Is there any way to allow a local users using Profiler without SQL System
Administrator Server Roles?
If yes, how can I do it?
Many Thanks
Francesco
In 2005: yes (GRANT ALTER TRACE).
In 2000: no.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"RizFra" <RizFra@.discussions.microsoft.com> wrote in message
news:F651A849-72B2-456C-9876-7D5929142D1A@.microsoft.com...
> Hi guys,
> Is there any way to allow a local users using Profiler without SQL System
> Administrator Server Roles?
> If yes, how can I do it?
> Many Thanks
> Francesco
|||Thanks Tibor!
"Tibor Karaszi" wrote:

> In 2005: yes (GRANT ALTER TRACE).
> In 2000: no.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "RizFra" <RizFra@.discussions.microsoft.com> wrote in message
> news:F651A849-72B2-456C-9876-7D5929142D1A@.microsoft.com...
>
|||This is a way to run Profiler w/o direct SA privileges.
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=47384
- ray

How allow normal users using profiler

Hi guys,
Is there any way to allow a local users using Profiler without SQL System
Administrator Server Roles?
If yes, how can I do it?
Many Thanks
FrancescoIn 2005: yes (GRANT ALTER TRACE).
In 2000: no.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"RizFra" <RizFra@.discussions.microsoft.com> wrote in message
news:F651A849-72B2-456C-9876-7D5929142D1A@.microsoft.com...
> Hi guys,
> Is there any way to allow a local users using Profiler without SQL System
> Administrator Server Roles?
> If yes, how can I do it?
> Many Thanks
> Francesco|||Thanks Tibor!
"Tibor Karaszi" wrote:

> In 2005: yes (GRANT ALTER TRACE).
> In 2000: no.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "RizFra" <RizFra@.discussions.microsoft.com> wrote in message
> news:F651A849-72B2-456C-9876-7D5929142D1A@.microsoft.com...
>|||This is a way to run Profiler w/o direct SA privileges.
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=47384
- ray|||Thanks Ray
"raybouk" wrote:

> This is a way to run Profiler w/o direct SA privileges.
> http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=47384
> - ray
>

How allow normal users using profiler

Hi guys,
Is there any way to allow a local users using Profiler without SQL System
Administrator Server Roles?
If yes, how can I do it?
Many Thanks
FrancescoIn 2005: yes (GRANT ALTER TRACE).
In 2000: no.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"RizFra" <RizFra@.discussions.microsoft.com> wrote in message
news:F651A849-72B2-456C-9876-7D5929142D1A@.microsoft.com...
> Hi guys,
> Is there any way to allow a local users using Profiler without SQL System
> Administrator Server Roles?
> If yes, how can I do it?
> Many Thanks
> Francesco|||Thanks Tibor!
"Tibor Karaszi" wrote:
> In 2005: yes (GRANT ALTER TRACE).
> In 2000: no.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "RizFra" <RizFra@.discussions.microsoft.com> wrote in message
> news:F651A849-72B2-456C-9876-7D5929142D1A@.microsoft.com...
> > Hi guys,
> > Is there any way to allow a local users using Profiler without SQL System
> > Administrator Server Roles?
> > If yes, how can I do it?
> >
> > Many Thanks
> > Francesco
>|||This is a way to run Profiler w/o direct SA privileges.
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=47384
- ray|||Thanks Ray
"raybouk" wrote:
> This is a way to run Profiler w/o direct SA privileges.
> http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=47384
> - ray
>

How access SqlServer from the Web

Hello:
I apologize my question involves some Web contents, but I don`t know where
expose it.
I have a local Sql Server database running under W2000 server. This machine
have permanent Internet access . Can I connect a Visual Basic program running
in a remote PC machine to the Sql Server Database, directly through the Web ?
I would appreciate any suggestion or reference to technical article.
My best regards.
Roberto
Yes, you can do that.
My recommendation is to use a VPN to the SQL Server rather than directly (if
possible) and lock down the IP address of the client machine on the server
firewall.
Alternatively you can open up the port that SQL Server listens on (incoming)
to the SQL Server machine and open all (outgoing) from the SQL Server
machine. I'd set SQL Server to use a different port other than the default
1433, say 2025 or something (on the server use the Netowkr Configuration
Utility in the SQL program group) - you can get the client to use that port
using the client config utility on the client.
Hope that helps.
Last but not least, get it on SQL Sp4.
Tony Rogerson
SQL Server MVP
http://sqlserverfaq.com - free video tutorials
"Roberto Carabajal" <RobertoCarabajal@.discussions.microsoft.com> wrote in
message news:849989E8-B257-4E25-9A2F-2E86CA164C67@.microsoft.com...
> Hello:
> I apologize my question involves some Web contents, but I don`t know
> where
> expose it.
> I have a local Sql Server database running under W2000 server. This
> machine
> have permanent Internet access . Can I connect a Visual Basic program
> running
> in a remote PC machine to the Sql Server Database, directly through the
> Web ?
> I would appreciate any suggestion or reference to technical article.
> My best regards.
> Roberto
|||Tony:
Thanks very much.
Roberto

Wednesday, March 7, 2012

How access SqlServer from the Web

Hello:
I apologize my question involves some Web contents, but I don`t know where
expose it.
I have a local Sql Server database running under W2000 server. This machine
have permanent Internet access . Can I connect a Visual Basic program runnin
g
in a remote PC machine to the Sql Server Database, directly through the Web
?
I would appreciate any suggestion or reference to technical article.
My best regards.
RobertoYes, you can do that.
My recommendation is to use a VPN to the SQL Server rather than directly (if
possible) and lock down the IP address of the client machine on the server
firewall.
Alternatively you can open up the port that SQL Server listens on (incoming)
to the SQL Server machine and open all (outgoing) from the SQL Server
machine. I'd set SQL Server to use a different port other than the default
1433, say 2025 or something (on the server use the Netowkr Configuration
Utility in the SQL program group) - you can get the client to use that port
using the client config utility on the client.
Hope that helps.
Last but not least, get it on SQL Sp4.
Tony Rogerson
SQL Server MVP
http://sqlserverfaq.com - free video tutorials
"Roberto Carabajal" <RobertoCarabajal@.discussions.microsoft.com> wrote in
message news:849989E8-B257-4E25-9A2F-2E86CA164C67@.microsoft.com...
> Hello:
> I apologize my question involves some Web contents, but I don`t know
> where
> expose it.
> I have a local Sql Server database running under W2000 server. This
> machine
> have permanent Internet access . Can I connect a Visual Basic program
> running
> in a remote PC machine to the Sql Server Database, directly through the
> Web ?
> I would appreciate any suggestion or reference to technical article.
> My best regards.
> Roberto|||Tony:
Thanks very much.
Roberto

How access SqlServer from the Web

Hello:
I apologize my question involves some Web contents, but I don`t know where
expose it.
I have a local Sql Server database running under W2000 server. This machine
have permanent Internet access . Can I connect a Visual Basic program running
in a remote PC machine to the Sql Server Database, directly through the Web ?
I would appreciate any suggestion or reference to technical article.
My best regards.
RobertoYes, you can do that.
My recommendation is to use a VPN to the SQL Server rather than directly (if
possible) and lock down the IP address of the client machine on the server
firewall.
Alternatively you can open up the port that SQL Server listens on (incoming)
to the SQL Server machine and open all (outgoing) from the SQL Server
machine. I'd set SQL Server to use a different port other than the default
1433, say 2025 or something (on the server use the Netowkr Configuration
Utility in the SQL program group) - you can get the client to use that port
using the client config utility on the client.
Hope that helps.
Last but not least, get it on SQL Sp4.
--
Tony Rogerson
SQL Server MVP
http://sqlserverfaq.com - free video tutorials
"Roberto Carabajal" <RobertoCarabajal@.discussions.microsoft.com> wrote in
message news:849989E8-B257-4E25-9A2F-2E86CA164C67@.microsoft.com...
> Hello:
> I apologize my question involves some Web contents, but I don`t know
> where
> expose it.
> I have a local Sql Server database running under W2000 server. This
> machine
> have permanent Internet access . Can I connect a Visual Basic program
> running
> in a remote PC machine to the Sql Server Database, directly through the
> Web ?
> I would appreciate any suggestion or reference to technical article.
> My best regards.
> Roberto|||Tony:
Thanks very much.
Roberto