• I need help creating a delimitted string in DB2

    Over the past few days, I've been trying to create a delimited string from the results of a query in DB2 on iSeries. I was able to do it in T-SQL but am struggling here.Here's the code I used in T-SQL. I'm basically looking for the equivalent in DB2.DECLARE @a VARCHAR(1000) SELECT @a = COALESCE(@a...

    ITKE342,985 pointsBadges:
  • how can make this SQL Server query faster

    All, how can I make this query faster? Here is my code of stored procedure: ALTER procedure [dbo].[GetLMPReport] ( @typeId tinyint, @dataType varchar(2), @date date ) AS begin select distinct p.name, ISNULL (td24.price, 0) as '00', ISNULL (td1.price, 0) as '100', ISNULL (td2.price, 0) as '200',...

    Singhal120 pointsBadges:
  • SQL Server 2000/2005 – Creating Unique Constraints allowing multiple NULLs

    Hi there! I'm having a problem maintaining data integrity on a database table in MS SQL-Server 2000. To ensure maintaining the integrity I need to implement a Unique Constraint on one of my coloumns. The problem however is, that this coloumn also has to allow multiple NULL-values - but for every...

    LeChuck0 pointsBadges:
  • Did the Database Designer change for Visual Studio 2012?

    I've recently installed Visual Studio and SQL Server 2012 onto my machine. I've noticed the Database Designer isn't as 'friendly' as the old version. Here are some of the changes I've noticed:It creates .SQL scripts instead of automatically saving my changes.I have to update different things in...

    ITKE342,985 pointsBadges:
  • T-SQL: Split function

    I'm trying to split "1, 2, 3, 4, 5, 6, 7, 8, 9, 10" into a table or table variable. Is there a function that returns each number in a row?

    ITKE342,985 pointsBadges:
  • Difference between SQL Server 7 & SQL Server 2000

    Hi, Can you tell me difference between SQL Server 7 and SQL Server 2000?

    Marshal0 pointsBadges:
  • SQL and T-SQL

    If you are used to programming in SQL, will there be any issues with switching to T-SQL?

    lprice230615 pointsBadges:
  • Count distinct rows on multiple columns

    I want to write a single query that counts each distinct Student ID from the following sample data. Sample Data: ID NAME PLAN DESCR --- ------- ---- ------------------- 101 Michael 010C Cafe- 10.00 Dollars 102 Adam 010C Cafe- 10.00 Dollars 102 Adam 05CC Cafe- 5.00 Dollars 103 Jane 010C Cafe- 10.00...

    Mjackson0 pointsBadges:
  • Referencing a calculated column in a SQL clause

    This is our SQL code: Select addrid,addrkey,addrline1,addrline2,addrline3,addrcity,addrplace,addrzipcod,addrtype,addrphone,jobsconame,addrmc1, CASE month(getdate()) WHEN 1 THEN addrjan WHEN 2 THEN addrfeb WHEN 3 THEN addrmar WHEN 4 THEN addrapr WHEN 5 THEN addrmay WHEN 6 THEN addrjun WHEN 7 THEN...

    SQL Server Ask the Experts2,585 pointsBadges:
  • SQL or T-SQL

    This question related to this thread: http://itknowledgeexchange.techtarget.com/itanswers/difference-between-sql-and-t-sqlmicrosoft-sql-server-2000/ So if I want to study SQL server, should I first study SQL and then T-SQL or just dive right in to T-SQL.

    BJ20125 pointsBadges:
  • How to add two timings in SQL Server 2008

    DECLARE @TIME1 VARCHAR(10),@DURATION VARCHAR(10) SET @TIME1='10:00' SET @DURATION='00:25' SELECT CONVERT(TIME(0),@TIME1)+CONVERT(TIME(0),@DURATION) I need to add two timings ...suppose if the @time1 is '10:00' and the duration is '15' mns then it should show 10:15 ... Any help highly...

    Muralihan5 pointsBadges:
  • How do I subtract 3 days from current date only when current day = 2, so that I retrieve the previous Fridays date?

    I am new to using T-SQL, so there is probably an easy way to accomplish this, but I can't seem to get it right.  I want to retrieve the previous day's date (requires a weekday) to use as a comparsioin to a date field in the table, format is YYYYMMDD.  When the current date is a Monday, I need to...

    Kathyb6245 pointsBadges:
  • Ageing Report T-SQL

    Im trying to write a query to retrive debtors ageing report in sql I have two tables [strong]1. Billing(billAmount,BillDate,AccountNo)[/strong] [strong]2.Payments(payAmount,payDate,AccountNo)[/strong] I need the output to show ageigng [strong]0-30, 31-60, 61-90, 91+[/strong] with the balances for...

    Sanisto45 pointsBadges:
  • t-sql and AS400

    I want to develop a TSQL query. First I need to determine if all the numbers in one of the fields are in numerical order and also find the missing holes in the number sequence. Secondly I need to sort by another field and by a particular criteria.  The words that I need to sort-by would be...

    CompEng1,185 pointsBadges:
  • Calling stored procedure in a database to query data in another database

    Hello, I am writing a stored procedure that will query data from another database, but the database name is variable. Do I have to use a dynamic query? We dont want to use dynamic queries because of performance loss. But is there a way to do it without a dynamic query? Example GetData...

    Ncs5 pointsBadges:
  • Convert Oracle code to Microsoft SQL code

    I've been given an Oracle DB that has some triggers and "LOAD DATA" jobs. Is there a tool/utility to convert the triggers/loads from PL/SQL into T-SQL?

    VelameLaCosa110 pointsBadges:
  • SQL Server 2008 Insert Into vs Insert Statement Recompile

    I have a stored procedure that executes a t-sql statement using sp_executesql. This t-sql code recompiles everytime it runs using "INSERT INTO" but when I use "INSERT" only it will not recompile. What is going on here? sample: create table #test (id int) Recompile: insert into #test select id from...

    Rick Martinez585 pointsBadges:
  • How to concat SQL Server 2005 data with line feed

    I am attempting to update a column in SQL Server 2005 by concatenating data from two other columns and include a line feed between the two and have the second line begin with a /. The data will be viewed through an MS Access 2003 database with a linked table using an ODBC connection. The script I...

    TLMercer45 pointsBadges:
  • iSeries SQL ISNULL Equivalent

    What is the equivalent of the function ISNULL in t-sql in AS/400 iSeries Navigator SQL? or the equivalent of the NZ function in Access?

    Jaggerdude60 pointsBadges:
  • T-SQL Programming Tutorials

    I am looking for a website that is free and where I can learn to write better T-SQL views and stored procedures.  Also, would like to find some good books to learn more about managing a SQL 2005 database.

    Luby10 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