Tag: stored-procedures

Stored Procedure sometimes timeouts when calling via RPC, but always OK when calling in SQL

We have a very strange problem: We have a stored procedure which returns a set of data. This procedure does a rather complex join and aggregation, so it takes 700 Milliseconds to execute. When called directly in SQL Studio, the procedure ALWAYS returns correcty and always takes about 700 ms of time. However, when called […]

Insert last X Week Numbers into Temporary table

My Question I am trying to write a stored procedure that retrieves the week numbers for the past X weeks and then inserts them into a temporary table. So far I have been able to create the temporary table and return the contents (not very hard). However, my issue now lies with the inserting of […]

Updating Parameters In Data Source for a Report Viewer ASP.NET C#

I have the following controls: Data Source, Report Viewer, and two Telerik RadDateTimePicker. Screen shot of what my Rad Controls look like. My report is a client report definition (.rdlc). I have a stored procedure in my SQL 2008 database that I am using for the report, and the data source. I have configure with […]

Sync stored procedures with software updates

I develop a software system that runs on multiple computers that connect to a centralized database. At this point in time, all SQL queries are inline with the applications source code. I would like to start migrating these into stored procedures. If I need to make a change to a stored procedure that will require […]

Table Join between Servers

I need to compare result sets from different servers. The tables I want data from share a primary key. Question: Because I have a primary key, can I query data using a simple join (ie ‘Server1.db1.dbo.table1.primarykeyfield = Server2.db2.dbo.table2.primarykeyfield) without having to use the stored proc (sp_addlinkedserver) ?

How to get data on datatable by calling stored procedure?

I have a stored-procedure like this : ALTER PROCEDURE [dbo].[SelectUserInfo] AS BEGIN select * from User_Info END and I am using LINQ to call this procedure and want store the data in a datatable or dataset here what I am doing : DataClassesDataContext dc = new DataClassesDataContext(); DataTable dt = null; dt = (DataTable)dc.SelectUserInfo(); but […]

SQL Select fails when run from sp_prepexec

Scenario: SQL 2005 Table VR_MQLOAD with 2 columns – MQKEY (PK, int, not null) and MQDATA (varchar(8000),null) There is a trigger oninsert of this table, and this trigger calls a stored procedure. From a query window, I run: declare @P0 as nvarchar(4000) set @P0 = N’TRIG1420441662MF1991782 CAROLYN 201310021356449320131002Y’ insert into dbo.VR_MQLOAD (MQDATA) values(@P0) The trigger […]

TSQL update table using call for one stored procedure to another

I have the following stored procedure which returns the file size in bytes per input full file path string. I want to write another wrapping stored procedure or function to update a table that has two columns. Column Full_Path (input for the stored procedure below) and column size (should be updated by the output from […]

How to know the stored procedure parameters in PHP?

I want to populate my MSSQL database, so, I will run some procedures with random data. I have to get the parameters of every SP. How I can do that? Thanks.

Update different columns in a stored procedure

I’m trying to port over a concept that I use in Java code that I’ve used to SQL stored procedures and I’m not sure if it’s possible. Essentially, if I have a table with 10 columns I want to be able to update different combinations of columns from the same stored procedure each time. I.e. […]

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