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

Find Tables refered by stored procedures

Hi AllI need a script that returns list of tables being refrenced by stored procedure in sql server 2005 including cross databaserefered tables such as dbname.schemaname.tablename.I need this...

View Article


Extract data from internet

Hi,is there a way to link two SQL servers over internet ? I am trying to extract some data(should be live always) from one server which is hosted in one state to another.When user request for price, it...

View Article


Concatenating rows where some rows are NULL

How do I combine the comments based on each unique Tag_ID and code_page?It is sorted  by timestamp and hence code_page. I need to combine the comments for code_page 1 and those comments with NULL...

View Article

Image may be NSFW.
Clik here to view.

Pivot Columns With Unique data

Hello All... Can any one help me in writing the query to get my output... 

View Article

How to obtain a variable Server Account Name using an @SQl with an...

Hi,I am trying to make a flexible script to get the Service Account Name from several servers.I am using "servername.master.dbo.xp_instance_regread.......", but I want to use a variable for the...

View Article


Every Week Number in a Year

I want to display the week number for every year starting with 2013 and going forward.  I have an Order Detail table that contains the following:OrderNbr, RequestedShipDate, Item, QuantityI'm trying to...

View Article

Storing a Timestamp value

I need to read the last timestamp value (MAX(TimeStampValue)) from a table, store it in a separate table (TableMaxTimeStamp) and perform a comparison against another table and load delta records. I'm...

View Article

Image may be NSFW.
Clik here to view.

i want to place the value of a cell into another cell of diffrent field

i want to place the entity of "Name" column "TAYMOOR NASIR" in "Fathers_Name" column of "KHIZAR KHAN",  how can i do it. waiting......

View Article


Trim Function

Hi All,Please find below is my table script and sample data.declare @test table ( Account_Name VARCHAR(20) NOT NULL ,Account_ID INT NOT NULL PRIMARY KEY ,GOAL VARCHAR(50) NULL ) Insert into @test...

View Article


Converting Hexadecimal to Decimal

Good Day Fellow SQL Pro's,I have a task on my hands that has left me stumped. I need to convert data that I receive hourly which is in a hexadecimal format, from which I need to convert it into a...

View Article

Image may be NSFW.
Clik here to view.

Looking to write a query to give me the missing numbers in a sequence

My query here gives me a list of numbers: select distinct cast(SUBSTRING(docket,7,999) as INT) from [DHI_IL_Stage].[dbo].[Violation] where InsertDataSourceID='40'  and ViolationCounty='Carroll' and...

View Article

T-SQL Comments

Is there a way to comment t-sql without having to store the comments inside the stored procedure?  I'd like to document the code without having to necessarily alter the stored procedure.  I was...

View Article

Send data to CSV file using T-SQL

Hi Friends I would like send the data into CSV file using T-SQLCreate Proc [Sales]as begin select * from sales1 endI want to send this table data in CSV file every night.... is that possible ? Could...

View Article


Image may be NSFW.
Clik here to view.

T-SQL insert data if it is same day ignore if it is same week

I have to insert data into these tables - f_up_msg & then f_up_hst and source table is - nhst. I need T-SQL.I have to pick caseid's from nhst table and chose cas_notify + 7 . If I found same case...

View Article

partition by without sorting groupings?

Hi, I have a problem where I have to use a function like the row_number() function but when I do my groupings I don't want to reorder the whole table. So the result I want is in the sequence column of...

View Article


Find all Null Values for Each Row and Update Results in Another Column

I need to find all the columns that have a null value for each row and update the results in another column. Below is an example of what the data may look like with the column "MissingEntries" that...

View Article

Strange concatening text result

Hi everyone, I'm trying to build a new cube and I'm struggling to figure out a solution when I got the same id that change contract during the year, anyway I know this is TSQL forum my question is:I...

View Article


how to merge three columns values to single row values in sql server 2008

Hi Frds.....I have three quantity in my table.Quantity1,quantity2,quantity3this three quantity have different valuesex:quantity1 = 1000,quantity2=2000,quantity3=3000the three column combine 2 display...

View Article

inner join 6 tables

Hello All,             I have query optimization required to optimize query.The query consists of 6 tables inner join.Can anybody tell me which is best to optimize this query.

View Article

Populate Parent/Child records with "Family" value

Hi,I typically do the task I'm asking assistance with in Excel and it works great... the only problem is that it's VERY slow and takes a lot of work when over 1 million rows as you must split it up and...

View Article
Browsing all 23857 articles
Browse latest View live


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