sql-server-2005

No Process Is on the Other End of the Pipe

I receive this error when I try to connect to SQL Server 2005. I have enabled TCP/IP, Named Pipes, and restarted the server but that is not working. ...

Updating a DB table excluding NULLs

I have two tables with the same columns tbl_source (ID, Title) tbl_dest (ID, Title) I want to update tbl_dest titles from the tbl_source where the ids in dest and source match. However, I don't want to update the dest title if the source title is null (or blank). I've got this: UPDATE tbl_dest SET tbl_dest.Title = ...

SQL Server 2005 Replication Debugging Suggestions

I have a replication setup it was up and running yesterday, now I can't connect to the distributor and I don't know why. The publisher is on a Domain and talks to the subscriber (not on the domain) via VPN. I can ping the publisher from the subscriber and vice-versa. I can log in to MSSQL on the publisher from the subscriber. The publi...

Best practices for using Schemas in SQL 2005?

We're planning to move a SQL 2000 database to SQL 2005, and I am familiar with the ability in 2005 to create tables or other objects under a variety of owner/schemas. We didn't really have that ability in SQL 2000, so I'm wondering what my guidelines/best practices would be for creating/managing multiple schemas. Should I create one sc...

Get result columns from a StoredProc without exec it, using Microsoft.SqlServer.Management.Smo

I want to get a list of result sets and columns that i can expect from a SP. I have been able to get at the parameters, script... but i don't know where to get at the result sets and column names. using Microsoft.SqlServer.Management.Smo; using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["mydbconn"].C...

Trying to build an SQL statement for complex search scenario

I am trying to build an SQL Statement for the following search scenario: I have trying to return all of the columns for an individual record for Table A based on the value of the status column in Table B. Each record in table A can have multiple rows in table B, making it a one to many relationship. The status column is nullable with ...

SQL Complains that Management Tools are not installed, but they are

Hi All, When I try to create a new Maintenance Plan in SQL Server, I get the following warning: The action you attempted to perform on a remote instance of SQL Server has failed because the action requires a SQL Server component that is not installed on the remote computer. To proceed, install SQL Server 2005 Management ...

All the reasons I can't access an instance of SQL 2005

I've installed an instance of SQL 2005 Express on <computername>/SQLEXPRESS. There is only once instance installed. I've allowed remote connections, turned on SQL authentication, enabled TCP/IP, Named Pipes and VIA but I still can't access the database from another computer. I keep getting: A network-related or instance-specific er...

Remove entries from Connect to Server dialog

In SSMSE 2005, once you successfully connect to a SQL Server instance, that server appears in the drop down box in the Connect To Server dialog box. Does anyone know how to remove an entry from this list? I haven't found anything in the registry or in any local files. ...

Delete a database and its service

I'm assigned the task of deleting some databases from some server. Deleting a database is easy: http://msdn.microsoft.com/en-us/library/ms177419.aspx Seems like there is one service for each database in control panel>administrative tools>services How can I remove those? ...

Authenticating a Windows Mobile 6 Device

I have an application that runs on Windows Mobile 6 Professional PDA devices. The application is installed by browsing a url from the device and downloading a cab. Users capture information in the application and this is then replicated back to a SQL 2005 server using merge replication and IIS v6. Although the user needs to log into th...

Execute table-valued function on multiple rows?

Given a table-valued function such as dbo.Split() from "T-SQL: Opposite to string concatenation - how to split string into multiple records", how do I pass multiple rows as arguments? This works: SELECT * FROM dbo.Split (',', (SELECT myColumn FROM Stuff WHERE id = 22268)) WHERE ISNULL(s,'') <> '' It returns: pn s --------...

How to use LIMIT keyword in SQL Server 2005?

I have found a way to select random rows from a table in this post. A suggestion is to use the following query: SELECT * FROM employee ORDER BY RAND() LIMIT 1 But when I run this query in MS SQL 2005, I get the following error message Msg 102, Level 15, State 1, Line 1 Incorrect syntax near 'LIMIT'. Can anyone tell me where am I wr...

J2ME communicating with MS-SQL

Hi everyone, I am trying to create an integrated project in which I can update MS-SQL's database value using J2ME's application. But I need more resources/links that let me fully understand how to go about writing implementation for this. These are the few question in which I've got in mind. How do I update the data that I've got fr...

Does index_id=0 in sys.indexes refer to the table itself?

Unfortunately the BOL is a little vague on this, but index_id = 0 on sys.indexes or sys.partitions appears to refer to the table itself where there is no clustered index on the table. True - or am I missing something? ...

Is SQL Server Management Studio as bad as it seems? How to view relatiosnip attributes????

So, I'm using SQL Server Management Studio Express,it has been working not bad so far, ignoring some of the weirdness. But I just happened to get a whole shwack of data deleted when I happened to delete a row in a parent table. So I thought I must have cascade deletes enabled in this relationship. But, how does one determine this?? ...

Problem with code syntax : Stored Procedure for Generic Insert

I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE PROCEDURE spGenericInsert ( @insValueStr nvarchar(200) @tblName nvarchar(10) ) AS BEGIN DECLARE @insQueryStr nvarchar(400) DECLARE @insPrimaryKey nvarchar(10) DECLARE @rowCountVal integer DECLARE @prefix nvarchar(...

Syntax Prob: Using Variables in Stored Procedures

Can anyone tell how correct the following code below. Iam tryin to create a stored procedure that returns the rowcount of a table whose name is passed to it. CREATE PROCEDURE spROWCOUNTER ( @tablename nvarchar(20) @rowCountVal int OUTPUT ) AS DECLARE @strQuery nvarchar(300) SET @strQuery = 'SELECT @rowCountVal=COUNT(*) FROM '...

Best way to strip html tags from a string in sql server?

I've got data in SQL Server 2005 that contains html tags and I'd like to strip all that out, leaving just the text between the tags. Ideally also replacing things like &lt; with <, etc. Is there an easy way to do this or has someone already got some sample sql code? I don't have the ability to add extended stored procs and the like, so...

Reporting service with SQL Server Express

Does SQL Server Express 2005 contains Reporting Service. If yes I installed SQL SErver express 2005 edition but i am not able to see Reporting Service. Help... Advance services, doesnt helps.. ...