Juan Pablo Díaz's Q&A profile
SQL Server Setting time to zero in a datetime object
Anybody know of an easier way to set the timepart to zero in a datetime object than: declare @day as datetime select @day = getdate () select @day = dateadd ( hh ,- datepart ( hh , @day ), @day ) select @day = dateadd ( mi ,- datepart ( mi , @day ), @day ) select @day = dateadd ( ss ,- datepart ( ss , @day ), @day ) select @day = dateadd ( ms ,- datepart ( ms , @day ), @day ) Here's another way to do it. It's faster than the previously mentioned approach. Select @Day = DateAdd(Day, DateDiff(Day, 0, @Day), 0) To explain how this works... First look at: DateDiff(Day, 0, @Day) You need to realize that the 0 in this statement refers to day 0, which is Jan ...Show All
SQL Server can'd find SSIS for installation in Server2003SBS-PR
I bought a new HP server with Windows 2003 SBS Premium. I also was told buy the company how installed the server, that they installed all the components of SQL. When another company came to install a new business software for us, they told me that the Integration services is not installed. We tried together to install the SSIS with no luck. When we run the Setup(or used Add/Remove software) we couldn't find the Integration services check box in the list of the setup. I also asked assistans from the company that i bought the server fromk, and they also couldn't understand where is it. We have an HP Proliant server, Windows server 2003 small business preminum SP1, SQL server 2005. I was told that without the ...Show All
Visual C# My windows service is stopping
Hi, I am Ravindra ,currently working on windows service. My problem is when I am starting windows service it is starting and suddenly stopping by displaying the following message.... " the service1 service on local computer started and then stopped .Some services stop automatically if they have no work to do ,for example ,the performance logs and alerts service" please help, thanks in advance................. Ravindra, Hi, If possbile could you please post your reply on how you resolved this problem, so that it might help someone else who f ...Show All
.NET Development C# form isn't getting key strokes
I developed a C# form in a C# project. From a C++ application I open the C# form (using Managed C++). The C# form works as expected, until I do a File Drag-and-Drop operation on it. After that the C# form quits responding to any key strokes. This prevents the user from doing things like entering text into a TextBox. If I close the C# form, then reopen it (without closing the C++ app) everything works fine. The output window shows no exceptions being thrown, and I'm also trapping "AppDomain.CurrentDomain.UnhandledException" and "Application.ThreadException" and writing the results to the Output window, and nothing is raising those events. Any ideas on why the form quits responding to key strokes thanks for any input! ...Show All
SQL Server Performance problem loading packages
We're having a performance problem with a package since an error occurred. The original error came from the Job Manager whicj was unable to start a thread. Our understanding is that this is a memory related issue and we'll deal with that. What is realy odd is what happened after that. The package executes from a SQL Agent job that includes 3 other packages. Each package is stored on the file system. Package execution time for the affected package changed from less than a minute to over 5 minutes. The other packages continued to execute normally. In checking the logs there is large time gap between the start of the SQL Agent step and the first pre-validation message that accounts for 4 minutes, as if there is some issue in loading ...Show All
Visual Studio Team System code policies : before check in, must build succese in developer localhost
We would like to make use of the code analysis policy to verify the quality of code being checked-in. My questions: (1) Are there existing policies developed for build project in Developer localhost before check in?If can't build, will not check in. (2) If not, how does one go about developing these policies Thanks, Yes - http://blogs.vertigosoftware.com/teamsystem/archive/2006/02/27/2307.aspx ...Show All
Visual C# How setting property file ??
Hi, I have one file .config: FILE NAME: App.config < xml version = " 1.0 " encoding = " utf-8 " > < configuration > < appSettings > < add key = " DiretorioDestino " value = " c:\ " /> </ appSettings > </ configuration > How I setting the value in this file I know read this value, but not setting. Thanks.... Brunno Tavares One can change App.config file though it's a bit tedious job! Please remember that your App.config file will be renamed to <your-app-name>.exe.config at runtime and can be found either under /bin/release or /bin/debug folder!! Here is h ...Show All
Windows Forms databound listbox
I have 2 list boxes. Both are databound. I have an add button and remove button. when the add button is pressed the selected record should be moved from list box 1 to list box 2. When the remove button is presse the selected record should be moved from list box 2 to list 1. It works pretty well - unless one of the list boxes are empty then I have all sorts of problems adding the new row (no primary key, no columns, etc..) I set the databound listboxes with: list.DisplayMember = DisplayName; list.ValueMember = ValueName; DataColumn [] dtCol = new DataColumn [1]; dtCol[0] = dtSrc.Columns[ValueName]; dtSrc.PrimaryKey = dtCol; list.DataSource = dtSrc; My remove button code is: private void cmdR ...Show All
SQL Server How can I use the Variables in SQL Execute SQL task?
I define a package variables "varOutTable" and "varFromTable". and I insert a SQL Execute SQL Task into Control Flow my sql command is "Select * into @[User::varOutTable] from @[User::varFromTable]" but the task failed, it seems that sql task can't get the varOutTable and varFromTable How can I use the Variables in SQL Execute SQL task thanks!! agentf1 wrote: Are there any examples of doing a select count(*) into a variable For some reason when displaying my variable it looks like it contains -1. That's because your variable is of OBJECT type. If you're returning one row, one value, you can use an integer data type (in this case). ...Show All
SQL Server Filtering KPI if already included dimension in calculation
Re: SQL 2005 AS. Is there a way to filter a KPI if already included a dimension in the MDX calculation For example have created a calculation called "Profit" which is made up of [Account, Product subset, $] . When try to filter by Product in the KPI browser, does not work. Another example is say have a set of data which only includes apples, oranges, & apricots in the calculated member. Can I apply a filter to the resulting KPI to just show oranges Is there a way around this, without creating separate calculations/KPI's for each product (e.g. Profit apples, Profit oranges, Profit apricots) You will need to clarify when do you want to exclude PA010 and when you ...Show All
SQL Server database on remote server
I've been reading the threads about using a mdf on a remote machine. I've enabled TCP/IP and started the browser service as well as adding sqlserver.exe and sqlbrowser.exe to the firewall exception list. I'm still unable to create/connect to a mdf using the data source wizard and that seems in line with the threads I've read. I've found examples on how to write the connection code in my program but I'm still unsure about a couple things. If I create the mdf on my local machine and then copy it to the remote machine, does sql server express have to be installed on the remote machine or just the local machine It seems like just having the mdf on the remote machine would mean that for multiple users to access the mdf, there would ...Show All
Visual C++ dll problem,help me:)
dll problem,help me:) i create dll project ,the dll is Use MFC in a Static Library i hope exe call ListCtrl class from dll ==================DLL==================== <<<<<<<<<<ListCtrl.h>>>>>>>>>>>>>>> #pragma once class AFX_EXT_CLASS ListCtrl :public CListCtrl { public: __declspec(dllexport) ListCtrl(); __declspec(dllexport) ~ListCtrl(); public: DECLARE_MESSAGE_MAP(); public: afx_msg void OnNMClick(NMHDR *pNMHDR, LRESULT *pResult); }; <<<<<<<<<<<ListCtrl.Cpp>>>>>>>>>>> #include "Stdafx.h" #include "ListCtrl.h" ListCtrl::ListCtrl() {} ListCtrl::~ListCtrl() {} BE ...Show All
SQL Server Importing Data Into Sql Server Database
I am experiencing intermittent connection problems with the Northwind database and sql server express. The most frequent error message indicates that I am already logged in and will not allow another user. The odd thing is that even when I am locked out I can access a Northwind database from another connection on Server Explorer. I ran code to demonstrate simple binding for two text boxes, no problem. I added a project to show complex binding using the datagrid view tool, but could not get past selecting the database. I tried the same simple binding project on another computer running a beta version of VS 2005 Pro and could not connect to Northwind on that computer also. (Two different Northwind databases, different computers) ...Show All
SQL Server Including SSIS package to management studio and scheduling the same.
Hi, I am new to SSIS and SQL Server 2005. I have imported data from excel file to SQL Server 2005 data base and save that as a SSIS package. I saved that package both in SQL SERVER and as a dtsx file. Now I wanna see the same in object explorer in Management Studio. How do I include one SSIS package to Management Studio If I want to schedule the same how do I do It would be great if anyone can help me. ...Show All
.NET Development TableNewRow event doesn't fire
Any idea why the TableNewRow event doesn't fire in an example such as the following DataTable dt = new DataTable ( "Test" ); dt.TableNewRow += new DataTableNewRowEventHandler (dt_TableNewRow); OleDbCommand cmd = new OleDbCommand ( "SELECT * FROM ... ", _connection); using ( OleDbDataReader r = cmd.ExecuteReader()) dt.Load(r); Kind of annoying, as I'd hoped to use this event to keep track of progress as data trickles in. The query takes about 20 minutes to return all data, due to a slow network connection. I'd really like to be able to keep the user informed as data accumulates. Any other suggestions Please use RowChanged event for DataTable.Load( ...Show All
