Quantcast
Channel: Transact-SQL forum
Browsing all 23857 articles
Browse latest View live

mysql linked server queries

hello everyone, after spending most of the day trying to figure this out i hope that you guys with more experience can provide some suggestions. i have been experimenting with the a linked server...

View Article


Check Before Insert

Hi ALL ,I have 2 tables . I need to write an insert script that should contain the logic of checking if the records are present in the destination table and then perform the insert accordingly .so 2...

View Article


Image may be NSFW.
Clik here to view.

How aggregate the data of an Amount field at different levels to a result set...

we are using  Sql server 2005.i have generated a result set using a recursive CTE with Multiple level based on the Child and parent relation ship.<o:p></o:p>The Below image is the Result...

View Article

Case statment in where contion

Hi can any once help me in how to use case statment in where condition ?i have report parameter @a which has 3 vaules 1,2,3 , now  i need to change where condition based on @a parameter value .any help...

View Article

I am trying to disable Triggers but this script not working?

CREATE PROC DisableTriggers AS DECLARE @Table_Triggers SYSNAME DECLARE Cursor_Disabletriggers CURSOR FOR     SELECT  object_name(parent_id)    FROM   sys.triggers   OPEN Cursor_Disabletriggers FETCH...

View Article


Different among ISNULL, NULLIF,COALESCE,IFNULL, and NOT NULL

What is different among ISNULL,NULLIF,COALESCE,IFNULL,and NOT NULLplease explain with example so i can understand clearlythanks

View Article

Query help

I need ALL records related to Table A returned from Table B where a certain condition on Table B is met along with any other records a person might have as long as 1 of them meet the condition....

View Article

Full text index and HTML

Full text on varbinary can interpret word, html and multiple other content types.When specifying html as doc type, the stop words should be defined to exclude tags when performing searches.Is there a...

View Article


Compare value of 1 table with another table

I have 2 tables, say tblA and tblB. tblA has columns Account, Symbol, SellBuy,Quantity. tblB has columns Account, Symbol, BuyQuantity, SellQuantity.If tblB has the same account/symbol with the opposite...

View Article


What is wrong with this Dynamic Sql Query?

A stored procedure using following dynamic sql --declare @Dictionaryvarchar(128) = 'Test' --declare @Stringvarchar(1000)='Test1' select @String = "select 202,'" + @Dictionary +...

View Article

migrating records to new table

Hi All , I am copying some rows from (oldCustomers) table to (newCustomers) table and I wanted to create a join table (LinkOldCustomersToNewCustomers) that will have old customers ids and new customers...

View Article

Question

How would I be able to do this? I would like to update a table called ARH based on a user defined table type. For each row in the user defined table I would like to get the @PaidInvoice (see #2) which...

View Article

SP_executesql Syntax error

I am trying to execute below Sp_executesql with multiple parameters,but keep getting a syntax errorMust declare the table variable "@DBname".SELECT   @FileDateList = filedate  files from TableASELECt...

View Article


Replace First three character T SQL Query

Hello All,I have table in which I have a column ITEMID ,ITEMID has data like this ITEMID ABC001ABC002AAA001Ab0011Ab0012AAA02I have to replace the ItemID which start with AAA and AB to...

View Article

Image may be NSFW.
Clik here to view.

Red X in results is SSMS

I've been using SSMS for many many years and I've never seen anything like this.  I execute a stored proc on a remote server and after a few seconds I get a large red X in the Results pain.  I've...

View Article


how to flag invalid data and dealing with outscope/outrange date

Environment: SQL Server 2008 R2Purpose: Data validation and proper handling. If the loaded data mismatch the following fields data range requirements, it will redirect those data into table A, while...

View Article

Case statement in where condition

Hi can any once help me in how to use case statment in where condition ?i have report parameter @a which has 3 vaules 1,2,3 , now  i need to change where condition based on @a parameter value .any help...

View Article


tSQL Recursive SUM

Hello,What I want happen is to add each number in the EmployeeCount column, order by date, until the sum is =>24.  If the condition is met return the date when it goes over 24.  How can I achieve...

View Article

Handle multiple input values in one SP Parameter

Hi ,I'm using that SPALTER Procedure [dbo].[SP_GSK_Value] ( @PSKUCode Varchar(50)=null)RIGHT NOW , @PSKUCode can accept one value based on this ..exec [SP_GSK_Value] 'AB001'FROM [GSKCH].[dbo].[SKUWISE]...

View Article

INSERT EVENT TRIGGER

Hi All,I am trying to INSERT INTO base table so that my trigger returns the expected output. But when I do that I get error-Msg 8152, Level 16, State 13, Procedure tr_tblemployee_ForInsert, Line 10...

View Article
Browsing all 23857 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>