Is there anyway to change the way that SSMS displays a bit field? Currently it displays it as True or False, but I much prefer 1 or 0, the way EM and QA displayed it.
I have a column of varchar(2000) but when I use it in a select statement I only get the first 255 characters displayed. (all the data is there as I can see different parts using substring) How do I get the complete column to display?
I would like for each of the queries to have all of the selected fields shown horizontally in one table.
For example, Commercial Created | Commercial Closed | Commercial UserId | Residential Created | Residential Closed | Residential UserId | Other Created | Other Closed | Other UserId.
Here is what I have now and it is displaying the fields as I would like them to. In the code below, each Views is acting as an individual table and then joined together to make another table when the query is executed.
WITH t1 AS ( SELECT vSalesReportProcessDetail.[RequestId] ,vSalesReportProcessDetail.Process ,vSalesReportProcessDetail.Entered ,vSalesReportProcessDetail.Closed /*ROW_NUMBER() over (ORDER BY vSalesReportProcessDetail.[RequestId]) rn*/ FROM[Sales].[dbo].[vSalesReportProcessDetail] WHERE Process = 'Commercial' ),
Hi All. I apologise if i have not posted this in the correct Topic before i start. But was uncertain where to post this query. This is my first project in ASP.NET, MS Visual Web Developer 2005 Express and SQL Server 2005 Express. I have relatively little experience, so please bare with me. I have the table below:- Column Name Data Type OrderID intOrderNo intInvoiceNo varchar(50)PurchaseDate smalldatetimeCost moneyInsure money I wish to have a dropdownlist on an aspx page display the OrderNo and the Cost e.g. 12345 £3.50. I have tried the SQL Statement below but that just calculates the addition of both. SELECT OrderNo + ' ' + Cost AS Expr1 FROM [Order] Do i have to convert them both to string/varchar first? If so, how? Thanks for your replies.
Select table1.id, table1.original_date, (select €¦€¦..from €¦..) as Date1, (select €¦€¦..from€¦..) as Date2 from table1
Date 1 and Date 2 are both complex subqueries that retrieve a date from other tables. I would like another column displaying the oldest date between date1 and date2. Can anyone help?
I have just started using SQL Server reporting services and am stuck with creating subreports.
I have a added a sub report to the main report. When I right click on the sub report, go to properties -> Parameters, and click on the dropdown for Parameter Value, I see all Sum and Count fields but not the data fields.
For example, In the dropdownlist for the Parameter value, I see Sum(Fields!TASK_ID.Value, "AppTest"), Count(Fields!TASK_NAME.Value, "CammpTest") but not Fields!TASK_NAME.Value, Fields!TASK_ID.Value which are the fields retrieved from the dataset assigned to the subreport.
When I manually change the parameter value to Fields!TASK_ID.Value, and try to preview the report, I get Error: Subreport could not be shown. I have no idea what the underlying issue is but am guessing that it's because the field - Fields!TASK_ID.Value is not in the dropdown but am trying to link the main report and sub report with this field.
Am I missing something here? Any help is appreciated.
How can I create a Table whose one field will be 'tableid INT IDENTITY(1,1)' and other fields will be the fields from the table "ashu". can this be possible in SQL Server without explicitly writing the"ashu" table's fields name.
Hello !I'm trying to update one table field with another table searched firstdate record.getting some problem.If anyone have experience similar thing or have any idea about it,please guide.Sample case is given below.Thanks in adv.T.S.Negi--Sample caseDROP TABLE TEST1DROP TABLE TEST2CREATE TABLE TEST1(CUST_CD VARCHAR(10),BOOKING_DATE DATETIME,BOOKPHONE_NO VARCHAR(10))CREATE TABLE TEST2(CUST_CD VARCHAR(10),ENTRY_DATE DATETIME,FIRSTPHONE_NO VARCHAR(10))DELETE FROM TEST1INSERT INTO TEST1 VALUES('C1',GETDATE()+5,'11111111')INSERT INTO TEST1 VALUES('C1',GETDATE()+10,'22222222')INSERT INTO TEST1 VALUES('C1',GETDATE()+15,'44444444')INSERT INTO TEST1 VALUES('C1',GETDATE()+16,'33333333')DELETE FROM TEST2INSERT INTO TEST2 VALUES('C1',GETDATE(),'')INSERT INTO TEST2 VALUES('C1',GETDATE()+2,'')INSERT INTO TEST2 VALUES('C1',GETDATE()+11,'')INSERT INTO TEST2 VALUES('C1',GETDATE()+12,'')--SELECT * FROM TEST1--SELECT * FROM TEST2/*Sample dataTEST1CUST_CD BOOKING_DATE BOOKPHONE_NOC12005-04-08 21:46:47.78011111111C12005-04-13 21:46:47.78022222222C12005-04-18 21:46:47.78044444444C12005-04-19 21:46:47.78033333333TEST2CUST_CD ENTRY_DATE FIRSTPHONE_NOC12005-04-03 21:46:47.800C12005-04-05 21:46:47.800C12005-04-14 21:46:47.800C12005-04-15 21:46:47.800DESIRED RESULTCUST_CD ENTRY_DATE FIRSTPHONE_NOC12005-04-03 21:46:47.80011111111C12005-04-05 21:46:47.80011111111C12005-04-14 21:46:47.80044444444C12005-04-15 21:46:47.80044444444*/
I am using MS SQL 2012. I have a table that contains all the data that I need, but I need to summarize the data and also add up decimal fields while at it. Then I need a total of those added decimal fields. My data is like this:
I have Providers, a unique ID that Providers will have multiples of, and then decimal fields. Here are my fields:
I would like to search a table for a phrase, or for a partial phrase,eg on table product - for name or description, or name + descprition.How does one say select * from product where name + description like%phrase%or contains phraseCurrently I can get where name, or where descriotion like %phrase%,eg, where name like krups, or where description like coffee makerBut if I search for where name like %krups coffee maker% i get noresults. krups is in the name field, coffee maker is in thedescription field.Thanks,-M
I used to do this with classic asp but I'm not sure how to do it with .net.Basically I would take a table of Categories, Then I would loop through those. Within each loop I would call another stored procedure to get each item in that Category. I'll try to explain, Lets say category 2 has a player Reggie Bush and a player Drew Brees, and category 5 has Michael Vick, but the other categories have no items.Just for an example.. Category Table: ID Category1 Saints2 Falcons3 Bucaneers4 Chargers5 FalconsPlayer Table:ID CategoryID Player News Player Last Updated1 1 Reggie Bush Poetry in motion 9/21/20062 1 Drew Brees What shoulder injury? 9/18/20063 5 Michael Vick Break a leg, seriously. 9/20/2006 Basically I would need to display on a page:SaintsReggie BushPoetry in MotionFalconsMichael VickBreak a leg, seriously.So that the Drew Brees update doesnt display, only the Reggie Bush one, which is the latest.I have my stored procedures put together to do this. I just don't know how to loop through and display it on a page. Right now I have two datareaders in the code behind but ideally something like this, I would think the code would go on the page itself, around the html.
Pardon me if this question is too elementary. I am trying to create a trigger that will cause certain datafields to be updated with values from other data fields in the same row when a certain column, created specifically to fire the trigger, is updated. The purpose of this is to reduce data entry by field personnel.I think I have the create trigger statement correct, but I'm a little confused on the update statement.
In a nutshell, how can I write something like: UPDATE "TABLENAME" SET DATAFIELD1 = DATAFIELD2 WHERE RECORDNUMBER = (THE SAME RECORD NUMBER)
I do know that I have to ensure that sp_dboption Recursive Triggers value is set to false, thanks.
I have a list of items in one table and a field (pageName) in another table that may contain one of the aforementioned items somewhere within that field. There is no fixed position within the field where the itemNo may be so I can't just use SUBSTRING(pageName,2,5) in(select itemNo from tblItem).
Logically, it's like I need to combine IN and LIKE: select pageName where pageName LIKE IN %select itemNo from tblitemNo%..LIKE can only handle one comparison string.
Hi people My users are having troubles with link to default drillthrough report when reports are exported to excel (they REALLY don't like this behavior ), so I decided set all of them disabled in report model, this work fine, but calculated field in reports has this drillthrough link.
Let me show you the situation. Entity Product has an UnitaryCost field, I set the EnableDrillthrough Property in False so when I export a report with this field, no link is shown.
But if I create in the report a calculated field Round(UnitaryCost) this field has a Drillthrough Link
Is this the standard and expected behavior? or its simply a BUG?
Have I done something wrong in my model? and in this case, How I can correct this?
I installed Visual Studio over a year and a half ago when I became a Microsoft ISV. I have done all of my SQL Server work from within the Visual Studio framework and UI. I recently was asked to document how a customer's users would set up the customer's system using SQL Server 2005, but not having Visual Studio. I got the book Beginning SQL Server 2005 for Developers and immediately ran into a wall. Dewson (the author) talks about the SQL Server Management Studio. He says you get to it by Start > Programs > Microsoft SQL Server 2005 > Sql Server Management Studio. When I tried, I went Start > All Programs > Microsoft SQL Server 2005 > Configuration Tools.
I have reinstalled my SQL Server 2005 Developer's edition and installed SQL Server 2005 Standard edition every way I can see, but I still can't get SSMS to come up. What am I doing wrong?
I am running XP Pro 2002 with SP 2. It is on a thinkpad with P4-M 1.8 ghz and 512 mb RAM. My Add/Remove programs says I have SQL Server 2005, SQL Server 2005 Backward Compatibility, SQL Server Native Client, SQL Server Setup Support Files, and SQL Server VSS Writer installed.
I installed Red Gate's SQL Search and now I have an Add-ins icon. From the Icon I got to a list of tools, one of which is SSC's script library.
When I downloaded it I got this file "SQLScripts.utmcsr&__utmv=-&__utmk=243779397" which did not trigger an installer when clicking on it. How do I add it.
I have a New default instance of SQL2k5 installed and i am trying to setup access to the this via a vpn.
The VPN is setup and allows access to the server and can T/S to the server and perform everything all ok.
When trying to connect over the VPN with SSMS installed on my laptop I am able to connect using Windows authentication only by using Named Pipes. To accomplish this i perform a Net Use ..... and everything works fine.
However if i specify in the connection tab to use TCP/IP it fails with an unknown username or password. The Event Viewer on the server shows this and for what ever reason the username / pwd is that of my laptop and not of the account used in the VPN setup or the net use.
Also if i try to connect to the SQL Server over the VPN using VS 2005 it also gives the same issue.
I need to get this sorted so that TCP is able to be used.
I created a database on a remote server and trying to manage the database using a local SSMS. I am able to see the tables and other objects of the old databases residing on the same remote server, but not the new database. I have created the users similar to the other databases, have the exact same roles as the other databases.Not sure what I am missing here. Any suggestions??
Is there any way to use SQL Server Management Studio to manage a 7.0 database? I have a few old databases still in 7.0 and would really like to manage them through SMSS. Am I out of luck?
Just installed SQL Server 2005 Standard. When I attempt to connect using SSMS it just sits. No error comes up. The log seems to indicate everythings OK. SQLServer and SQLBrowser services are started. Here's the log:
2007-07-07 09:41:23.07 Server Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86) Feb 9 2007 22:47:07 Copyright (c) 1988-2005 Microsoft Corporation Standard Edition on Windows NT 5.1 (Build 2600: Service Pack 2)
2007-07-07 09:41:23.07 Server (c) 2005 Microsoft Corporation. 2007-07-07 09:41:23.07 Server All rights reserved. 2007-07-07 09:41:23.07 Server Server process ID is 2412. 2007-07-07 09:41:23.07 Server Authentication mode is WINDOWS-ONLY. 2007-07-07 09:41:23.07 Server Logging SQL Server messages in file 'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLLOGERRORLOG'. 2007-07-07 09:41:23.07 Server This instance of SQL Server last reported using a process ID of 1348 at 7/7/2007 9:35:40 AM (local) 7/7/2007 2:35:40 PM (UTC). This is an informational message only; no user action is required. 2007-07-07 09:41:23.07 Server Registry startup parameters: 2007-07-07 09:41:23.07 Server -d C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDATAmaster.mdf 2007-07-07 09:41:23.07 Server -e C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLLOGERRORLOG 2007-07-07 09:41:23.07 Server -l C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDATAmastlog.ldf 2007-07-07 09:41:23.11 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required. 2007-07-07 09:41:23.11 Server Detected 1 CPUs. This is an informational message; no user action is required. 2007-07-07 09:41:23.34 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required. 2007-07-07 09:41:23.36 Server Attempting to initialize Microsoft Distributed Transaction Coordinator (MS DTC). This is an informational message only. No user action is required. 2007-07-07 09:41:23.89 Server The Microsoft Distributed Transaction Coordinator (MS DTC) service could not be contacted. If you would like distributed transaction functionality, please start this service. 2007-07-07 09:41:23.89 Server Database mirroring has been enabled on this instance of SQL Server. 2007-07-07 09:41:23.90 spid5s Starting up database 'master'. 2007-07-07 09:41:24.20 spid5s SQL Trace ID 1 was started by login "sa". 2007-07-07 09:41:24.28 spid5s Starting up database 'mssqlsystemresource'. 2007-07-07 09:41:24.31 spid5s The resource database build version is 9.00.3042. This is an informational message only. No user action is required. 2007-07-07 09:41:25.65 Server A self-generated certificate was successfully loaded for encryption. 2007-07-07 09:41:25.67 Server Server local connection provider is ready to accept connection on [ \.pipeSQLLocalMSSQLSERVER ]. 2007-07-07 09:41:25.67 Server Server local connection provider is ready to accept connection on [ \.pipesqlquery ]. 2007-07-07 09:41:25.67 spid9s Starting up database 'model'. 2007-07-07 09:41:25.67 Server Server is listening on [ 127.0.0.1 <ipv4> 1434]. 2007-07-07 09:41:25.67 Server Dedicated admin connection support was established for listening locally on port 1434. 2007-07-07 09:41:25.68 Server SQL Server is now ready for client connections. This is an informational message; no user action is required. 2007-07-07 09:41:25.68 spid5s Server name is 'LAPTOP'. This is an informational message only. No user action is required. 2007-07-07 09:41:25.71 spid12s Starting up database 'msdb'. 2007-07-07 09:41:25.71 spid13s Starting up database 'ReportServer'. 2007-07-07 09:41:25.71 spid14s Starting up database 'ReportServerTempDB'. 2007-07-07 09:41:25.71 spid15s Starting up database 'testx'. 2007-07-07 09:41:27.45 spid9s Clearing tempdb database. 2007-07-07 09:41:28.65 spid9s Starting up database 'tempdb'. 2007-07-07 09:41:28.78 spid5s Recovery is complete. This is an informational message only. No user action is required. 2007-07-07 09:41:28.78 spid12s The Service Broker protocol transport is disabled or not configured. 2007-07-07 09:41:28.78 spid12s The Database Mirroring protocol transport is disabled or not configured. 2007-07-07 09:41:29.25 spid12s Service Broker manager has started. 2007-07-07 09:57:23.54 Server CPU time stamp frequency has changed from 117988 to 200203 ticks per millisecond. The new frequency will be used. 2007-07-07 10:09:23.85 Server CPU time stamp frequency has changed from 200203 to 242307 ticks per millisecond. The new frequency will be used. 2007-07-07 10:20:03.20 spid12s Service Broker manager has shut down. 2007-07-07 10:20:04.25 spid5s SQL Server is terminating in response to a 'stop' request from Service Control Manager. This is an informational message only. No user action is required. 2007-07-07 10:20:04.25 spid5s SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.
I have SQL Server 2005 SP2 (developer edition) installed on my machine along with Visual C# 2005 express and Visual Web Developer 2005 express. I uninstalled the 2005 Visual tools and installed the 2008 versions which in turn installed .Net 3.5.
Now, when I right click on a table and select designer, I get the following error message.
TITLE: Microsoft SQL Server Management Studio ------------------------------ Class does not support aggregation (or class object is remote) (Exception from HRESULT: 0x80040110 (CLASS_E_NOAGGREGATION)) (Microsoft.SqlServer.SqlTools.VSIntegration) ------------------------------ BUTTONS: OK ------------------------------
Similarly, when I right click on the indexes folder under a table so that I can create an index, I get the same message but with more details (details are at the end of this post due to size). My research into this problem indicates that it is a problem with the .Net frameworks and I need to reinstall .Net 2.0. It appears that I would have to uninstall 3.5 to accomplish this.
I imagine that I can uninstall the 2008 Visual tools but I really don't want to go backwards. Does anyone know how I can fix the SS2005 instance or am I just going to have to tolerate the errors until I can get a copy of SS 2008?
See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.Runtime.InteropServices.COMException (0x80040110): Class does not support aggregation (or class object is remote) (Exception from HRESULT: 0x80040110 (CLASS_E_NOAGGREGATION)) at Microsoft.SqlServer.Management.UI.VSIntegration.ISqlToolsVSHlpFactory.CreateHierarchyWrapper(Guid& clsidInnerHier) at Microsoft.SqlServer.Management.UI.VSIntegration.SqlWorkbenchHierarchy.CreateHierarchyWrapper(Type typeToWrap, ILocalRegistry localReg) at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptFactory.get_SqlVirtualProject() at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.IndexMenuAccessHandler.Enabled(INodeInformation source) at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ToolsMenuItemBase.UpdateMenuCommandStatus(MenuCommand menuCommand) at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.DefaultMenuHandler.UpdateMenuCommandsStatus(MenuCommand menuCommand) at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.DefaultMenuHandler.GetMenuItems(ArrayList items) at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.DefaultMenuHandler.GetMenuItems() at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ExplorerHierarchyNode.ShowContextMenu(Point windowPos) at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.LazyTreeView.WmContextMenu(Message& m) at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.LazyTreeView.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Granted there are nearly 8000 tables in this particular database. What needs to be installed or what bit needs to be flipped so the user can see all tables in SSMS?