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

CONTAINS predicate and Quoted text.

Hi,I am using CONTAINS predicate to find out SQL - Keywords in sql query. e.g. sql query - drop table t1in above sql query it find out 'drop' keyword.my requirement is that - CONTAINS should ignore the...

View Article


Power Pivot

Hi ,I have a table that has customer,product,month ,year and month ,information . Now if the user passes the following value for the month period .Current Cycle ---  Current Month ,Previous Month  and...

View Article


T-SQL - Using Column Name in where condition without any references when...

Hi All, I am a newbie for T-Sql, I came across a SP where multiple tables are engaged using multiple joins but the where clause contain  a column field without any table reference  and assigned  for an...

View Article

year less then 49

Hi All,For dates, why do we need to check whether the year is less than 49 criteria. if it is less than 49 then 19 else 20?Thanks

View Article

ID Column Problem

I need to have a unique non-null column in my table. I have set up an identity column with auto-increment and that works fine with one exception.I often make mistakes when updating or inserting new...

View Article


Insert via openrowset

Hi,I know how to use openrowset to select  rows from a remote serverIs it possible to use openrowset to insert rows into a table on a remote server? Could you give an example of the code?

View Article

convert decode oracle pl/sq to ms sql and help required on logic

I have below oracle query need to converted to ms sql. I also want to add a record into journal table when a  insert portion is executed  "caseidinserted" and update portion executed then...

View Article

How to add 0's before the string in MS SQL server?

Hi,I need to add 0's to the left.my rule says that "loaded in this format:'002' + Equivalent SE PLU (5 digits) + '00000' + DV "Please provide the command which is equivalent to LPAD in oracle.Thanks in...

View Article


Required Output for Quarter

Hi  ,I have a table that has customer,product,month ,year and month ,information .Sql ScriptsCreate Table SampleRevenue (Customer varchar(30), Product  varchar(30), SMonth    int , SYear     int, Total...

View Article


Query to Locate Unicode Data types

I need a query to locate unicode data types?  Any takers?

View Article

Need SQL code to show data into regular text instead of breakage

Hi All,I have a table with one column, lets say DataField as varchar(255)If I run select statement I get like thisSelect DataField from tableOutput:DataField A:01 B:02 C:03 D:04 E:05But when I copy /...

View Article

Help with GROUP BY with SUM

Hello all:I have always struggled with getting this right, so hopefully someone can assist with this. Basically I have two tables:CREATE TABLE [dbo].[Placement]( [PlacementID] [int] IDENTITY(1,1) NOT...

View Article

Replace function - special characters

Hi All,       If my column is encountering special characters I would like to replace with blank. Special characters may vary from record to record. Sometimes it is @ sometimes...

View Article


Find stored procedures, views and table-valued functions that have SELECT *

How do I Locate stored procedures, views and table-valued functions that have SELECT '*' ? I am querying a database to locate all objects with SELECT '*'

View Article

Help in Complex query

Hi, I want to update the data of table #t1 and #t2 using the sample data. Help on this update.code_t1 column in #T1 and unique in #t1 and sharing the data in #t2 table. I want to update the @code_desc...

View Article


Tracking inserts and filtering by it

Hello everyone.  I would like some advice on how to keep track of items involved in an insert, while the insert query is running.  Once an item goes into a table, I don't want other items, related to...

View Article

merge with case

I need your help pls...I have a requirement in merge - how do I handle below scenario? I know i can't put 3 matched. when matched and s.efforts =0 then update table1 set field1=somevalue,...

View Article


Converting ALL CAPS data to real data - De-CAPITALIZING Addresses

I’m in a all SQLenvironment, so I need as “all SQL” an answer as possible.Can’t sell inserting a chunk of Java or whatever into an environment with no resources for that language.Anyone ever have to...

View Article

Required Output for Quarter v2 - Complex

hi All ,I have a table that has customer,product,month ,year and month ,information .Sql ScriptsCreate Table SampleRevenue (Customer varchar(30), Product  varchar(30), SMonth    int , SYear     int,...

View Article

Dynamic SQL for Primary Key Declaration

RequirementCreate primary key constraint on tables which have been dynamically created. Primary keys are supposed to be created in line with the information from the metadata table. Some tables have...

View Article
Browsing all 23857 articles
Browse latest View live


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