Hello, I need help with this scalar-valued function.
What I want to do is to return the value I get in MaxValue on the line max(Value) AS MaxValue.
The query works and will only return 1 value if ItemId and ListPropertyId exists, but I am not able to create a function of it.
CREATE FUNCTION GetLpivMax
(
-- Add the parameters for ...
For most database-backed projects I've worked on, there is a need to get "startup" or test data into the database before deploying the project. Examples of startup data: a table that lists all the countries in the world or a table that lists a bunch of colors that will be used to populate a color palette.
I've been using a system where ...
When we need the query of stored procedures we use 'Sp_Helptext procedurename'
Can something similar be done for tables?
...
I have recently created a search system at my company using the Regain Search based on Lucene to search through all software support tickets. I run some queries in SQL to extract my data, export to Excel, import to Access, run some additional queries, create a report, export the report to .txt files, and use a file splitter to split the ...
Hi,
I have a database ready which I am maintaining manually, I would like to now use that database to create an SQL project. I am creating also but not able to import the existing Tables, Views, Stored Procedures or any other object. Is there any way to do it. If yes please let me know.
Thanks,
Piyush
...
I need to import data from Excel to Sql Server using ASP.NET. How can I do this?
...
The project I'm working on has a lot of IN-queries like:
SELECT something, anotherthing
FROM atable
WHERE something IN (value1, value2, value3)
This is an example of a queru with 3 parameters in the IN-part but the same query could be executed with 1 or 2 or 5 or 10 or ... parameters.
The problem is that each query has an other execut...
Hello!
Is it possible to use a set, like (1, 2, 3, 4, 5) for example, as inparameter to a Sproc, function or view in SQL Server 2008?
What should I use of Sproc, function or View for this pice of SLQ?
WITH Scores AS(
SELECT
ItemId, SUM(Score) AS Score
FROM [Presenta].[presenta].[LpivScores]
WHERE
// HERE ...
I have created script to find selectivity of each columns for every tables. In those some tables with less than 100 rows but selectivity of column is more than 50%. where Selectivity = Distinct Values / Total Number Rows So, are those column are eligible for index? Or, can you tell, how much minimum rows require for eligibility to create...
If I want to save any changes in a table, previously saved in SQL Server Management Studio (no data in table present) I get an error message:
"Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be re-created or enabled t...
Hi,
I have a view that basically just returns all records from a table, and adds a column 'isodate' which is supposed to be the date in ISO-Format.
CREATE VIEW [dbo].[v_bedarfe]
AS
SELECT *,convert(varchar(16),datum,20) As isodat FROM bedarfe
GO
The "datum"-field is smalldatetime.
The results of a query on isodat were...'surprisi...
I have this SQL Server user-defined aggregate:
[SqlUserDefinedAggregate(Format.UserDefined, Name="median", IsInvariantToDuplicates=false, IsInvariantToNulls=true, IsInvariantToOrder=true, IsNullIfEmpty=true, MaxByteSize=8000)]
public class MedianCalculator : IBinarySerialize {
private List<double> values;
public void Init() {
...
IF @hr=0
EXEC @hr=sp_OACreate 'Excel.Application', @objExcel OUT
The above line for creating excel is giving errorcode "-2147221005"
...
Does anyone know of good online resources for Microsoft Dynamics SL (Solomon)? I'm interested in general support information and back end SQL support information, as well.
Thanks.
...
I want a field in a table of SQL Server 2008 to contain a preset number of string values for user to be able then to select one value from a dropdown listbox in my WPF front-end app.
Is it possible only through assigning a numeric int type in a SQL Server table field and then doing all the stuff through C# front-end coding, or are there...
Hello,
I have a table with the columns City and ZoneCode. I have a dropdown list where I can select just one City or all. And another dropdownlist for the ZoneCode. Basically they are filters that only filter if I select a value from the dropdown lists.
Is there any recommended technique to do this?
edit: this table is only an example...
I am attempting to debug a stored procedure using the Debug option is SQL Query Analyzer (Version 8.00). However, the debugger run through the whole stored procedure as soon as I start and if add a break-point and try re-executing the sp, the break-point is ignored. What do I need to do to enable debugging? The server is SQL Server 2000
...
I need SQL server 2005 instance name from Adodb connection object in c#.
Please Help for my query.
Thanks in advance
...
I have a complex VIEW and would like to use the DELETE verb against it.
Can this be done?
Will the DELETE verb only affect the FROM table used in the SELECT statement?
I have about 8 joins. Will any of these joined tables be affected?
I am using SQL Server 2005.
...
I want to change the permissions for all the tables in a SQL-Server database at once. Is there a way to do this?
...