Showing posts with label management. Show all posts
Showing posts with label management. Show all posts

Friday, March 30, 2012

How to rename a column or table on the desktop?

I am using the compact edition on a desktop using VS2005 as well as SQL Server Management Studio. None of those tools allow me to rename a column or rename a table. Can someone point me a tool the runs on the desktop (as opposed to running on a CE device) that allows me to do the renaming?

Thanks

A 3rd party tool from this company may be able to help you, please contact the company (I am not affiliated): http://www.primeworks-mobile.com/

|||

I have published an article on this subject that you can adapt to the desktop:

Renaming a SQL CE Table From a .NET CF Application

Although some of my products do that (I am affiliated to that company ), you don't have to purchase one just to rename a table or column name. The code I published on that article can be easily adapted to the desktop. If you have problems with it, just let me know.

|||Great tool! Instead of copying, MS should just buy your tool.

Wednesday, March 28, 2012

How to remove Duplicated data in SQL Table?

Hi

I want to know, how to remove duplicated data in Sql Table using a SQL query? Im using SQL Management Studio Express Edition to connect to database.

Your help will be highly appreciated.

See this thread: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1425992&SiteID=1

Or these articles:


Duplicates –Delete
http://www.sql-server-performance.com/rd_delete_duplicates.asp


Duplicates –Find
http://www.aspfaq.com/2431


Duplicates –
How do I remove duplicates from a table?
http://databases.aspfaq.com/database/how-do-i-remove-duplicates-from-a-table.html


Duplicates –
How to remove duplicate rows from a table in SQL Server
http://support.microsoft.com/?id=139444

Monday, March 26, 2012

how to remote connection to an SQL server on the same network?

hi
i added 2 databases to my SQL server on a machine next door using Microsoft SQL server management studio express... I made sure that the server allows remote connection

then from this computer i pass a connection string to my SQLCLient in VB2005 that looks a bit like this

Code: ( text )

  1. ConnString = "Server=USER-PTDH8Z5ESH\SQLEXPRESS;Database=FSS.MDB;Trusted_Con nection=True;User Instance=True"

for which it gives me this error when i open the connection
SQLConnecton.Open()

System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
at System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.Att emptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.Log inNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
at System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at Flying_School_Scheduler.DBEngine.StartConnection() in

whats the big idea?
i'm in a bit of a tight schedule here... can anyone help me here? ?

First, let me express my aplogies for not getting to your question sooner. It would be not too trite to say that since most of us that take our time to respond to questions such as yours, are volunteers, and we are often also on a tight schedule. Simple, straightforward requests for assistance are looked at and perhaps even responded to far sooner than demanding, whining ones...

As to the 'big deal' with your connection string: There are a couple of possibilites:

Often using 'prohibited' characters in a server name requires extra handling, such as enclosing the name in square brackets. You might try:
Server=[USER-PTDH8Z5ESH\SQLEXPRESS]; Is the database itself named FSS.MDB, or could that, by mistake, be the database file name?|||

Normally, error 26 is caused by a few common problems that are easily fixed. Please take a look at this posting as it should probably fix your problem: http://blogs.msdn.com/sql_protocols/archive/2007/05/13/sql-network-interfaces-error-26-error-locating-server-instance-specified.aspx

Thanks,

Il-Sung.

Friday, March 23, 2012

How to register SQLExpress 2005 from SQL Server Management Studio?


I noticed SQL2005 XE installation does not come with SQL Server
Management Studio. If I install SQL2005 XE on a machine, how can I
connect to it thru SQL Server Management Studio from my workstation?
In sql2k, you can register a SQL MSDE thru EM, is there a change to
this in sql2k5? I went thru the readme file for sql2005 xe but there's
no mention of this topic.
I do not want to use SSMSE mentioned in this article to manage the
sql2005 xe, I want to use the regular SQL Server Management Studio to
manage it.
<http://support.microsoft.com/kb/907716>
Thank you"=== Steve L ===" <steve.lin@.powells.com> wrote in message
news:1132274300.199134.140290@.g44g2000cwa.googlegroups.com...
>
> I noticed SQL2005 XE installation does not come with SQL Server
> Management Studio. If I install SQL2005 XE on a machine, how can I
> connect to it thru SQL Server Management Studio from my workstation?
> In sql2k, you can register a SQL MSDE thru EM, is there a change to
> this in sql2k5? I went thru the readme file for sql2005 xe but there's
> no mention of this topic.
> I do not want to use SSMSE mentioned in this article to manage the
> sql2005 xe, I want to use the regular SQL Server Management Studio to
> manage it.
> <http://support.microsoft.com/kb/907716>
>
Register it just like any named instance. However by default TCP/IP, Named
Pipes and the Browser service are disabled in Express Edition installs.
Enable them to connect to the named instance from a remote machine.
David|||hmm...that's what i thought. however i was unable to register the XE.
(i understand TCP/IP was disabled by default).
can the machine have hyphen in it? such as 'my-test-machine'?

How to register remote server? Authentication method is grayed out!

In SQL Server management Studio. I was trying to add remote server, so it would show up in registered servers. The authentication method is grayed out!

The only option to connect to the server is by clicking connect button. It remebers the old settings. It also shows me all server databases, even I have selected my database in options...

Can you please describe exact steps that you are following. Also please make sure that the server type is 'Database Engine'.|||

I think the reason is that I have SQl Server Express installed, but SQL Server 2005 interface. Do you know how to upgrade it to full version? I have DVD, but got some errors while running setup again "Can not read from device...". Thanks

|||

You may have a problem with your DVD disk or device. You may want to check with product support to resolve this issue.

Note this should just work, you should not need to install another version.

|||SQL Server Management Studio supports connecting to SQL Express. Are you trying to connect from the same machine or from a remote box? DO you experience this problem for this instance only?|||Same machine, I have realased I did not upgrade the original 2000 version! It asks me about service packs, however I have XP SP 2 already installed...|||

Could you send a screen shot of the authentication dialog to my email address when it is in the state that you descibe?

Also, please provide step by step explanation how it gets into this state (please also send this as a reply to this posting). Example:

1. Start SQL Server Mananagement Studio

2. Right click Database Engine in the Registered Servers dialog

etc. -- you get the picture...

Note that you have to remove the 'online' part from my email address.

How to register remote server? Authentication method is grayed out!

In SQL Server management Studio. I was trying to add remote server, so it would show up in registered servers. The authentication method is grayed out!

The only option to connect to the server is by clicking connect button. It remebers the old settings. It also shows me all server databases, even I have selected my database in options...

Can you please describe exact steps that you are following. Also please make sure that the server type is 'Database Engine'.|||

I think the reason is that I have SQl Server Express installed, but SQL Server 2005 interface. Do you know how to upgrade it to full version? I have DVD, but got some errors while running setup again "Can not read from device...". Thanks

|||

You may have a problem with your DVD disk or device. You may want to check with product support to resolve this issue.

Note this should just work, you should not need to install another version.

|||SQL Server Management Studio supports connecting to SQL Express. Are you trying to connect from the same machine or from a remote box? DO you experience this problem for this instance only?|||Same machine, I have realased I did not upgrade the original 2000 version! It asks me about service packs, however I have XP SP 2 already installed...|||

Could you send a screen shot of the authentication dialog to my email address when it is in the state that you descibe?

Also, please provide step by step explanation how it gets into this state (please also send this as a reply to this posting). Example:

1. Start SQL Server Mananagement Studio

2. Right click Database Engine in the Registered Servers dialog

etc. -- you get the picture...

Note that you have to remove the 'online' part from my email address.

How to register remote server? Authentication method is grayed out!

In SQL Server management Studio. I was trying to add remote server, so it would show up in registered servers. The authentication method is grayed out!

The only option to connect to the server is by clicking connect button. It remebers the old settings. It also shows me all server databases, even I have selected my database in options...

Can you please describe exact steps that you are following. Also please make sure that the server type is 'Database Engine'.|||

I think the reason is that I have SQl Server Express installed, but SQL Server 2005 interface. Do you know how to upgrade it to full version? I have DVD, but got some errors while running setup again "Can not read from device...". Thanks

|||

You may have a problem with your DVD disk or device. You may want to check with product support to resolve this issue.

Note this should just work, you should not need to install another version.

|||SQL Server Management Studio supports connecting to SQL Express. Are you trying to connect from the same machine or from a remote box? DO you experience this problem for this instance only?|||Same machine, I have realased I did not upgrade the original 2000 version! It asks me about service packs, however I have XP SP 2 already installed...|||

Could you send a screen shot of the authentication dialog to my email address when it is in the state that you descibe?

Also, please provide step by step explanation how it gets into this state (please also send this as a reply to this posting). Example:

1. Start SQL Server Mananagement Studio

2. Right click Database Engine in the Registered Servers dialog

etc. -- you get the picture...

Note that you have to remove the 'online' part from my email address.

How to register local server in sql server 2005?

How to register local server ? In management studio?
thanks very much for any help...

Hi,

You are correct - you would need to register the local default instance in SQL Management Studio.
In Management Studio goto View Menu and select "Registered Servers". You should see the Registered Servers Window. Next Right Click on the Database Engine within this window and select "New Server Registration".

In the Server Name textbox, u can type in one of the following:
1. Machine Name
2. (local)
3. IP Address of Machine

Next click Save to register the server.
Regards,
Vikram|||Hi,Vikram.
thank you...
I try follow your steps...
but
"an error has occurred while establishing a connection to the server. when connecting to sql server 2005, this failure may be caused by the fact that under the default settings sql server does not allow remote connections."
...
How to "allow remote connections"?.....Tongue TiedTongue TiedTongue Tied|||

Hi,

In order to enable remote connections you need to use the "SQL Server Surface Area" configuration tool. This is available under:Configuration Tools submenu within the SQL Server 2005 menu.

Start "SQL Server Surface Area" tool, and select the option - "Surface Area Configuration for Services and Connections."

There select the Remote Connections node within the Database Engine node. Select the radio button which says Local and Remote Connections and Apply the configuration.

Regards,
Vikram

Monday, March 19, 2012

how to recover deleted reports

I accidentally deleted few reports from reporting service management site.
how can i recover them? Thank you.Unless you have a backup you can't (of reporting services database). You
would need to redeploy these reports.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"showjohnathan" <showjohnathan@.discussions.microsoft.com> wrote in message
news:07A380C6-5AF2-430E-A04D-F4A13B5249C5@.microsoft.com...
>I accidentally deleted few reports from reporting service management site.
> how can i recover them? Thank you.|||thanks
"Bruce L-C [MVP]" wrote:
> Unless you have a backup you can't (of reporting services database). You
> would need to redeploy these reports.
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "showjohnathan" <showjohnathan@.discussions.microsoft.com> wrote in message
> news:07A380C6-5AF2-430E-A04D-F4A13B5249C5@.microsoft.com...
> >I accidentally deleted few reports from reporting service management site.
> > how can i recover them? Thank you.
>
>

Sunday, February 19, 2012

how to query against two instances of SQL Server in Query Pane

I have registered two SQL Server instances in Management Studio. I can see the tables and databases from both instances.

My problem is how to combine data from both the servers in a single query?

I tries the following

SELECT s.consortium_contact_data_request_id, s.copy_to_exchange_address_book,i.consortium_contact_data_request_id, i.copy_to_exchange_address_book

FROM sandbox.gbiv.dbo.consortium_contact_data_request s,

ivhost04.gbiv.dbo.consortium_contact_data_request i

WHERE (s.copy_to_exchange_address_book IS NOT NULL)

go

but received a message

Msg 7202, Level 11, State 2, Line 1

Could not find server 'sandbox' in sysservers. Execute sp_addlinkedserver to add the server to sysservers.'

Though SANDBOX is registered and is viewable in the Object Explorer.

Thank you,

Piyush Varma

Piyush,

Adding the server in Management Studio's registered servers is not the same thing as creating a linked server. Registered servers is a way for you to organize your servers for easy access. In addition, while Object Explorer can connect to and display multiple servers, the context for a query window is a single server. In order to query two instances (servers) in a single query you need to link the servers. Look in Books Online under Linked Server for more information on establishing a link between two servers.

Cheers,

Dan

|||Thank you, Dan. I was able to add a linked server using following statement:

USE master;
GO
EXEC sp_addlinkedserver
'sandbox',
N'SQL Server'
GO

Then I was able to query from both the servers as below:

SELECT s.consortium_contact_data_request_id, s.copy_to_exchange_address_book,i.consortium_contact_data_request_id, i.copy_to_exchange_address_book
FROM sandbox.gbiv.dbo.consortium_contact_data_request s,
ivhost04.gbiv.dbo.consortium_contact_data_request i
WHERE (s.copy_to_exchange_address_book IS NOT NULL)
go

Thank you,

Piyush