I have developed a simple logic for finding the trend based on least squares method.Want to know whether a built in function already exists for finding the trend or is being developed for future versions of SQL server
when insert a multiple line string value into a field it display with two squares when open table. insert into temptest (test,refdetails,cardno)values('test1','this is first line and second line and third line', '23243') this record shows in the database with squares for enter key. how to replace these squares with space? pat this is first line and [][]second line [][]and third line
I have a simple text box in a table in the body of a report. This renders fine via IE on both my dev box and the client.
However when rendered within a Reportviewer control on the client, the box show the text followed by lots of black squares. Running the app on my dev box is also fine - no black boxes at all.
The report resides on the server, and the server is fully patched.
I was hoping to elicit some feedback on a trend I am seeing in the Portal market, and specifically with SharePoint development.
If you are not familiar with SharePoint, there is a data table abstraction within SharePoint called a "List". Lists are used for storing data (duh!). However, they are built using the SharePoint front end, and the data entered into all lists is stored in a few tables in the SharePoint content database.
What I am seeing happening is SharePoint gurus reccomending AGAINST storing your relational data within database tables, and within SharePoint lists instead. I am not sold on this approach, and it actually makes me think we are taking a step backwards with regards to persistent data storage and best practices.
- Lists cannot be natively related to one another, however they support "lookups" - Anyone can create a list...and repeat the same data all over the enterprise. - Lists are maintained in two tables within the SharePoint content database using meta-data patterns. - Portals contain a multitude of sites. Users and portal admins can create lists all over the place, thus spreading related data over a wide swath of the enterprise.
Is it just me, or are SharePoint pundits absolutely CRAZY to be recommending persistent data storage using lists? I see nothing but problems arising from this approach.
I apologize beforehand if you have not worked with SharePoint and Lists, as this post may not make much sense to you. ;)
For a set of data points (x, y), this algorithm can be used to fit the data to any of the following curves:
1. Straight line (linear regresion); y = A + b*x 2. Exponential curve; y = A*EXP(b*x); nb a > 0 3. Logarithmic curve; y = A + b*LN(x) 4. Power curve; y = A*x^b; nb a > 0
The coefficient of determination is R2 (how well does the curve fit) -- Prepare test data CREATE TABLEcf ( x decimal(38, 10), y decimal(38, 10) )
-- Calculate Linear regression INSERTcf SELECT40.5, 104.5 UNION ALL SELECT38.6, 102 UNION ALL SELECT37.9, 100 UNION ALL SELECT36.2, 97.5 UNION ALL SELECT35.1, 95.5 UNION ALL SELECT34.6, 94
SELECT'Linear regression' AS Type, A, b, R2 FROMdbo.fnCurveFitting(1) UNION ALL SELECT'Bestfit = ' + CAST(Type AS VARCHAR), A, b, R2 FROMdbo.fnBestFit()
-- Calculate Exponential regression DELETE FROMcf
INSERTcf SELECT.72, 2.16 UNION ALL SELECT1.31, 1.61 UNION ALL SELECT1.95, 1.16 UNION ALL SELECT2.58, .85 UNION ALL SELECT3.14, .5
SELECT'Exponential regression' AS Type, A, b, R2 FROMdbo.fnCurveFitting(1) UNION ALL SELECT'Bestfit = ' + CAST(Type AS VARCHAR), A, b, R2 FROMdbo.fnBestFit()
-- Calculate Logarithmic regression DELETE FROMcf
INSERTcf SELECT3, 1.5 UNION ALL SELECT4, 9.3 UNION ALL SELECT6, 23.4 UNION ALL SELECT10, 45.8 UNION ALL SELECT12, 60.1
SELECT'Logarithmic regression' AS Type, A, b, R2 FROMdbo.fnCurveFitting(1) UNION ALL SELECT'Bestfit = ' + CAST(Type AS VARCHAR), A, b, R2 FROMdbo.fnBestFit()
-- Calculate Power regression DELETE FROMcf
INSERTcf SELECT10, .95 UNION ALL SELECT12, 1.05 UNION ALL SELECT15, 1.25 UNION ALL SELECT17, 1.41 UNION ALL SELECT20, 1.73 UNION ALL SELECT22, 2 UNION ALL SELECT25, 2.53 UNION ALL SELECT27, 2.98 UNION ALL SELECT30, 3.85 UNION ALL SELECT32, 4.59 UNION ALL SELECT35, 6.02
SELECT'Power regression' AS Type, A, b, R2 FROMdbo.fnCurveFitting(1) UNION ALL SELECT'Bestfit = ' + CAST(Type AS VARCHAR), A, b, R2 FROMdbo.fnBestFit()
Hi,I am trying to write a method which needs to call a stored procedure and then needs to get the response of the stored procedure back to the variable i declared in the method. private string GetFromCode(string strWebVersionFromCode, string strWebVersionString) { //call stored procedure } strWebVersionFromCode = GetFromCode(strFromCode, "web_version"); // is the var which will store the response.how should I do this?Please assist.
How do I find sales trend of an employee via comparing current month and previous month sales?
I got so far query upto following,
;WITH SalesOrderHeader As ( SELECT ROW_NUMBER() OVER (ORDER BY SUM(H.SUBTOTAL)) AS ROWNUMBER, SUM(H.SUBTOTAL),H.SALESPERSONID,
[Code]....
I am getting following error: The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP, OFFSET or FOR XML is also specified.
Hi, I just have a Dataset with my tables and thats it I have a grid view with several datas on it no problem to get the data or insert but as soon as I try to delete or update some records the local machine through the same error Unable to find nongeneric method... I've try to create an Update query into my table adapters but still not working with this one Also, try to remove the original_{0} and got the same error... Please help if anyone has a solution
I need the Trend line for the following data in Line chart they are the following data. The following are the graph are my output and i need the trend line for these Key_gap value.
This is the link [URL] ....
I need the same trend line for the Bar-Chart in SSRS 2005.
We have a line graph which plots the actual data points (x,y), everything is working fine with this graph. Now we need to add a trend line to this existing graph after going thro. the articles we came to know that there is no direct option in SSRS to draw a trend line. So we need to calculate the trend values ourselves which we need to plot as atrend line. This trend line is similar to the trend line which comes in Excel chart, do anyone know how to calculate the trend values from the actual data points. We got through several formulas, but were not clear, have anyone tried out exactly the same, if so please help us out by providing an example to calculate the trend values.
is this the best and fastest method to connect to a database for DataGrid databind?
--------- Dim MyConnection As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("ConnectionStringSQL")) Dim MyCommand As SqlCommand = New SqlCommand("sp_BuddiesPendingSelect1", MyConnection) MyCommand.CommandType = CommandType.StoredProcedure MyCommand.Parameters.Add(New SqlParameter("@UserID", intUserID))
MyConnection.Open() Dim dr As SqlDataReader = MyCommand.ExecuteReader()
DataList1.DataSource = dr DataList1.DataBind()
dr.Close() MyConnection.Close()
----------------------- or should i use a DataAdapter and fill a DataSet and then attach the DataSet to the DataGrid?
I have been using VB6 for a long time now and had no problems using ADODB.Recordset.I had a module to which I would send my recordset (byref) and the SQL command (byval) and use the resultant recordset for adding, modifying or deleting records.How can I do the same with VS2005? This is a major problem as there are dataadapters, grids, datareaders etc.Does someone have a simple method to get the recordset so that I can modify the record using the code (eg: .Addnew/.Delete/.Update) and Close the connection?Please note that I do not need to display anything and have to run 40/50 AddModDel for every click of the program.Any help is greately appreciated. Thanks in Advance.
If you not familiar with it, the <a href="http://www.stephenforte.net/owdasblog/permalink.aspx?guid=2b0532fc-4318-4ac0-a405-15d6d813eeb8">Rozenshtein Method</a> uses SQL to create a crosstab. The concept is a stroke of genius but I'm having trouble getting it to work on one of production databases.
I successfully used the Northwind example explained at Stephen Forte's site (see the link above)...but no luck on my real world problems.
I can get the date statements to resolve to 0 correctly, but when I try to aggregate the data - the statements are turning into 1 multiplying the aggregate data for each cell...which fills in the same data across the entire row.
For example (the columns represent the time period), GROUP T1 T2 T3 T4 group1 9 9 9 9 group2 3 3 3 3 group3 5 5 5 5
My sql code is: SELECT dbo.tblHassBatch.ProdLine, COUNT((dbo.tblHassUUT.UnitID)*(1-ABS(SIGN(datediff(dd,dbo.tblHassBatch.StartTime,ge tdate())-0)))) AS Today, COUNT((dbo.tblHassUUT.UnitID)*(1-ABS(SIGN(datediff(ww,dbo.tblHassBatch.StartTime,ge tdate())-0)))) AS [This Week], COUNT((dbo.tblHassUUT.UnitID)*(1-ABS(SIGN(datediff(mm,dbo.tblHassBatch.StartTime,ge tdate())-0)))) AS [This Month], COUNT((dbo.tblHassUUT.UnitID)*(1-ABS(SIGN(datediff(mm,dbo.tblHassBatch.StartTime,ge tdate())-1)))) AS [Last Month] FROM dbo.tblHassBatch INNER JOIN dbo.tblHassUUT ON dbo.tblHassBatch.BatchID = dbo.tblHassUUT.BatchID GROUP BY dbo.tblHassBatch.ProdLine
Am I overlooking something here? I'm pulling my hair out b/c if this works it's really going to provide a great solution for a project I'm working on...but I can't seem to figure it out.
I'm not really strong in SQL. My goal is to compare the beginning mileage of a vehicle record with it's previous ending mileage reading. I have something that works, but it feels clunky. I wonder if there is a better method, ie a join. Here's what I have:
SELECT A.Trolley_num, A.Date, A.Speedo_start, A.Speedo_end, (SELECT B.Speedo_end FROM Daily_Trolley AS B WHERE B.Trolley_num = A.Trolley_num AND B.Date = (SELECT Max(Date) FROM Daily_Trolley AS C WHERE C.Trolley_num = A.Trolley_num And C.Date < '1/23/2005')) AS PrevSpeedoEnd FROM Daily_Trolley AS A WHERE A.Date='1/23/2005'
ps: I inherited this db; I'm aware that "Date" should not have been used as a field name.
'TOP 1' or 'DISTINCT' or 'MAX' Any sugestions on which is better to use if I need to select a record that has the highest value - could be a INT or sometimes a DATETIME.
Can someone please tell me how to fix this following error in SQL 2005 When trying to create a maintenance plan, Method Not Found:'Void Microsoft.SqlServer.Management.DatabaseMaintenance.TaskUIYtils..ctro()' (Mircosoft.SqlServer.MaintenancePlanTasksUI)
Is there an efficient scripting method to update the connection string for ALL reports that reside on a reporting/web server? "(automating the process, rather than having to change the data source for each individual report that resides on that server)".
I have never used replication before and I have been asked to considerit in a project I am currently working on.I have created an application for a sales team which is loaded on theirmachines, it uses ms sql as its data source and connects via theinternet back to the central server in the office.Problem is this has shown to be too slow causing time out errormessages and so on. I have been told to research the possibility ofreplication, but am unclear what type of replication to use or where tostart.Any assistance would be appreciated.Regards,Ben
Hi,Given 2 tables:Table1:id Auto,int,PrimKeytable2id inttxt nvarchar50Table2:id Auto,int,PrimKeyorder intThe scenario: Table2.order defines how the table1.txt is should be ordered.Table1.table2id contains the id of the order. This cannot be changed :(How do I select all Table1.txt values but ordered by their correspondingvalues of the table2.order field?--Thx,PipHans---Outgoing mail is certified Virus Free.Checked by AVG anti-virus system (http://www.grisoft.com).Version: 6.0.516 / Virus Database: 313 - Release Date: 01-09-2003
HiSQL Server 7.0 using stored procedures.I need to do a SELECT Top but I always need to find the record countfor the entire SELECT statement.ID Name-- ----1 Abraham20 Barrington32 Callaway54 Dennis58 EmmettIf I do a SELECT TOP 3, I'll get the required records but get arecordcount of 3.I cant use the ROWCOUNT method either becuase the recordcount willalso be 3.I can see two different options for getting back the information Ineed:1 - Run the select statement twice, first to retrieve the recordcountand then with top to get the recordset2 - Use a temp table to get the entire recordset and recordcount, andthen extract the Top N recordsI'd like to know if anyone has any other suggestions. Currently, I'mtempted to go for the second option....ThanksSam
I want to implement the following query using SSIS Data flow Source component :
SELECT * FROM someTable WHERE someColumn = 'H'
How do I restrict the data coming from my data source? By that I mean how do I apply the WHERE clause in SSIS?! Should I use a conditional Split component?! but that would mean retrieving all records first then adding the split component (not the most efficient method surely).
I need to add a value to a column that I know to be DT_CY. However, there is no PipelineBuffer.SetCurrency() method or anything similar.
I checked out the docs for PipelineBuffer.SetDecimal() and it states "If the DataType of the buffer column is not DT_NUMERIC, an UnsupportedBufferDataTypeException occurs"
Similarly for PipelineBuffer.SetDouble() it says "If the DataType of the buffer column is not DT_R8, an UnsupportedBufferDataTypeException occurs"
So it seems I can't use either of those two methods. How do I push a valueto an output column of DT_CY when building an async component?
By the way, I could ask the same about
DT_DBDATE
DT_DBTIME
DT_FILETIME
DT_IMAGE
DT_TEXT
DT_NTEXT
DT_R4
DT_UI1 as well because according to the documentation there doesn't seem to be a method that supports those either. So, please could you answer the same question for those as well!
I have 1 project in VC++ and 1 in Vb.net I have added the VC++ project in VB.Net project using 'Add Existing item option' Now i want to use a method from VC++ project in VB.net How can i do so?????
Hi, I want to learn what is going on Example: Production Scheduling at http://msdn.microsoft.com/sql/learning/prog/clr/default.aspx?pull=/library/en-us/dnsql90/html/sqlclrguidance.asp
First, please interview Production Scheduling example. I'm curioing about SendResultsEnd method.
foreach (Item item in items) { // Compute the schedule and report it item.ComputeSchedule(); item.OutputSchedule(pipe); }
pipe.SendResultsStart(record); for (int i = 0; i < size; i++) { // Pipe each day of production. Omit zero production // days. if (schedule != 0) { record.SetDateTime(1, (DateTime)(dates)); record.SetInt32(2, schedule); pipe.SendResultsRow(record); } } pipe.SendResultsEnd();
Second code block is a part of OutputSchedule method. When pipe.SendResultsEnd method executed. First code block moves to next item. If SendResultsEnd method sends a resultset to client. This code will send many of resultset to client how many items array has in. If it is sending many resultsets. How can client can catch them? I was confused about this situation. And I don't have SQL Server 2005 in my computer. If you test it and explain what is going on I'll be appreciate to you. Please review example in the link.
I am developing an application in which i have to send data from local Sql Server compact edition database[Which is in a Windows Mobile Device,] to central server[SQL Server 2005]. I am using RDA method for communication
Can i use push method to send data from local DB to Central DB?
Is it must to use PULL method before using PUSH method?
I have three options in my mind to synchronize my data of sql server compact edition with sql server 2000/sql server 2005.
1)Merge Replication
2)Remote Data Access
3)Web Service
All the data would be residing on Sql server 2000/2005 and user will get their data after being authenticated and will change the data and add new data and then again will synchronize with server with new changes.
Please suggest me solution, my opinion is going towards Web service.
I have a column of values in one table that needs to be updated based on an adjustment factor in another table. The table which contains the adjustment factors is built with the following column names.
RangeBeg RangeEnd Factor
The factor is determined depending on where the value falls in the range. I have been trying to do an sql script with no luck. Any Help would be appreciated.
I have spent the afternoon researching this, and to no avail so here's my question. I have a user input form with upwards of 60 fields that are to be filled in by the user (intranet environment). I want to post those values as a new record in an SQL database. I have setup an SQLDataAdapter tied to a parameterized stored procedure on the SQL server. I can successfully post data from the controls on the form when I set the parameter type to Control based. Here's the problem, though. I need to do some pre-processing on most of the values in the controls on the form. I have setup VB code (that executes when the user clicks the "Submit" button), that pulls in each control value, performs any necessary processing, and sets a variable to the value I actually want stored in the DB. How can I assign THAT value (from the variable) to the parameter for the stored procedure? Thanks, Dave