Ssmse Will Not Connect To Ssexpress

Feb 18, 2006

I have installed SQL Server 2k5 Express on my local machine. I also installed SSMSE on my local machine. When I try to launch SSMSE and connect to the SSExpress I get an error indicating that SSExpress is not configured to accept remote connections. Huh? Everything is local...I'm confused and frustrated. Any help is profusely appreciated.

Thank you

Zach

View 2 Replies


ADVERTISEMENT

Can't Connect To Remote Server Using SSMSE In Vista

Feb 11, 2007

Hi,
Sorry if this is the wrong forum.
I'm trying to connect to a remote server (on shared hosting) with Management Studio Express. I tried using it on Vista and it connects to the server and database perfectly. However, on Vista it gives the following error everytime:
TITLE: Connect to Server------------------------------
Cannot connect to sgc.gbdns.net.
------------------------------ADDITIONAL INFORMATION:
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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=53&LinkId=20476
------------------------------BUTTONS:
OK------------------------------
 
 
However, the host obviously has SQL server to allow remote connections as I'm able to connect from XP.
Both the XP and Vista PCs are running Avast free edition (the same builds) and both are running Windows firewall with management studio allowed through. Can anyone help?

View 6 Replies View Related

Unable To Use SSMSE To Connect To SQL Express Server On Secondary IP Address

Apr 28, 2006

I am having trouble to use SSMSE to remotely connect SQL Express server using IPs other than the base IP of the machine.

Machine settings:

(1) Has multiple IP configured. Those IP are accessible remotely

(2) Firewall is not on.



SQL Express server configuration:

(1) TCP/IP and named pipe are on



Browser service state:

(1) running

(2) listening at 0.0.0.0:1434 (UDP)



SSMSE connection results:

(1) with <baseIP><instance>, connects OK

(2) with <otherIP><instance>, connection failed.

Both connections use exactly the same authentication information.



Testing results using telnet:

(1) telnet <baseIP> 1434, OK

(2) telnet <otherIP> 1434, OK



Does SSMSE actually only listen on the base IP even it shows to listen on all the IPs?

View 10 Replies View Related

SQL Server Management Studio Express (SSMSE)=&&>Object Explorer=&&>Databases Has C:SSMSE-BookChapter12WINCH12NORTHWND.MDF?

Feb 27, 2008

Hi all,

In my SQL Server Management Studio Express (SSMSE)=>Object Explorer=>Databases, the "NORTHWND" database was screwed up and is deleted completely. But under the same Object Explorer =>Databases, there is a database "C:SSMSE-BookChapter12WINCH12NORTHWND.MDF". I need to use this "NORTHWND" database in the SqlConnection. How can I specify the "Initial Catalog" (or "database") in the New SqlConnection code statement (in the ADO.NET 2.0-VB 2005 Express programming)?
Should it be like the following:

Dim sqlConnection As SqlConnection = New SqlConnction("Data Source=.SQLEXPRESS; Initial Catalog=C:SSMSE-BookChapter12WINCH12NORTHWND; Integrated Security=SSPI;") ? Or what is the right code statement for connecting to it?

Please help and advise.

Thanks in advance,
Scott Chang

View 7 Replies View Related

How To Connect To SQL Server Express 2005 Database At The Same Time From Both SSMSE And VB2005 Application ?

Jan 13, 2007

Here is the situation:

I have SQL server express 2005 installed on my pc as instance SQLEXPRESS.

I have created a Visual Basic applicaion with the following as connection to the SQL server express 2005 running on the same PC:
****************************************************************************************************
Dim lconnectionString As String Dim builder As New SqlConnectionStringBuilder Dim cmd As New SqlCommand Dim reader As SqlDataReader Dim parameter As SqlParameter builder("Data Source") = ".SQLEXPRESS" builder("Initial Catalog") = "" builder("AttachDbFilename") = "C:My DocumentsVisual Studio 2005Projectsabcabcabc.mdf" builder("Integrated Security") = True builder("User Instance") = True lconnectionString = builder.ConnectionString Dim sqlConnection1 As New SqlConnection(lconnectionString) cmd.CommandText = "SP_add_collection" cmd.CommandType = CommandType.StoredProcedure cmd.Connection = sqlConnection1 sqlConnection1.Open()
*******************************************************************************************************************

It seems that i can not connect to the abc.mdf in SSMSE while the VB program is running. (ERROR:
Database 'C:My DocumentsVisual Studio 2005Projectsabcabcabc.mdf' cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details. (.Net SqlClient Data Provider) )

If i connect to the abc.mdf first in SSMSE, then run the VB program afterwards, it gives me the error on this line -- sqlConnection1.Open()

I want to be able to access the abc.mdf database with both SSMSE and VB at the same time. Could anyone help me on this ?

Thanks very much !

apple

View 4 Replies View Related

How To Use SSMSE To Connect To Instance Service Directly (without Going Through Browser Service)?

Apr 28, 2006

I have configured an instance to use static port, say 1435, and I turned off the Browser service.

I would like to know if I can use SSMSE to connect to the instance database directly. The instance is listening at port 1435 and accepting connection requests from other methods.

What I need to put into the "Server name: " field?

Normally, it would be like: <serverIP><InstanceID> with Browser turned on.

Now how do I add the port information to it, I tried

<serverIP>:<portNumber><InstanceID>

<serverIP><InstanceID>:<portNumber>

<serverIP><InstanceID> <portNumber>

None of them worked.

Any suggestions?

Thanks.

View 4 Replies View Related

Distribute Data Securely In SSExpress

Apr 20, 2006

I would like to distribute some data in SqlServer Express which only my application can read from.

My question is - is it possible to secure a database so that only a specified user would have read/write permissions. Even the sa acount should not have the permission to read or write to the database although it would retain the right to drop the database.

One option I believe is to encrypt the data but I would prefer not to incur the performance penalty associated with this.

Any insights would be appreciated.

Thanks

View 1 Replies View Related

HELP! Cannot Run SSMSE

Feb 17, 2006

Getting ready for a system deployment tomorrow and looked at the Teratrax Management tool instead of the Microsoft SQL Server Management Studio Express (SSMSE). Teratrax tool is nice (adds more features for scripting and file management) but thought we'd opt to stick with the free SSMSE for now.

Went to run SSMSE and it doesn't run. Pointer flickers once and then nothing happens. Okay, uninstalled Teratrax and tried SSMSE. No change. Uninstalled and re-installed SSMSE, followed by a reboot. No change.

Argh! Does anybody have any suggestions on what to look for to get SSMSE back in gear? It make life much easier for the green admin like myself and we need it for the interim.

Daggumit, frustrating!

Thanks in advance of any advice or input provided.




Mmmmmkay. Yeah, did you get the memo about the TPS reports?

View 1 Replies View Related

Is SSMSE Redistributable

Apr 25, 2006

Is SSMSE Redistributable?

View 1 Replies View Related

SSMSE With SQLCE

May 31, 2007

can anyone tell me how to open/create a SQL Server 2005 Compact Edition database using SQL Server Management Studio Express?

cheers

View 5 Replies View Related

Table Properties In SSMSE

Apr 18, 2008

Hello. I just started using SQL Server Management Studio Express. I am creating a new table by right-clicking the "Tables" folder and selecting "New Table". Then i hit F4 to bring up the "Properties" (because I want to associate a Schema to the table, but when the "Properties" section appears, it's blank. I can't figure out a way to get anything to appear there. Any ideas? Thanks!...

View 2 Replies View Related

SSMS And SSMSE Difference

Jan 23, 2007

What's the difference between "SQL Server Management Studio" and "SQL Server Management Studio Express"? Is there any link to explain this?

Thanks,


Canada DBA

View 4 Replies View Related

Login Failing After Using SSMSE

Jun 2, 2007

Using



SQL Server Express with advanced Services

Visual Web Developer 2005 Express

Microsoft Visual C# 2005 Express

SQL Server Management Studio Express

.NET 2

ASP.NET



Problem



After using SSMSE on an IIS ASP.NET database created with VWD this error starts.



"Cannot open user default database. Login failed.
Login failed for user 'machinenameASPNET'. "



If I never use SSMSE, I never have a problem.



I have tried every single suggestion I could find and none of them solve the problem.

Luckily, I am only in the development stages so at least I'm not loosing data.



Development Path



Create VWD Project

Create Database and Tables
Write WebService for DB access
Create C# Project

Connect to WebService
Write project code
Use SSMSE

Attach Database
Do non-admin fuctions on the database(I only opened it to get the auto-generated code for sql statements such as creating Columns so I could do it on the fly)
Detach Database - Check mark the Close Connections
Back to the C# Project

Run the code.
Cannot open user default database. Login failed.Login failed for user 'machinenameASPNET'.

What is SSMSE doing to the database that the web service can no longer log into it?



From VWD you can still connect from the Database Tab.



I finally got so fustrated I just got the SQL Code to create the tables and made a function to create them

after I delete and recreate the database.





View 6 Replies View Related

Importing To SQL Express Using SSMSE

Apr 10, 2007

When I used Enterprise Manager it was very easy to import required tables from another server into my local MSDE server.



Now I am using SQL Express and SSMSE I cannot seem to find any other way of importing data other than creating the insert scripts manually which is a very painful and tediuos operation!



Can anyone advise if I have missed something and there is a way to import easily using SSMSE?



Thanks.......in hope

View 6 Replies View Related

SSMSE - Xp Good, Vista Bad :(

Feb 9, 2007

I've got a database on a shared server at www.dhosting.com

When I fire up management studio express providing the necessary info and hit connect, I get a nice error saying sql server is not able to accept remote connections by default. I ask dhosting support for a few hours. Chris gets back to me every 10 minutes or so. We then finally notice I'm running Vista. I go to my friend's xp. Fire up SSMSE and provide the exact same info and viola, works perfectly.



The xp and Vista machines both are running avast free edition and window firewall. In Vista, I've tried disabling windows firewall, nothing helps. XP handles it perfectly without any problems.



Any ideas?

View 1 Replies View Related

MSDE ,SSMSE Connection

May 10, 2006

hi friends,

I'll be thankful if anyone solve this problem.

When i developed my application, i used sql 2000 as a server side DB.
Now my client want to install MSDE instead of SQL 2000.

so i uninstall SQL2000 and installed MSDE .

AS we all know, MSDE doesn't have GUI. So i installed Microsoft SQL Server Management Studio Express - Community Technology Preview (CTP)
(includeing xmlparser,windows installer,.net 2.0).

now i could able to view tables and everything. but i couldn't make the connection. Getting error like "SQL server not found. CMPNAMEMSDERELA"
I used same kind of connection string for SQL 2000. Worked well.here what happened?

Connection String : "Data Source = CMPNAMEMSDERELA;Database =TEST; User id ="xxx; Password =xxxx;"

OS: Windows server 2003.
i used VB.NET to develop the apps. (VS2003). Connecting from Pocket PC.

kindly help me to solve this problem.

(Already i posted this in SQL tools forum. i hope this is the right place to post this question. so posting again.)

Thank u!


View 4 Replies View Related

SSMSE On Multiple Clients

Aug 6, 2007

Hi all,

I've been running SQL Server 2005 for over three months, and have got the database up to speed. Using SSMSE for an interface.

I've have been trying to get the Intranet to link to the database (ASP), but after a little research i found we needed to change the Authentication from 'Windows Authentication' to a mix of windows auth and sql login. Needing to restart the server for the changes to take effect.

After the restart things started to go pear shaped.

Before the restart we were able to run queries from different clients at the same time (4 workstations). Now we are unable to access anything on the database if a query is running on a seperate client. As in table properties, running a query. As i've said, we were able to do this perfectly fine before the restart.


We also use other programs to generate records for the database. These programs now have difficulty connecting to the database. We've gone through the wizards and as far as we are aware things should be working. We have created extra username/logins for these programs so not one computer/client/program uses the same connection login. However, they are unable to connect even after the wizard says there is no problem connecting to the server.

Is there any *restore to factory/default settings* button? We've even tried reverting to Windows Authentication to try and solve the problem, but it didn't work, we're pretty dependant on the database for day to day operations.


Anyone with an idea as to what's wrong?

Thanks in advance

Gary.

View 3 Replies View Related

Help Connecting To Remote Server With SSMSE

May 2, 2008

Hey guys, I am new to the SQL server scene and I am having some trouble connecting to a remote SQL Server with SQL Server Management Studio Express. I have the username, password, IP address, and port necessary to log in but am apparently not plugging them into the correct places. Can anyone at all point me in the right direction or somewhere that I might at least find the answer? I appreciate any help that can be provided.

Thanks a bunch,

Gary

View 4 Replies View Related

Difficulty Adding A Record In SSMSE

Aug 21, 2006

I'm new to SQL Server and I'm using 2005 Express with SSMSE, and having trouble adding a record to a table "manually" by typing in the data.

I find I can change most of the fields by viewing the table in SSMSE and just clicking on the field and editing it then clicking "execute SQL" but for some reason the changes don't "take" when a date field is involved.

Is there a special or proper way to enter a date that I'm not aware of? I'm not having much success figuring out this online help stuff from within SSMSE, I keep getting to help on the help system itself (oops).

TIA!

View 3 Replies View Related

Remote Server Access Via SSMSE

Nov 24, 2007



In order to fix a web application bug the developer told me to to edit a stored procedure on my hosted SQL 2005 server. The hosting company's support say I should be able to do this using SQL Server Management Studio Express. I installed SSMSE, but it seems to want to only want to connect to a local server. Can I use this utility for remote DB management, or is there something else I need instead?

Thanks for your help.

-Michael

View 6 Replies View Related

Framework 1.1 Update + Ssmse: Get Warning!?

Aug 19, 2006

Hello, friends,
here is my problem:
I installed sql server express on a naked Windows xp pro with SP2; of course, framework 2.0 installed, and MS-installer 3.1 installed as well. I also installed ssmse. Everything worked fine.
Then I installed all windows updates via Windows Update in internet.
Now suddenly, when starting ssmse, I get a Warning Textbox with Header "Microsoft SQL Server Management Studio Express", then the yellow triangle with the exklamation mark, but NO TEXT AT ALL, and the OK-button. So unfortunately, I do not know what to do. Only thing I found out was, that in all updates, the culprit surely is framework 1.1 update. Before installing this, everything worked fine, afterwards, well, see above.
When I click the ok-button, everything works fine, I can log in into sql server express and do what I have to do.
So my only solution at the moment is just to ignore the warning - not the best way.
Couldn't find a better solution until now.
Could anybody help?

Kind regards from
Axolotl, Mellendorf, Germany

View 4 Replies View Related

SQL Server SP And SSMSE Intelli Sense

Apr 5, 2008

How can I know my sql server 2005 express service pack? The same goes for SSMSE. I can't find these information in the about box.

What about intelli sense for queries in SSMSE? Is it there yet or should I wait for sql server 2008 for dev. (http://channel9.msdn.com/Showpost.aspx?postid=387069)? I haven't seen the video but does anyone know any details? When it will be available, is it part of the sql server 2008 CTP, will it be available in the Express edition?


Thanks in advance,
Shehab.

View 1 Replies View Related

Scripting User Creation In SSMSE

May 4, 2007

Hi,

Strange question here. When I script a user to be created for a database deployment, I get the following script:

USE [DatabaseX]

GO

IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'newuser')

CREATE USER [newuser] WITHOUT LOGIN WITH DEFAULT_SCHEMA=[dbo]

Now, this creates the user at the 'DatabaseX' db level, but not at the 'master' db level. The user "newuser" is then not allowed access to do anything in 'DatabaseX', such as execute queries, update tables, etc.



I had to modify our script to be like this:

USE [master]

GO

CREATE LOGIN [newuser]

WITH PASSWORD=N'somepassword',

DEFAULT_DATABASE=[DatabaseX]

GO

USE [DatabaseX]

GO

CREATE USER [newuser] FOR LOGIN [newuser]

GO

USE [DatabaseX]

GO

EXEC sp_addrolemember N'db_owner', N'newuser'

GO



This allows the "newuser" to execute queries, update tables, etc. in 'DatabaseX',



Is there some option in SSMSE that I'm missing when I'm having it generate my user scripts that it's leaving the rest of the script out?



Thanks in advance for your help

View 4 Replies View Related

CSV Exporting SSMSE (Text Identifier)

Apr 6, 2007

I just updated to SQL Express SP2 per this Feedback item:

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=132806

But I don't see an option to use quoted identifiers. Is it not included in the Express version?

View 1 Replies View Related

SSMSE Hangs Deleting Multiple Records

Jun 8, 2007

Hi All

I'm new to sql server. I have built simple database apps using MFC CRecordset over MS Access. I'm tying to learn about SQL server by building a simple app using MFC CRecordset in Visual Studio 2005.



The problem I have is within SQL Server Management studio experess. I have a table called OriginalDrawings that looks like this

CREATE TABLE [dbo].[OriginalDrawings](

[DrawingID] [int] IDENTITY(1,1) NOT NULL,

[OriginalFileName] [varchar](50) COLLATE Latin1_General_CI_AS NOT NULL,

[PartNumber] [varchar](50) COLLATE Latin1_General_CI_AS NOT NULL,

[SheetNumber] [int] NULL,

[Revision] [varchar](50) COLLATE Latin1_General_CI_AS NULL,

[OriginalDirectory] [varchar](100) COLLATE Latin1_General_CI_AS NULL,

[DrawingCategory] [int] NOT NULL,

[ProductFamily] [int] NOT NULL,

[IsSalvage] [bit] NULL,

[FileSize] [int] NULL,

[DataQueryFlag] [bit] NOT NULL,

[DataQueryCode] [int] NULL,

CONSTRAINT [PK_OriginalDrawings] PRIMARY KEY CLUSTERED

(

[DrawingID] ASC

)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

) ON [PRIMARY]



I've loaded it with 40,000 records from my test app. If I open it in SSMSE hit Ctrl-A to select all and then press delete SSMSE appears to hang - it freezes for 10 mins+ (after which I restart my PC. I can delete 1000 records at a time OK, I can delete all quite quickly from my test app by walking through the recordset and deleting each record.



Does anyone know why it appears to hang when I try the delete all?



Thanks

Alec



SQL Server 2005 Express 9.00.3042.00

Microsoft SQL Server Management Studio Express 9.00.2047.00


Microsoft Data Access Components (MDAC) 2000.085.1117.00 (xpsp_sp2_rtm.040803-2158)
Microsoft MSXML 2.6 3.0 4.0 5.0 6.0
Microsoft Internet Explorer 6.0.2900.2180
Microsoft .NET Framework 2.0.50727.42
Operating System 5.1.2600

View 1 Replies View Related

Debugging Stored Procedure Inside SSMSE !!!

Dec 21, 2006

Hi for all

i just get the news that the Dec. CTP of SQL Server 2005 & tools is released !

but my dream is to see debugging stored procedure support inside the SSMSE as debugging applications inside Visual Studio 2005

Many many many thanks to Microsoft  and for the great efforts on the cool products

Mohamed 

View 3 Replies View Related

SSMSE CTP Uninstall And Visual Studio 2005

Apr 23, 2006

In the Microsoft SQL Server Management Studio Express Readme there is the following cautionary note:

When you uninstall a pre-release version of SSMSE on a computer that has Visual Studio 2005 installed, you must repair the Windows Registry before you can use the Visual Studio Dataset Designer. For more information, see Knowledge Base article 917635.

When I click on the article link, the page displays: The Knowledge Base (KB) Article you requested is currently not available.

Is there any further information on this Cautionary note?

View 5 Replies View Related

SSMSE Permissions Problem When Restoring A Backup

May 5, 2006

Hi all,

I'm experiencing a problem with SQL Server Management Studio Express.

I have a backup file (.bak file extension) of a SQL database saved in the directory c:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLackup

When I attempt to restore this file (by r/clicking on the database, selecting Tasks, Restore, Database and selecting File as the backup media), I get the message "Cannot access the specified path or file on the server. Verify that the necessary security privileges and that the path of file exists".

I have checked the ACL on the backup directory and the SQL Server 2005 local user has full control over that directory and all files within it.

Am I just being a numpty here, or is there something fundamentally wrong somewhere?

View 6 Replies View Related

SqlDataSource And SSMSE Returning Different Results For Same SELECT Command

Oct 2, 2007

Hi,
Hope you guys won't mind this rather newbie question.  I'm writing a simple blog page for my website and have created a SqlDataSource which queries the database for a list of blog post titles (from the web.Blog table) and the number of comments (from the web.BlogComments table).  The SqlDataSource control is:
<asp:SqlDataSource ID="sourceBlogArticles" ProviderName="System.Data.SqlClient" connectionString="<%$ ConnectionStrings:myDatabase %>" runat="server" SelectCommand="SELECT gb.blogID, gb.title, gb.description, gb.tags, gb.dateAdded, COUNT(gbc.blogID) AS noOfComments FROM web.Blog gb LEFT OUTER JOIN web.BlogComments gbc ON gb.blogID = gbc.blogID GROUP BY gb.blogID, gb.title, gb.description, gb.tags, gb.dateAdded ORDER BY gb.dateAdded"></asp:SqlDataSource>
This works perfectly well if each blog entry in the web.Blog table has associated comments in the web.BlogComments table.  However, if there are no comments yet defined in the web.BlogComments table for that blogID then no row is returned in ASP.Net (as checked with a GridView control or similar linked to the data source to view what I get)
 HOWEVER, I think the SELECT command IS correct: if I use the select command as a query in SQL Server Managment Studio Express, I do get the rows returned, with 0 for the number of comments which is what I would expect for that query:
blogID, title, description, tags, dateAdded, noOfComments
1, title 1, description for title 1, tag1, 2007-09-27 06:49:03.810, 32, title 2, description for title 2, tag2, 2007-09-27 06:49:37.513, 03, title 3, description for title3, tag3, 2007-10-02 18:21:30.467, 0
Can anyone help?  The result from the SSMSE query is what I want, yet when I use the very same SELECT statement in my SqlDataSource I don't get any rows returned if the BlogComment count is zero (in the above example I get only the first row).  Many thanks for any suggestions!

View 6 Replies View Related

Microsoft SQL Server Management Studio Express (SSMSE) Upgrade

Feb 28, 2008

Hi

Apologies for this question

I have just found out i/we need to upgrade to the full version of this management tool to make use of SSRS for a new CRM we are putting in place, The CRM company tells me we can just install the tool from our SQL 2005 disk.

Im wondering what the best way to go about this is? i would guess we just un-install the express version install the full version of the management tool and reconnect to the database. unless im missing anything?

thanks

View 1 Replies View Related

SQL Server 2005 Express Remote Connection Problem Via SSMSE

Apr 25, 2006

Hi,

I am having problem with remote connection via TCP/IP connection on default port 1433. TCP/IP connection are enabled on the server.

any possible solution ?

See problem below:



TITLE: Connect to Server
------------------------------

Cannot connect to ns1.iandigroupltd.com,1433.

------------------------------
ADDITIONAL INFORMATION:

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: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) (Microsoft SQL Server, Error: 10060)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=10060&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------

View 7 Replies View Related

Adding SSMSE 2005 As A Prerequisite To A Visual Studio Setup Project

Feb 26, 2007

Hi,

I'm am deploying an application that uses SQL Express and wish to also deploy SSMSE along with it.

I have the .msi but I don't know how to get the setup project to deploy this as it does SQLExpress and .Net Framework 2.0. (and I am using VS 2005 SE)

There is an MS article on creating "Custom Prerequisites" (http://msdn2.microsoft.com/en-us/library/ms165429(VS.80).aspx) which speaks to creating product and project manifests.

Has anyone does this for SSMSE? Or am I going about this in the wrong way?

Thanks in advance,

Keith

View 3 Replies View Related

Common Table Expression (CTE):How To Delete A Wrong CTE That Is In SQL Server Management Studio Express (SSMSE)?

Feb 25, 2008

Hi all,

I ran the following CTE sql code:


Use ChemDatabase

GO

WITH PivotedTestResults AS

(

SELECT TR.AnalyteName, TR.Unit,

Prim = MIN(CASE S.SampleType WHEN 'Primary' THEN TR.Result END),

Dupl = MIN(CASE S.SampleType WHEN 'Duplicate' THEN TR.Result END),

QA = MIN(CASE S.SampleType WHEN 'QA' THEN TR.Result END)

FROM TestResults TR

JOIN Samples S ON TR.SampleID = S.SampleID

GROUP BY TR.AnalyteName, TR.Unit

)

SELECT AnalyteName, UnitForConc,

avg1 = abs(Prim + Dupl) / 2,

avg2 = abs(Prim + QA) / 2,

avg3 = abs(Dupl + QA) / 2,

RPD1 = abs(Prim - Dupl) / abs(Prim + Dupl) * 2,

RPD2 = abs(Prim - QA) / abs(Prim + QA) * 2,

RPD2 = abs(Dupl - QA) / abs(Dupl + QA) * 2

FROM PivotedTestResults

GO

//////////////////////////////////////////////////////////////////////////////////////
I got the following errors:

Msg 207, Level 16, State 1, Line 9

Invalid column name 'Unit'.

Msg 207, Level 16, State 1, Line 3

Invalid column name 'Unit'.

////////////////////////////////////////////////////////////////////////////////////////////////////////////////

I guess that I had "Unit" (instead of "UnitForConc"), when I executed the sql code last time!!!???
How can I delete the old, wrong CTE that is already in the ChemDatabase of my SSMSE?

Please help and advise.

Thanks in advance,
Scott Chang

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved