Click here to Skip to main content
15,879,239 members
Home / Discussions / Database
   

Database

 
GeneralRe: NDoc to SQL scripts? Pin
devvvy3-Aug-09 14:51
devvvy3-Aug-09 14:51 
QuestionStored Procedure Pl/SQL Pin
Civic063-Aug-09 4:35
Civic063-Aug-09 4:35 
AnswerRe: Stored Procedure Pl/SQL Pin
Vimalsoft(Pty) Ltd3-Aug-09 4:47
professionalVimalsoft(Pty) Ltd3-Aug-09 4:47 
GeneralRe: Stored Procedure Pl/SQL Pin
Civic063-Aug-09 4:59
Civic063-Aug-09 4:59 
GeneralRe: Stored Procedure Pl/SQL Pin
Vimalsoft(Pty) Ltd3-Aug-09 5:06
professionalVimalsoft(Pty) Ltd3-Aug-09 5:06 
GeneralRe: Stored Procedure Pl/SQL Pin
Civic063-Aug-09 5:33
Civic063-Aug-09 5:33 
AnswerRe: Stored Procedure Pl/SQL Pin
David Skelly3-Aug-09 6:09
David Skelly3-Aug-09 6:09 
QuestionError in Stored Procedure. Pin
Satish - Developer3-Aug-09 3:29
Satish - Developer3-Aug-09 3:29 
Hi, i have writeen below stored procedure. I will give input as one zipcode and querystr. If there is no record with given zipcode, it has to go for another query. But it is not going in second if condition. When i try to print the query always showing the first one.


--Exec Test '48019','t1.engl,t1.germ,t1.iris,t1.jewi,t1.scot,t1.wels'


ALTER PROCEDURE [dbo].[test]
(
@Zipcode Varchar(50),
@Querystr Varchar(200)
)
AS
Begin
SET NOCOUNT ON

DECLARE @Result VARCHAR(MAX)

Set @Result = 'SELECT TOP 1 WITH TIES theCol FROM (SELECT * FROM Tbl_Origin WHERE Zip_Final =''' + @Zipcode + ''') AS t1 UNPIVOT (theValue FOR theCol IN (' + @Querystr + ')) AS u1 ORDER BY theValue DESC'

IF @Result IS NULL OR @Result = ''
Begin
Set @Result = 'Select Top 1 theCol from Tbl_Origin'
End

--Exec(@Result)
Print @Result
End

G. Satish

AnswerRe: Error in Stored Procedure. Pin
Vimalsoft(Pty) Ltd3-Aug-09 4:38
professionalVimalsoft(Pty) Ltd3-Aug-09 4:38 
Questiondesigning database tables to store data Pin
uglyeyes2-Aug-09 14:57
uglyeyes2-Aug-09 14:57 
AnswerRe: designing database tables to store data Pin
Henry Minute3-Aug-09 2:09
Henry Minute3-Aug-09 2:09 
QuestionAccessing the file of a T-SQL BACKUP call Pin
Uwe Keim2-Aug-09 5:52
sitebuilderUwe Keim2-Aug-09 5:52 
AnswerRe: Accessing the file of a T-SQL BACKUP call Pin
scottgp2-Aug-09 14:34
professionalscottgp2-Aug-09 14:34 
GeneralRe: Accessing the file of a T-SQL BACKUP call Pin
Uwe Keim2-Aug-09 19:14
sitebuilderUwe Keim2-Aug-09 19:14 
AnswerRe: Accessing the file of a T-SQL BACKUP call Pin
Vimalsoft(Pty) Ltd3-Aug-09 4:50
professionalVimalsoft(Pty) Ltd3-Aug-09 4:50 
GeneralRe: Accessing the file of a T-SQL BACKUP call Pin
Uwe Keim3-Aug-09 6:00
sitebuilderUwe Keim3-Aug-09 6:00 
QuestionJoin performance Pin
Xmen Real 1-Aug-09 15:26
professional Xmen Real 1-Aug-09 15:26 
AnswerRe: Join performance Pin
Mycroft Holmes1-Aug-09 23:43
professionalMycroft Holmes1-Aug-09 23:43 
AnswerRe: Join performance Pin
Vimalsoft(Pty) Ltd2-Aug-09 21:46
professionalVimalsoft(Pty) Ltd2-Aug-09 21:46 
GeneralRe: Join performance Pin
Xmen Real 3-Aug-09 2:45
professional Xmen Real 3-Aug-09 2:45 
GeneralRe: Join performance Pin
Vimalsoft(Pty) Ltd3-Aug-09 3:07
professionalVimalsoft(Pty) Ltd3-Aug-09 3:07 
GeneralRe: Join performance Pin
Xmen Real 3-Aug-09 3:21
professional Xmen Real 3-Aug-09 3:21 
QuestionSQL query: Get correspondence descriptions instead foreign key IDs. Is that possible ? Pin
sdancer7531-Jul-09 5:00
sdancer7531-Jul-09 5:00 
AnswerRe: SQL query: Get correspondence descriptions instead foreign key IDs. Is that possible ? Pin
Blue_Boy31-Jul-09 7:12
Blue_Boy31-Jul-09 7:12 
QuestionSQL SP exception: "Incorrect syntax near '-'" Pin
cdietschrun31-Jul-09 4:14
cdietschrun31-Jul-09 4:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.