SQL Server Stored Procedures Questions and Answers

Recent IT Questions

21 - 39 of 39
<<PREVIOUS 1|2 NEXT>>

IF ELSE in SQL Server stored procedure

i am using this code which is giving error. if (@report_type = 'CM') Begin Select distinct Region,sum(ClientCount) as ClientTotal Into #NewTemp From ( End else if (@report_type = 'AM' ) Begin ( Select distinct Region,Area,sum(ClientCount) as ClientTotal Into...

asked by Rrj1

  5 pts.

Scope identity on a stored procedure in SQL

I have created the following stored procedure in SQL: CREATE procedure [dbo].[sp_trip_number] @Table_Name nvarchar(100), @Trip_Number int output as begin set nocount on begin transaction DECLARE @DynamicSQL NVARCHAR(1000) DECLARE @New_Trip_Number int SET @DynamicSQL='INSERT INTO...

View Answer   |  Dec 10 2008  7:54 PM GMT
Parameters, SQL Server stored procedures, scope
asked by SQL Server Ask the Experts

  2445 pts.

Changes in stored procedures from SQL Server 2000 to SQL Server 2005

If you could, could you please give a list of the relevant changes that have been done to stored procedures from SQL Server 2000 to SQL Server 2005?

asked by SQL Server Ask the Experts

  2445 pts.

Unreported error in an order entry application designed in SQL

I have developed an order entry application in SQL Server for a client. One of its functions is to insert invoices into the relevant tables. The procedure only does the job 997 times out of 1000 on average. In a single day, that means that hundreds of invoices are incomplete. No errors are...

View Answer   |  Dec 5 2008  6:43 PM GMT
SQL Server stored procedures, SQL Server tables
asked by SQL Server Ask the Experts

  2445 pts.

Moving SQL Stored Procedures

My developers create MS SQL Stored Procedures on a development server. What is the best way to move/copy those SPs to the production server (different machine)?

asked by VelameLaCosa

  65 pts.

SSRS Performance

I Have created an SSRS Report for retrieving 55000 records using a Stored Procedure.When Executing from SP it is taking just 3 Seconds but when executing from SSRS report It is taking more than one Minuits.How i can solve this problem?

View Answer   |  Dec 4 2008  12:05 AM GMT
Stored Procedures, SQL Server Reporting Services, SSRS
asked by Sinshith

  5 pts.

Comparing views, user-defined functions and stored procedures in SQL

How do views, user-defined functions (UDFs) and stored procedures work in SQL, and what conditions are there on their usage?

Answer Question   |  Nov 19 2008  2:55 PM GMT
UDF, SQL Server stored procedures, SQL Server views
asked by SQL Server Ask the Experts

  2445 pts.

Date formats in SQL Server Stored Procedures

This one will be easy, I'm sure. I'm a novice at Stored Procedures, and I'm wondering what function I can use to display a smalldatetime field (currently displaying as Dec 19, 2008 12:00AM) as a short date (12/19/2008)? I am on Sql Server...

asked by Wandasoozq

  5 pts.

Writing a stored procedure to insert an ASP.net file into a SQL database

I need to write a stored procedure to insert into a SQL database the contents of a file that has been in read in ASP.net. How would I do this?

View Answer   |  Nov 7 2008  3:37 PM GMT
ASP.NET, SQL Database, SQL Server stored procedures
asked by SQL Server Ask the Experts

  2445 pts.

sql server stored proc question

Hi the code is like this. Its taking too long to excute. if exists(select jbadsd from saldayf sa where substring(convert(char(7),sa.jbadsd),4,4) = substring(convert(char(7),@jbadsd),4,4) and substring(convert(char(7),sa.jbadsd),2,2) = '07') --print'exists' update [national].dbo.tempsaldayfna ...

View Answer   |  Nov 6 2008  5:05 PM GMT
SQL Server 2005, SQL Server stored procedures
asked by Gullu1

  5 pts.

SSIS package

I am supposed to Run an sproc /script for more than one database. I thought of scheduling this sproc as a job for all database instances. But, DBA's suggested me to go with SSIS Package. Can any one quide me in doing this.

asked by MSDEVELOPER

  5 pts.

Strange Stored Procedure Behavior (Dev vs Prod)

I have a stored procedure that runs on my Production database in 0.394 seconds. However, when I try to run the SP on a DEV box it takes well over 15 minutes to run *every* time. I have checked indexes and everything seems to be identical (I did a backup/restore to the Dev box in the first...

View Answer   |  Oct 28 2008  9:01 PM GMT
SQL Server 2000, Stored Procedures, SQL Server 2005
asked by Noonway

  25 pts.

LSXODBC and MS-SQL Stored Procedure Parameters

Using LSXODBC and ODBCResultSet, how do you pass parameters to a stored procedure using result.Execute or result.ExecProcedure? I am looking for a working example not just syntax.

Answer Question   |  Oct 8 2008  5:57 PM GMT
LotusScript, ODBC, SQL Server stored procedures
asked by Mzrn1x

  5 pts.

Creating stored procedures to execute tables at runtime on a SQL Server

I’d like to execute different tables at runtime on my SQL Server by creating stored procedures. This is the syntax I am attempting to use: "create procedure sp1(colname varchar(400), tab_name IN varchar2) AS BEGIN select * from '@TABLENAME' where CompanyName='@COLUMNNAME' end" Is this syntax...

View Answer   |  Sep 17 2008  7:21 PM GMT
Stored Procedures, SQL Server stored procedures
asked by SQL Server Ask the Experts

  2445 pts.

Union Query

I 've a problem with porting my ms access database to sql server. In my inventory database, i have 4 tables: (1)Purchase, (2)Sales, (3)Quantity Adjustment, (4)Amount Adjustment. I want to calculate the stock position from those 4 tables. In access database, i do with this kind of queries : a....

asked by Ipong

  40 pts.

Execution time is varying with query analyzer and visual studio 2005

when a stored procedure is executed in query analyzer its working fine and getting the result quickly.but when same procedure is executed through visual studio timeout expired error is generated.can any one olve this issue

View Answer   |  May 21 2008  6:24 AM GMT
SQL, Visual Studio, Stored Procedures
asked by Abcp

  5 pts.

Is it possible to have a SQL Server stored procedure in Domain A read data from tables in Domain B?

I want to have a stored procedure on a server in Domain A, read data from some tables in Domain B. Is this possible in SQL Server?

View Answer   |  Apr 28 2008  3:49 PM GMT
Stored Procedures, SQL Server stored procedures
asked by SQL Server Ask the Experts

  2445 pts.

Running Procedures within the PL/SQL program

WE are dealing with stored procedures in a PL/SQL program. I am trying to execute the procedure from within the program itself. Is there a need to do it within a cursor or is there a specific manner to do that?!

View Answer   |  Apr 28 2008  10:53 AM GMT
Stored Procedures, PL/SQL, SQL Server stored procedures
asked by Nimsalwayz

  5 pts.

Looking for a stored procedure to monitor size of Transaction Log file

Is there any way I can create a stored procedure which will check for the Transaction Log file size - where we have a specified limit to grow - and if the Log file reached 80 percent of total size, email alerts can be sent to DBAs?

asked by SQL Server Ask the Experts

  2445 pts.

21 - 39 of 39
<<PREVIOUS 1|2 NEXT>>