Using the same DataSource by some DropDownList

I have a stored procedure that gets a parameter and retrieves a list of suppliers from the database: Create proc spGetSuppliers (@RowMeterialID int) as begin select distinct sName from Supplier, RawMaterials, SupplierRawMaterials where RawMaterials.rmID = @RowMeterialID and RawMaterials.rmID = SupplierRawMaterials.rmID end A datasource : <asp:SqlDataSource ID=”SqlDataSource2″ runat=”server” ConnectionString=”<%$ ConnectionStrings:igroup9_test1ConnectionString %>” SelectCommand=”spGetSuppliers” SelectCommandType=”StoredProcedure”> <SelectParameters> <asp:Parameter DefaultValue=”” […]

Some issue with logical tables (DELETED, INSERTED) in procedure

I try use logical tables in procedure but I have error: “Invalid object name DELETED” So first question can I use logical tables in procedure? If yes how can I do this? This is a code USE Operator GO CREATE PROCEDURE generuj ( @nazwaTabeli VARCHAR(20) ) AS BEGIN SET NOCOUNT ON; — — Check if […]

Create different filegroup for different Schema

I need to create a filegroup for schema I have in SQL Server. The DB is empty and I just want to create schema and their filegroups. How can I do that?

Need help finding many float value errors in a large SQL statement

I’m having an issue inserting data from one table to another in SSMS 2008 R2. I need to figure out why about 150 columns are failing to convert from nvarchar to float. I’m getting the error: “Error converting data type nvarchar to float.” Because these are all in a very large select statement I’m not […]

Query to Access Sharded Tables

I am querying a vendors database that has data that is sharded between multiple tables. The tables are named Events_1, Events_2, Events_3, Events_4 etc. It appears that a new table is automatically created when the table hits 10,000 records. I am looking to write a query that would be able union the results from all […]

SELECT Query times out with when Dates are given as variables in SQL Server 2008

I use SQL Server 2008 database. I run a view on a linked server that connects to 6 different tables. My query runs in less than a second if dates are hard coded. However, it takes an infinite amount of time when the dates are given as @start and @stop. — SQL Server 2008 SELECT […]

Procedure or function “Procedure name” expects a parameter “Param name” which was not supplied occurs rarely

I have a web service function in VB.NET that will send parameters to a SQL Server stored procedure. Everything works perfectly for two months in the deployed machine. But now the error Procedure or function GetEmployeeDetails expects a parameter @Progress which was not supplied’ occurred only once on the deployed machine. Before and after the […]

Insert a column value to database using session

I want to insert a value into a table which comes from a session variable.The code that i have written is: protected void Button1_Click(object sender, EventArgs e) { double balance; double reward; if((double.TryParse(lblBalance.Text, out balance) && (double.TryParse(lblReward.Text, out reward)))) { Session[“FinalBalance”] = balance + reward; } else { // some kind of error handling } […]

Design: Mixed XML / Relational or Pure Relational?

Is it acceptable to model a very complex object graph using XML in the database, but leave the rest of a system in relational tables? I’d like to gauge opinion on this as I’ve hit a bit of a conundrum. Many thanks ——————– Background I’m building a financial application which, although not at all large […]

Auto-incrementing a non-identity field

Is it possible to auto-increment a field that is not defined as Primary Key in a table? Lets say that i have three fields in a table. One of them is Primary Key with IDENTITY(1,1) set. The second field is a int type that i want to auto-increment with a INSERT statement on a third […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.