• Return specific level parent

    Can anyone help? I have a table, with 7 records ID ParentID Level ------- ------------- --------------- 01 (empty) 1 A 01 2 BC A 3 X BC 4 B 01 2 DE B 3 Y DE 4 I need a query to return, for every record in the table, the corresponding 'Level 2' ID, excluding records with a Level of 2 or higher (i.e....

    Paulvian5 pointsBadges:
  • T-SQL Query- how to explode XML fragment stored as NText into table?

    I'm using a commercial storefront software that offers "extension data" fields as NText to store custom data. I am storing an xml fragment that looks like this: <priceSplit xmlns="http://tempuri.org/priceSplit.xsd"> <split> <type>Credit Processing Fee</type>...

    Lambrite5 pointsBadges:
  • Can I do create dynamic table while bulk insert ?

    Hi, I am Software Engineer, I am using SQL-SERVER, I have a issue with it. I want to write a query to dynamically create a table when using BULK Insert. No of Column is dependent upon no of fields available in first row. Assume that in each row no of column is same.Column name can be any string,...

    ARUNKUMAR1125 pointsBadges:
  • Writing a query in SQL for use in SQL Server 2005

    I’d like to write a query that would allow me to view items with a characteristic of my choosing and filter out the others. Is it possible to write something like this in SQL and use it in SQL Server 2005?

    SQL Server Ask the Experts2,585 pointsBadges:
  • Writing a specific query involving primary keys in SQL

    I need to write a query in SQL that will get the fifth-from-last record from my database when either a primary key is defined or no primary at all is defined. How would this query look?

    SQL Server Ask the Experts2,585 pointsBadges:
  • Running a stored procedure in SQL Query Analyzer or as part of a SQL job

    I have been trying to run a stored procedure in SQL Query Analyzer and as a step in a SQL job. If I run it in Query Analyzer, it takes less than a minute, but it takes considerably longer if it is run as a step. I use SQL Server 2000. Why would there be so big a difference?

    SQL Server Ask the Experts2,585 pointsBadges:
  • Create Stored Procedure based upon existing Stored Procedure

    How do I create a Stored Procedure based upon an existing stored Procedure in SQL Query Analyzer V 8.00.760

    Trainingit20 pointsBadges:
  • Error message in Query Analyzer on SQL Server 2005

    I am trying to run the following command in Query Analyzer on SQL Server 2005: use temp alter user [MY-LP79EFIWXO93login_a] with login = [MY-LP79EFIWXO93login_b] However, I keep receiving this error: Msg 102, Level 15, State 1, Line 3 Incorrect syntax near 'login'. Why might this be?

    SQL Server Ask the Experts2,585 pointsBadges:
  • Records with null value not in output

    See query: select distinct f2.description Business_Unit, f3.description Department, f4.description Function, a.segment5 Account, f5.description Account_Description, sum(nvl(d.entered_dr,0) - nvl(d.entered_cr,0)) Actual, (Select sum(nvl(dd.entered_dr,0) - nvl(dd.entered_cr,0)) from...

    Tams5 pointsBadges:
  • How Do I assign a value if a value in the field is empty

    In my script (that is not working yet) I want to make sure if "full_value" (a field) is empty in a particular record then the value zero will be inserted. This is working in Access, but I'm trying to rebuild the query in SQL. Thank you. SELECT DISTINCT oas_balance.cmpcode, oas_balance.el1,...

    Ilfoprog50 pointsBadges:
  • equivalent for crosstab query

    Is there any function in MySQL that can create a query similar to crosstab query in MS Access???

    Sgheorghian5 pointsBadges:
  • Saving the results of a SQL Server 2005 table query in a XML file

    I have data in a table on a SQL Server 2005, and I need to query this table and save the results in a XML file that conforms to a given XSD. Is there an easy way of doing this?

    SQL Server Ask the Experts2,585 pointsBadges:
  • Toggling a case sensitive query in SQL Server 2005

    It appears that my queries of stored procedures, tables, columns, etc. are case sensitive in SQL Server 2005. Is there a “case sensitive” option that I can toggle on and off?

    SQL Server Ask the Experts2,585 pointsBadges:
  • SQL Query

    I created a SQL query to restore several databases from a remote location to a test environment. I would like to add a check in the script so that it will not run if connected to certain servers so production databases are not accidentally overwritten

    Asdemers5 pointsBadges:
  • Create a sequence called Store_seq with the following values: increment by 10, start with 500

    Create a sequence called Store_seq with the following values: increment by 10, start with 500

    VB RD45 pointsBadges:
  • Looking for a database name query in SQL

    Is there a query in SQL that could return me the name of a database, or whether it is connected to SQL Server or Oracle?

    SQL Server Ask the Experts2,585 pointsBadges:
  • sql quries

    i m a beginer in computer science.so how can i make grip on oracle sql plus is there any website or any electronic book that contains preset quries on sql which can help me in working in sql i want a guide book which has quries to start and work in sql plus and developer.

    Yasir oracle5 pointsBadges:
  • Using co-related queries in SQL

    How do you use co-related queries in SQL and why would they be useful? Is there any effect on performance when executing a co-related query?

    SQL Server Ask the Experts2,585 pointsBadges:
  • iSeries DB2 SQL subquery to compare yesterday sales to 120 day ternd

    Hi, I have an SQL query that I would like to populate with veriable date information each time it runs. If I hard code the dates, I get the results I expect. However, I can not get the date parameters to work with my query. Here's the " Hard coded version (Works) SELECT...

    MarcGreen20 pointsBadges:
  • 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

    Abcp5 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following