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

Select daily data group by weekly in sql server 2008

hi friend i have following my table structure and data        CREATE TABLE [dbo].[Pairs_Details](       [sno] [int] IDENTITY(1,1) NOT NULL,       [userid] [nvarchar](50) NULL,       [date] [datetime]...

View Article


Advanced query with dynamic columns

Hi All,I have a table with structure shown below. I need to pull data out of this table and the output should be in a format indicated by the select statement below. I have the following questions and...

View Article


Query issue

I am writingansql query using CTE with pivot and i'm getting following errors :Msg 156, Level 15, State 1, Line 13Incorrect syntax near the keyword 'select'.Msg 102, Level 15, State 1, Line 13Incorrect...

View Article

latest data from the join tables

I have more than 20 tables joined in the query and need to get the latest date data from the left outer joined tables..Ex: select a.id,a.name,b.phoneno,c.address1,d.address2 from emp a left outer join...

View Article

many lines of codes into single line

I want to execute t-sql-query from VB.NET program. I wrote and successfully executed sql query in MANAGMENT-STUDIO-EXPRESS..  But the problem is that. The codes are of 10 lines. And i need single line...

View Article


how to retreive last record in table if we having lakhs of records

how to retreive last record in table if we having lakhs of records jitendra

View Article

how to use getAncestor(n),getdescendant(child,child) in sql why they are use...

how to use getAncestor(n),getdescendant(child,child) in sql why they are use please give me examplejitendra

View Article

Auto Scheduled run of the Sql server management studio or a auto refreshing...

Hi ALL ,This is a very different weird requirement but workaround  for one of my requirement  . Scenario is that sql server enterprise edition is installed on a vm . I create a session with the vm...

View Article


adding new sum of money to previously added money value and storing it as single

i have a table like this--ID------ TYPE----------AMOUNT154------- normal-----------1000168------- good--------------2000205------- best--------------5000Now if user re-enters record of same ID and of...

View Article


server to server data transfer

Assalam O AlaikumI've this query which works fine with single server database to database data transfer i.eINSERT INTO tblinfo(name) select name from testDB.dbo.tblInfo where name not in(select name...

View Article

How to let sql server 2008 know the table created at front end in c#

How to let sql server 2008 know the table created at front end in c#

View Article

The mail could not be sent to the recipients because of the mail server failure.

Hi,  I am configured Database Mail,But i am getting below error while i am sending Test mail.MessageThe mail could not be sent to the recipients because of the mail server failure. (Sending Mail using...

View Article

SProc is doing something really weird!!

I have a bunch of files in a folder. They start from 20140211, and go until the present.  Every weekday a new file gets dropped in this folder. Every day I run a batch process to pick up the previous...

View Article


Identifying a record for editing

I have an editor for T-SQL records. User selects a record visually and edits it. Some of the tables don't have a unique index for identifying the record. The table structure is not hard coded or known,...

View Article

Converting UNIX time stamp to local time using T- SQL

Hi All, I am getting DateTime in UTC time (UTC time (Coordinated Universal Time or Greenwich Mean Time))  using (datediff(ss, '1/1/1970', current_timestamp)) . I want to Convert this in my Local...

View Article


Trim leading zeros

My records are like this.Col1-----000010345600577050110009901090 I want to remove the zeros on the left and the answer should be like this. Col1-----134565775011991090 How to trim the leading...

View Article

does analytical function(lead(),first_value(),last_value(),lag()) are...

select Last_value(employeeid) from employeedoes it give me last rowjitendra

View Article


Keeping Large Database on a separate SQL server instance

I'm in the process of migrating some databases to SQL 2012 one of the database is a large database in comparison to the rest, it about 64GB and can grow to about 200GB. This database is currently...

View Article

Grant execute

The SS2008R2 Books On Line entry for "Grant" reports that this command is deprecated and is only included for Backwards Compatibility.  I've been searching the web to find the new modern way to carry...

View Article

I keep getting this error when doing a bcp export, why?

SQLState = S0002, NativeError = 208 Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Invalid object name 'SGMH_Reports.dbo.sp_RadLog'. SQLState = 37000, NativeError = 8180 Error =...

View Article
Browsing all 23857 articles
Browse latest View live


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