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.
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 [...]
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 [...]
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 each period The Billing table is pre-populated with the charges per month as per the amortization schedule when a client [...]
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 mytable Not Recompile: insert #test [...]
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 [...]
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?
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.
Hell Kent, I read through “V5R4 SQL Packs a Punch” http://www-03.ibm.com/systems/resources/systems_i_software_db2_pdf_rcte_olap.pdf I would need the query in figure 20 and the result in figure 21 which do not show up in the article. I have a query similar to the example (parts of an iSeries Power5 server) that shows all the levels correctly, however, [...]
Hi, I need to pass a parameter into a stored procedure which values are dynamic always. Executing a variable which having the Select statement. Following query working fine. BEGIN DECLARE @strQuery NVARCHAR(MAX) DECLARE @CountryId INT DECLARE @CityId INT SET @CountryId = 2 SET @CityId = ‘ AND CityId IN (23,45,85,86)’ SELECT @strQuery= ‘SELECT VendorId From [...]
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 appreciatable…
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 ‘some_remote_db_name’; and [...]
I have table called country having one column called complete_name (varchar(max)) which is as under [table style="border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0"> [tbody] [tr] [td style="border: medium none #d4d0c8; padding: 0in 5.4pt; background-color: transparent; width: 6.15in;" valign="top" width="590"> [strong]complete_name[/strong] [/td] [/tr] [tr] [td style="border: medium none #d4d0c8; padding: 0in 5.4pt; background-color: transparent; width: 6.15in;" valign="top" [...]
hello, there are many indexes clustered an non clustered .so how can i see the result of each index, clustered and non clustered seperately through (T-SQL) pls guide me. RINO
Hi, How can i get the user names assigned to the Schema through (T-SQL) Regards; Rino
I have to pool data from 1000+ sites on different physical servers through a web service running on each server. What is the best way to do so using T-SQL so that the multiple threads/processes run in parallel
I want to have a stored procedure run on a schedule that automatically creates a database output file as a result and saves it to a specific location on my network. Can someone please tell me how to do this?
in both t-sql and pl/sql we can use if/else condition and jump into other statements..then actually what makes the difference between t- and pl sql lang?
I am having an issue to passing data between two SQL Server databases. I can not simply use Import/Export functions or Data Transfer Functions from SSIS because I was asked to transfer “20%” data with more than 15 criteria among 200 related tables. Also we are not allowed to use the linked server, which means I can not access [...]
Hi, Does anyone know the TSQL to change the identity column on a table in SQL Server 2000. And also the TSQL to change trigger to not for replication. Thanks





