SQL Code To Use For Additional Search

Jul 6, 2005

I have code on a website that does a search to an Access database based on what the person enters as the search criteria.  My SQL code uses a like % statement for all the fields in the search criteria.  The problem is that the first and third search fields do no return the search criteria that is asked for.....The 2nd search field (Description) returns whatever is asked for.....   I did read up and found that the data must be character for the like statement.  Anyone have any other clues or where I can read up on this???????HTML SEARCH CODE:          <table ALIGN="CENTER" width="408" bgcolor="#FFFFFF" cellspacing="0" cellpadding="5">        <tr>    <td width="400" bgcolor="#3366cc" colspan="2">    <form method="post" name="DaForm" action="Makeit.asp" align="center">      <div align="center"><center><table border="1" width="350" cellpadding="3"      bgcolor="#3366cc">        <tr>          <td align="left" width="189"><select name="TypeSearch" size="1">            <option selected value="PartNumber">Part Number</option>            <option value="Description">Description </option>            <option value="Mfg">Manufacturer</option>          </select></td>          <td width="310" align="right"><input type="text" size="30" name="DaInBox"></td>        </tr>        <tr>          <td colspan="3" align="center" width="507"><div align="left"><p><input type="submit"          name="B1" value="Search!"><input type="reset" name="B2" value="Clear">          </td>        </tr>      </table>      </center></div>    </form>    </td>  </tr></table>Makeit ASP COde:

<%@ LANGUAGE="VBSCRIPT" %>

<html>

<head>

<title>Your Search Results!</title>

<meta name="Microsoft Border" content="lb, default">

</head>

<body>

<%

Dim MySql

 

Set cn = Server.CreateObject("ADODB.Connection")

cn.Open("parts")

MySql = "SELECT * FROM parts"

If Request.Form("TypeSearch") = "Part Number" Then

MySql = MySql & " WHERE PartNumber LIKE '%" &_

Request.Form("DaInBox") & "%'"

End If

If Request.Form("TypeSearch") = "Description" Then

MySql = MySql & " WHERE Description LIKE '%" & _

Request.Form("DaInBox") & "%'"

End If

Dim rs

Set rs = new Server.CreateObject("ADODB.Recordset")

rs.Open MySql, cn, 0,1

%>

<% If rs.BOF and rs.EOF Then%>

<h2 align="center">We did not find a match!</h2>

<%Else%>

 

<%If Not rs.BOF Then%>

<h2>Here are the results of your search:</h2>

<table BORDER="0" width="100%" cellpadding="3">

<tr>

<th bgcolor="#0366cc"><font face="Arial" color="#000000">Part Number </font></th>

<th bgcolor="#3366cc"><font face="Arial" color="#000000">Description </font></th>

<th bgcolor="#3366cc"><font face="Arial" color="#000000">Manufacturer </font></th>

<th bgcolor="#3366cc"><font face="Arial" color="#000000">Qty </font></th>

<th bgcolor="#3366cc"><font face="Arial" color="#000000">Condition </font></th>

</tr>

<%

Do While Not rs.EOF

%>

<tr>

<td><%=rs("PartNumber")%>

<%=rs("Description")%>



</td>

</tr>

<% rs.MoveNext

Loop

%>

</table>

<%End If%>

<%End If%>

<%

rs.Close

cn.Close

Set rs = Nothing

Set cn = Nothing

%>

<p>&nbsp;</p>

</body>

View 1 Replies


ADVERTISEMENT

Help With Search Code

Mar 17, 2004

I have been using the following code on a search page for some time, is has worked very well. We recently changed our database to support multiple addresses for each client. So I added the INNER JOIN on the tblClientAddresses. But now when I try to search on a ID I get an ambiguous cloumn name error on the ID. Can anyone see how I could correct this?

Thanks for any suggestions,


Sub BindDataForPaging(ByVal sortExpr As String)
Dim MyConnection As SqlConnection
Dim MySQLAdapter As SqlDataAdapter
Dim DS As DataSet
Dim ConnectStr As String
Dim WhereClause As String
Dim SelectStatement As String

If SearchLastName.Text = "" And SearchFirstName.Text = "" And _
SearchID.Text = "" And SearchCompanyName.Text = "" And _
SearchSal1.Text = "" And SearchComment.Text = "" And SearchAddress.Text = "" Then
Message.Text = "You didn't enter any search parameters. Try Again."
Exit Sub
End If

WhereClause = "Where "
If SearchLastName.Text <> "" Then
WhereClause = WhereClause & "[LastName] Like '" & _
SearchLastName.Text & "%" & "' AND "
End If
If SearchFirstName.Text <> "" Then
WhereClause = WhereClause & "[FirstName] Like '" & _
SearchFirstName.Text & "%" & "' AND "
End If
If SearchID.Text <> "" Then
WhereClause = WhereClause & "[ID] = " & _
SearchID.Text & " AND "
End If
If SearchCompanyName.Text <> "" Then
WhereClause = WhereClause & "[CompanyName] Like '" & _
SearchCompanyName.Text & "%" & "' AND "
End If
If SearchSal1.Text <> "" Then
WhereClause = WhereClause & "[Sal1] Like '" & _
SearchSal1.Text & "%" & "' AND "
End If
If SearchComment.Text <> "" Then
WhereClause = WhereClause & "[Comments] Like '" & "%" & _
SearchComment.Text & "%" & "' AND "
End If
If SearchAddress.Text <> "" Then
WhereClause = WhereClause & "[Address] Like '" & "%" & _
SearchAddress.Text & "%" & "' AND "
End If
If ClientTypeDrop.SelectedItem.Text <> "" Then
WhereClause = WhereClause & "[CLientType] Like '" & "%" & _
ClientTypeDrop.SelectedItem.Text & "%" & "' AND "
End If
If Right(WhereClause, 4) = "AND " Then
WhereClause = Left(WhereClause, Len(WhereClause) - 4)
End If

SelectStatement = "Select *,A.Address FROM tblClients INNER JOIN dbo.tblClientAddresses A ON dbo.tblClients.ID = A.ID " & WhereClause & " ORDER BY " & sortExpr

Try
ConnectStr = ConfigurationSettings.AppSettings("ConnectStr")
MyConnection = New SqlConnection(ConnectStr)
MySQLAdapter = New SqlDataAdapter(SelectStatement, MyConnection)
DS = New DataSet
MySQLAdapter.Fill(DS)
MyDataGrid.DataSource = DS
MyDataGrid.DataBind()
Catch objException As SqlException
Dim objError As SqlError
For Each objError In objException.Errors
Response.Write(objError.Message)
Next
End Try

End Sub

View 4 Replies View Related

Search Code

May 2, 2005

Hello.  I have gotten my search page to work when a user enters in the entire loan number.  I want to give them the option to enter in a partial loan number.  I have the following code for Access database.
 
If Page.IsPostBack Then
            MySearch = "loanno Like '*" & txtSearch.Text & "*'"
        Else
            txtSearch.Text = ""
End If
 
I need to convert this for a SQL database search.  I tried to substitute the * with % and I am still getting an error.  Does anyone know how to fix this problem. 
 
Also, It would be nice to make MySearch reference a stored procedure.  This would make the page much more flexible and powerful.  I am open to any recommendations.  Thank you.

View 4 Replies View Related

Search Sp Code For Text Value

May 10, 2000

I have a series of stored procedures defined in a SQL7 database and want search through all their code to find a particular text value (say the contents of a raiserror message for exampl). How can I do this without having to go into each one seperately and scroll through the code? Is it possible to do it from within SQL itself?

Thanks!

Steve Rock

View 1 Replies View Related

Site Search Code Help

Dec 27, 2006

I'm writing a search for our site and I'm running into a few problems.When I run the query like this, it runs just fine:Declare @Keywords varchar(2000)Select @Keywords = 'modern trial advocacy canada'Select product_id, name, count(name) hitsFROM estore_productsINNER JOIN sequenceON estore_products.name like '%' +Substring(' ' + @keywords + ' ',seq,CharIndex(' ' , ' ' + @keywords + ' ' , seq) - seq)+ '%'WHEREseq <= len(' ' + @keywords + ' ') andSubstring(' ' + @keywords + ' ', seq - 1, 1) = ' ' andCharIndex(' ' , ' ' + @keywords + ' ' , seq) - seq 0Group by estore_products.product_id, nameORDER BY Hits DESCBut when I add another column (for example a column called description)from the select statement I get this error:The text, ntext, and image data types cannot be compared or sorted,except when using IS NULL or LIKE operator.Long story short, what do I need to do to select more columns for thefinal output?Thanks,Ryan

View 4 Replies View Related

Postal Code Search And LIKE Statement

Oct 11, 2006

I'm trying to create a form that allows someone to find an
address from a postal code search in the database. My query works exactly as I’d
like in query builder using the following select:



Select [FIELD_LIST] from addresses WHETE POSTCODE LIKE ‘%’+@POSTCODE+’%’





I then pass the user entered post code to the select statement
which is executed. However, I’m getting some odd behaviour. Assuming there is
an address in the database with the post code 
“LS11 0ES”... 

If I search for LS11, nothing is returned;

If I search for LS11%, nothing is returned;

If I search for %LS11%, nothing is returned;

If I search for %LS11%%, the data is returned.

If I search for %LS%1%%, the data is returned (as is LS21
0ES etc. etc.).

 

However, I want the user to be able to enter shorter search
strings and it to pull all the data back out, so they can enter a substring
such as LS and it will pull out all the data without the users needing to enter
the full pattern of % symbols.



If I go into query builder (in visual web developer) and
enter just “LS” it works as I’d want, but not when pulled from a web page.



Any ideas?



Thanks

View 3 Replies View Related

Search All Code For Specific Keyword

Mar 14, 2008

This will work on SQL Server 2005 and later.
Since the code is building an XML string, keywords overlapping the magic 4000 character limit are fetched!SELECTp.RoutineName,
'EXEC sp_helptext ' + QUOTENAME(p.RoutineName) AS [Exec]
FROM(
SELECTOBJECT_NAME(so.ID) AS RoutineName,
(SELECT TOP 100 PERCENT '' + sc.TEXT FROM SYSCOMMENTS AS sc WHERE sc.ID = so.ID ORDER BY sc.COLID FOR XML PATH('')) AS Body
FROMSYSOBJECTS AS so
WHEREso.TYPE IN ('C', 'D', 'FN', 'IF', 'P', 'R', 'RF', 'TF', 'TR', 'V', 'X')
) AS p
WHEREp.Body LIKE '%YourKeyWordHere%'E 12°55'05.25"
N 56°04'39.16"

View 5 Replies View Related

SQL Full-Text Search In VB Code

Jul 20, 2005

I'm trying to execute a full-text query from a vb.net web application.The problem I have is that in SQL Server, the syntax for a full-textsearch isSELECT *FROM tableWHERE CONTAINS( *, ' "searchstring" ')For whatever reason, VB won't run that search string unless I eliminatethe double sets of quotes:SELECT *FROM tableWHERE CONTAINS( *, "searchstring")This will not work for a search phrase - only single words, and it alsowill not work for a wild card:SELECT *FROM tableWHERE CONTAINS ( *, "search*")The above does not work - I must assume that the double quotes areneeded for both wild card searches and exact phrase searches -The problem of course is that in vb code the SQL string is alreadyenclosed in search quotes - the single quotes are then used to indicatedouble quotes within the search.I have tried using two single quotes on either side of the string, butit doesn't seem to work. ie:"SELECT * FROM table WHERE CONTAINS ( ' '" & textbox1.text & "' ')"Does anybody have any ideas?Trevor Fairchild*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!

View 3 Replies View Related

T-SQL (SS2K8) :: Search Based On Table Name And Add Code To Existing Stored Procedures

Jun 30, 2014

Below is sample SQL:

SQL_1: Creates a database
SQL_2: Creates 2 stored procedures

Now, I need to search database SP`s for Table2 t2 ON t2.CID = t1.CID and ALTER them with Table2 t2 ON t2.CID = t1.CID.

INNER JOIN Table3 t3 ON t3.CID = t1.CID
WHERE CustGroup = 'Employees'SQL_1:
USE [master]
GO

[code]...

View 6 Replies View Related

SQL 2000 MS Search: Boolean Search Doesn't Work When Search By Phrase

Aug 9, 2006

I'm just wonder if this is a bug in MS Search or am I doing something wrong.

I have a query below

declare @search_clause varchar(255)

set @Search_Clause = ' "hepatitis b" and "hepatocellular carcinoma"'

select * from results

where contains(finding,@search_clause)

I don't get the correct result at all.

If I change my search_clause to "hepatitis" and "hepatocellular carcinoma -- without the "b"

then i get the correct result.

It seems MS Search doesn't like the phrase contain one letter or some sort or is it a know bug?

Anyone know?

Thanks

View 3 Replies View Related

Replication With Additional RAM

Oct 21, 2002

Currently both of our servers have 1 gig of RAM. We are adding and additional 1gig of RAM to our local server but none to the remote server. Transactional replication is performed between both servers in both directions. SQL Server is configured to dynamically configure memory on both servers.

Are there any issues or concerns that I should be aware of?
Thanks

View 1 Replies View Related

Adding An Additional Database

Feb 28, 2001

Hi,

What are all the performance parameters to be analyzed, in an existing production server, to accommodate an additional database.

Regards
Kalyan

View 1 Replies View Related

Additional Rows In Result

Feb 12, 2014

I have two tables that I am pulling data from to insert into a third table.

Table 1:
Organization Address Date
Name 404 St. 12/31/1999

Table 2:
Organization Software Type Quantity
Name SW1 5
Name SW2 6
Name SW3 7
Name SW4 8

My query looks something like this:

INSERT INTO Organization SW Reqs (Name, Address, Date, SW1 Quantity, SW2 Quantity, SW3 Quantity)
SELECT Table 1.Name, Table 1.Address, Table 1.Date,
(Select Table 2.Quantity Where Table 2.Software Type = 'SW1'),
(Select Table 2.Quantity Where Table 2.Software Type = 'SW2'),
(Select Table 2.Quantity Where Table 2.Software Type = 'SW3')
FROM Table 1, Table 2
WHERE Table 1.Organization = Table 2. Organization

Sadly, this query gives me four rows, one for each Software Type. I have tried putting DISTINCT after my SELECT, but that narrows it down to two rows only. I would really like to have just a one row result per organization.

View 2 Replies View Related

How Do I Insert Additional Table Between 2 Others?

Mar 10, 2006

Part of the code as follows:

SELECT
ARDoc."Cpnyid", ARDoc."Custid", ARDoc."CuryOrigDocAmt", ARDoc."DocBal", ARDoc."DocDate", ARDoc."Doctype", ARDoc."slsperid", ARDoc."Territory", ARDoc."RecordType", ARDoc."user7",
ARTran."CmmnPct", ARTran."CuryTranAmt", ARTran."DrCr", ARTran."ExtCost", ARTran."InvtId", ARTran."JrnlType", ARTran."Qty", ARTran."RefNbr", ARTran."Rlsed", ARTran."S4Future04", ARTran."S4Future05", ARTran."TranAmt", ARTran."TranClass", ARTran."TranDate", ARTran."TranType", ARTran."UnitDesc", ARTran."UnitPrice",
RptCompany."CpnyName", RptCompany."RI_ID",
Customer."Name",
Salesperson."CmmnPct", Salesperson."Name", Salesperson."SlsperId"
FROM
{ oj ((("SOLUSBS02APP"."dbo"."zARDoc_Comm" ARDoc INNER JOIN "SOLUSBS02APP"."dbo"."RptCompany" RptCompany ON
ARDoc."Cpnyid" = RptCompany."CpnyID")
INNER JOIN "SOLUSBS02APP"."dbo"."Customer" Customer ON
ARDoc."Custid" = Customer."CustId")
LEFT OUTER JOIN "SOLUSBS02APP"."dbo"."Salesperson" Salesperson ON
ARDoc."slsperid" = Salesperson."SlsperId")
LEFT OUTER JOIN "SOLUSBS02APP"."dbo"."ARTran" ARTran ON
ARDoc."Custid" = ARTran."CustId" AND
ARDoc."Refnbr" = ARTran."RefNbr" AND
ARDoc."Doctype" = ARTran."TranType"}

Currently, if a new rep takes over for an old ones invoices and accounts...he will also get credit on the report which this query is for. Instead I need to use a table SOShipHeader to be 'date sensitive'. SOShipHeader will have the correct 'SlsperID', but will still need to pull the name from Salesperson."Name"

My guess, would be that I need to wedge the SOShipHeader table between the ARDoc and Salesperson tables?

View 5 Replies View Related

How To Generate An Additional Field

Apr 11, 2006

I have the following fields in table A:

GL_ID|GL_Name_VC| Amount |Period_TI|Year_SI|
===================================================
1000| Sales_HW| -20,000.00 | 01 | 2005
===================================================
1000| Sales_SW| -10,000.00 | 01 | 2005
===================================================
1001| Cost_HW | 5,000.00 | 01 | 2005
===================================================
1001| Cost_SW | 5,000.00 | 01 | 2005

the fields above have the following datatype:

Fields | Datatype
===================================
GL_ID | Integer
GL_Name_VC | Variable Character
Amount | Integer
Period_TI | TinyInteger
Year_SI | SmallInteger

The above database is running on Microsoft SQL Server 2000 and i would like to query
for a report that looks something as below:

Sales Category | Sales | Cost | Profit
=================================================
HW |-20,000.00 |5,000.00| -15,000.00
SW |-10,000.00 |5,000.00| -5,000.00
=================================================
Total |-30,000.00 |10,000.00|-20,000.00


The above report have 4 columns, with last column being a calculated field (Sales-Cost)

Guys, hope someone out there can help me with the sql command for the above report?

View 2 Replies View Related

Creating Additional Instances

Feb 20, 2007

How do I create additional instances of any MSSQL 2005 service(specifically database and analysis) given that a default instance is present?

View 4 Replies View Related

SQL ExpresS OR Additional Licenses??????

Jul 31, 2006

We are
looking for a solution for a client that we will make software for. We are a ISV. After
completion of the software, our client then wants to sell this software to their
partners, people in that business, etc. We do not want to add any additional cost, by means of them(client(s)) purchasing
a server, server software or licensing. Is there any solution
that will make this work? A runtime or embedded database solution? If there is a
license we need to purchase, what would that be? SQL Express Edition work?

View 4 Replies View Related

Additional 0 To Column Data

Jul 6, 2006

Hi

I have a column in the db with serial number data, on a export that I am doing the data has to be 10 digits long the problem is not all of them are eg

12234

122334343

1234234567

how can i get it to look like this adding an 0 to the front to make the row 10 digits

0000012234

0122334343

1234234567

Thanks

View 6 Replies View Related

Adding Additional Column

Feb 29, 2008

Hi All,

I have developed a report using report viewer in asp.net web form. The report is generated based on the selection of Department. User have an option to multi select the departments so the department column grows. Lets say user select Business category first and generate the report then user decides to add another department say Engineering. No the report column headers will have addional column "Engineering". I have used the Matrix since I had to group by Name and dates. Everything is good so far.
Now I have to add an additional column "Notes" at the end of all the columns. If there is ony department is chosen then Notes column appears after that and if mulitple departments are chosen the Notes column should also appear after all the department column (at the very end).
I am really having hard time to accomplish this. Is there any suggestion or solution to finish this? I really appreciate your responses.

Thank you.

View 1 Replies View Related

Adding Additional Fields To ASPNETDB.mdf

Dec 28, 2006

I am attempting to add additional fields and data to the default users database that is created as a result of enabling roles on my website.  Is it possible to add additional data fields to this file?  Where can I find the commands to do this?

View 2 Replies View Related

FOR XML AUTO Returns Too Many Additional Elements

Jul 23, 2007

Hi, I use the FOR XML AUTO to retrive native XML from a database with:
SELECT [xml] FROM myxml WHERE id = 81 FOR XML AUTO, elements, root('ROOT')"
However it returns the database name and table name as parent elements. How can I return just my raw XML data without additional elements:
XML is Stored:
<ROOT>
 <CHAPTER>
  <TITLE>This is a test</TITLE> </CHAPTER>
</ROOT>
Returns:
<databasename>
<tablename>
<ROOT>
  <CHAPTER>
    <TITLE>This is a test</TITLE>  </CHAPTER>
</ROOT>
</tablename>
</databasename>

View 1 Replies View Related

Additional Criteria In LEFT JOIN

Jan 18, 2008

I have a stored procedure which is used to search records in the database based on the data sent from the web page. There are several search fields and all of them are in one table (Table1) except the "CallerName" field which is in a different table (Table2). Since I had to show CallerName also in the gridview apart from other columns, I did a LEFT JOIN (using field CallerNumber) to show all the required fields from Table1 and CallerName from Table2.
Now heres the problem. Since CallerName is a search criteria, its supposed to be in the WHERE clause after the JOIN or in the JOIN clause itself. The problem is, if I put it in WHERE clause, the result set doesn't show records from Table1 which do not have a matching CallerNumber in Table2. SELECT T1.CallerNumber, T1.DateCalled, T2.CallerName
FROM Table1 T1
LEFT JOIN Table2 T2 on
T1.CallerNumber = T2.CallerNumber
WHERE T1.CallerNumber = 'some number' AND T2.CallerName = 'some name' If I put it in the JOIN condition, it works just like a LEFT JOIN is supposed to work, showing all the records in Table1 and also those which had CallerName in Table2. SELECT T1.CallerNumber, T1.DateCalled, T2.CallerName
FROM Table1 T1
LEFT JOIN Table2 T2 on
T1.CallerNumber = T2.CallerNumber AND T2.CallerName = 'some name'
WHERE T1.CallerNumber = 'some number'

1st SQL won't work for me because it doesn't show all the records in Table1, even when no search criteria is specified.2nd SQL won't work for me because it shows more than required when just CallerName is sent from the web page as search criteria. It will show all the records where CallerName is "some name" and also all the additional records (since it is a left join).
Can I get the goodness of both in one or do I have to create two separate Stored Procedures?
Thanks all,Bullpit
 

View 11 Replies View Related

Additional Column To Table Not Getting Written To..

Feb 27, 2008

I added one crummy column to my table.  I updated the stored procedure and added the thing to the aspx page which is my form for adding an article. I have a strong feeling that something is foul over here...Why is it that Visual Studio will not allow me to capitalize the word get and when I delete the ()  after ShortDesc they immediatlye reappear and the get statement is set to get. Every other one of them, and there are 9 others use GET and there is no () after the public property variable name. Does anyone know the reason for this?  
Public Property Author As System.String
GETReturn _Author
End Get Set(ByVal Value As System.String)
_Author= ValueEnd Set
End PropertyPublic Property ShortDesc() As System.String
GetReturn _ShortDesc
End GetSet(ByVal value As System.String)
End Set
End Property

View 1 Replies View Related

Why Additional Information: System Error.?

Dec 18, 2003

I have a DataGrid, it will return a table in SQL2000 server.

the problem is:

no data in the datagird, only a record "null" in all field.

I find a sample is add a "sqlDataAdapter1.Fill".

but if I add the code:

sqlDataAdapter1.Fill(dataSet21);

I got the error:

---------------

An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll

Additional information: System error.

-------------

I have search this problem fix many many time, many people has this problem, looks like no result I can find.

Please help, thanks very very much.

Thanks.

View 2 Replies View Related

Dynamic Order By W/ Additional Parameters

Jan 16, 2006

I have a stored procedure that uses a dynamic order by statement.  This statement works okay until I try to select ticket's by userEmail which is passed in to my stored procedure as a parameter.  Here is the code that works for my dynamic sort order:
CREATE PROCEDURE [dbo].[SelectAllTickets]
@SortOrder varchar(250)
AS
SET NOCOUNT ON
Exec('SELECT a.TicketID, a.TicketDate, a.TicketName, a.TicketDescription, a.statusID, a.resolutionID, a.userID,
b.typeID, b.typeName,
c.userID, c.UserFirstName,
f.statusID, f.statusName
FROM Tickets a
LEFT OUTER JOIN Type b ON b.typeID = a.typeID
LEFT OUTER JOIN Users c ON c.userID = a.userID
LEFT OUTER JOIN Status f ON f.statusID = a.statusID
ORDER BY ' + @SortOrder)
I modied this procedure to create one in which I select tickets based on the userEmail as a criteria as well.. this one fails due to Incorrect syntax near the keyword 'BY'
CREATE PROCEDURE [dbo].[SelectTicketByUser]@SortOrder varchar(250),@userEmail varchar(50)
AS   SET NOCOUNT ON   Exec('SELECT a.TicketID, a.TicketDate, a.TicketName, a.TicketDescription, a.statusID, a.resolutionID, a.userID,  b.typeID, b.typeName,  c.userID, c.UserFirstName, c.userEmail,  f.statusID, f.statusName      FROM Tickets a  LEFT OUTER JOIN Type b ON b.typeID = a.typeID LEFT OUTER JOIN Users c ON c.userID = a.userID LEFT OUTER JOIN Status f ON f.statusID = a.statusID WHERE a.statusID <> 40 AND c.userEmail = ' + @userEmail + 'ORDER BY ' + @SortOrder)
Any ideas on what syntax I should be using? Thanks!

View 3 Replies View Related

Additional Data Files Not Filing

Dec 12, 2005

We have a quad sql server that runs OLTP transactions at the rate of
100's per second (read & Write).

We used to have all the tables on 1 file but started to notice high contention on this file. We added 3 more files to match the processor number. The problem is that the 3 additional files are not filling with data. Does anyone know why this happens or can reccommend a fix?
--
will

View 3 Replies View Related

ZOS DB/2 Linked Server Without Additional Software

Apr 23, 2008

I vaguely recall that there is a way to install a linked server or similar datasource on SQL 2005 without the need for ANY additional software... No drivers, no third party packages, just a moderately complex configuration issue.

Once the beastie was configured, you could assign linked server logins, build queries using four part names, etc with no significant restrictions.

Unfortunately, I don't remember the details of this feat of majik. Can anybody refresh my feeble memory?

-PatP

View 1 Replies View Related

Substring - Separating To 5 Additional Columns

Jun 6, 2014

I have data as below:

columnA
D7 330 4/13/2014 0:0:0 KUL PVG 4/13/2014 18:35:0 4/13/2014 19:15:0 4/13/2014 23:45:0 4/14/2014 0:45:0

How can I separate it to 5 additional columns?

columnB: D7 330 4/13/2014 0:0:0
columnC: KUL PVG 4/13/2014 18:35:0
columnD: 4/13/2014 19:15:0
columnE: 4/13/2014 23:45:0
columnF: 4/14/2014 0:45:0

View 7 Replies View Related

How To Get Additional Rows Based On Column Val

Mar 13, 2006

Hello,

I am unable to figure out how to proceed after trying for more than a day. Should I add a parameter to the stored proc? How do I proceed?

I need to be able to show data for EdgeID 2,3,5,6,20,21 and so on...Right now I am showing data for 1, 4, 19 and so on based on the ReltTotID based on the result set below. This is because the table that the query below is selecting from adds up all common EdgeIDs to give one row for example

EdgeID Desc TermType ReltTotID

1Global Edge Model w/ Fwd Earn II T 1
2Short Term Global Edge Model w Fwd Earn IIS 1
3Long Term Global Edge Model w Fwd Earn IIL 1
4Emerging Market Edge Model w Fwd Earn T 4
5Short Term EM Edge Model w Fwd Earn S 4
6Long Term EM Edge Model w Fwd Earn L 4
19SmallCap Edge Model w/ Fwd Earn T 19
20SmallCap Short Term Edge Model w/ Fwd EarnS 19
21SmallCap Long Term Edge Model w/ Fwd EarnL 19
35Global+EM Edge Model w Fwd Earn T 35


The final query result is :



EdgeID Description Short Desc PerID UnivID DefID

1Global Edge Global Developed 500622355938
4Emerging Market Emerging Markets 500632356039
19SmallCap Edge Small Cap Edge 500642364244


I would like it to be :

1Global Edge Global Developed 500622355938
2Short Term Global Developed NULL2355938
3Long TermGlobal Developed NULL2355938
4Emerging Market Emerging Markets 500632356039
5Short Term Emerging Markets NULL2356039
6Long Term Emerging Markets NULL2356039
19SmallCap Edge Small Cap Edge 500642364244
19Short Term Small Cap Edge NULL2364244
19Long Term Small Cap Edge NULL2364244


The stored proc query is as below:


SELECT
EdgeModelID = em.EdgeModelID
--, EdgeModelID = em.EdgeModelID
, Description = m.Description
, ShortDescription = ISNULL(emdn.ParameterValue, m.ShortDescription)
, ViewPermissionID = emdp_perm.ParameterValue
, EdgeUniverseID = univ.UniverseID
, EdgeDefinitionID = univ.MemberID

FROM OptMod..GO_EdgeModels em

JOIN OptMod..GO_Models m
ON em.EdgeModelID = m.ModelID
AND m.ModelType = 'E'
AND Status = 1

JOIN OptMod..GO_EdgeModelDisplayParameters emdp
ON emdp.EdgeModelID = em.EdgeModelID
AND emdp.ParameterName = 'NewEdge32 Screening'


LEFT JOIN OptMod..GO_EdgeModelDisplayParameters emdn
ON emdn.EdgeModelID = em.EdgeModelID
AND emdn.ParameterName = 'NewEdge32 Display Name'


LEFT JOIN OptMod..GO_ModelUniverses mu
ON em.EdgeModelID = mu.ModelID

LEFT JOIN OptMod..vUniverses univ
ON mu.UniverseID = univ.UniverseID

LEFT JOIN OptMod..GO_EdgeModelDisplayParameters emdp_perm
ON emdp_perm.EdgeModelID = em.EdgeModelID
AND emdp_perm.ParameterName = 'NewEdge32 Permissions'

WHERE em.EdgeModelID = em.RelatedTotalEdgeModelID



Thanks in advance!!!
sqlnovice123

View 1 Replies View Related

Install Additional Instance In A Cluster

Nov 27, 2006

I am looking for a best practice or any suugestion on the best way to install an additional Sql 2005 instance in a cluster environment. We have a production environment that is active/active/passive and need to install an additional instance with a little impact to the current production instances as possible. Ant suggestions or articles I can review?

View 1 Replies View Related

How To Add Additional Functionality To Parameter Boxes

May 18, 2006

Is there a way to add additional functionality to the report parameter boxes?

For example, when a user enters an invalid choice into a report parameter box, I want a popup balloon that tells them to try again.

I know how to do this for a regular Winform combobox, but can I implement an interface to override the default behavior of the report parameter boxes?

View 5 Replies View Related

Add Additional Right Scale On Chart Report

Jan 21, 2007

Hi there,

I have a case. I have 3 numeric fields and 1 category field to be displayed on bar chart reports. the problem is 2 of the 3 numeric fields have significant different scale value. so I need to add additonal scale at the right side of bar chart to represent 1 numeric fields + the 2 other numeric fields at the left side scale (Y). Please advice. Thanks.

R'gards

Toni

View 1 Replies View Related

Additional Problems With Reporting Services

Sep 16, 2006

I am trying to use Reporting Services but is proving more difficult than I envisaged. Here's the problem, when I try to use management studio to change the Server type to a Report server, it is disabled. Hence I cannot change it. When I read msdn, it stated that this was caused by the fact that report services was not installed. However, when I look at SQL Configuration Manager, it shows that Report Services is running. Am I not understanding something? What am I doing wrong?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved