0
votes
0answers
16 views

php special characters inserting into SQL Server 2005

I currently have this query that insert data into SQL server. But as the question can contain special characters that include ' which is single quote, it skips my query and did not insert into ...
0
votes
1answer
22 views

Database backup taking issue

I am using Sql Server 2005. I wanted to take back up of my database through simple sql command. For this i refered THIS doccument. Made command as follows: backup database webbasednewsoft to disk ...
-1
votes
2answers
30 views

SQL Procedure not working according to sequence

I wanted to write stored procedure for login table. This procedure involves, checking if LogInID already exists, and if it exists then dont allow to insert record with same LogInID. I procedure is ...
0
votes
2answers
30 views

SELECT INSERT script sql error

I have table product, product_sn for every product have one or mutltiple sn ( serialNumber) so lets imagine I ve product id = 11, productName = 'milk' I want copy all serialNumber from produt_sn into ...
0
votes
2answers
25 views

output parameter in stored procedure not working

I am new with stored procedures. I have simple stored procedure for addition of two numbers as follows: alter proc simpleProc ( @Tax int , @TotalAmount int, @sum int output ) as ...
1
vote
1answer
34 views

Handle more than one returning value in stored procedure

I have following stored procedure ALTER PROC spInParam ( @partyCode NVARCHAR(50) ) AS BEGIN DECLARE @totalAmount float DECLARE @setLoop int DECLARE @setCNT int print 'Party Code '+@partyCode; set ...
1
vote
1answer
26 views

insert multiple rows in single SQL

I am trying to insert multiple rows with SQL statement. For that i refered this question. According to top scored answer in this qestion, i made following query: INSERT INTO login ...
0
votes
3answers
24 views

sql function not retrieving table and giving error

I have written following function in SQLServer 2005 Following is the function: create function fnBillParticulars() return table as return (select * from billParticulars where Id='2425') go Its ...
0
votes
2answers
28 views

stored procedure declaration error

I am new with stored procedure. I am taking value of column in one variable and checking it with If block. My code for this is as follows: create proc billRet as BEGIN DECLARE @amt float set ...
-2
votes
4answers
62 views

How to improve query performance? [closed]

I have a query here to update a table with the inventory type of each rep's latest inventory. However, the only way I got it to work was by using a cursor, which is really affecting performance. Below ...
0
votes
3answers
387 views

Conversion failed when converting varchar value to data type int [closed]

My stored procedure accepts one parameter, and it is a datetime. If no parameter is passed, I default it to the getdate() function: ALTER PROCEDURE [dbo].[myexport] ( @start datetime = null ) AS ...
2
votes
1answer
39 views

Querying for a blank answer - lack of a row in a table

I have a form that users fill out when a patient gets transferred to another location. The relevant part of the form looks like this: I want to count the number of patients that have a no Date of ...
1
vote
2answers
37 views

date issue due to datediff function in between

I have following query: SELECT datediff(d, 0, sauda_date), Scrip_Code, SUM(CASE WHEN Buy_sell = 1 THEN Trade_Qty ELSE 0 END) AS BuyQty, SUM(CASE WHEN Buy_sell = 1 THEN Market_Rate ELSE ...
0
votes
3answers
41 views

not able to get individual date in query result

My Query is : SELECT sauda_date,Scrip_Code, SUM(CASE WHEN Buy_sell = 1 THEN Trade_Qty ELSE 0 END) AS BuyQty, SUM(CASE WHEN Buy_sell = 1 THEN Market_Rate ELSE 0 END) AS BuyRate, SUM(CASE WHEN ...
0
votes
2answers
175 views

insert SQL rows from a string with comma record-delimiter and colon-delimited name-value pairs

The data we receive is formatted like this: '1:0,2:1,3:1,4:0' The values are separated by commas: the value before the colon is a studentId, and after is a bit value. I want to store these values ...

1 2 3 4 5 29
15 30 50 per page