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

sql server using active directory

In a sql server 2008 database, the person that has dba access thinks the user security rights are controlled by the active directory. The .net application and database was written by contractors that...

View Article


I want to add image in column is it possible then how to add image in data...

I want to add image in column is it possible then how to add image in data base  what data type we need to give we required any casting  please show me one examplejitendra

View Article


What's the error here?

CONVERT(varchar, CONVERT(date, Date), 3) AS Date,How do I put this in my where statementmy date is my database is date, and example is 15/2/2014

View Article

How to optimize sql query , store procedure to improve performance?

I read about sql server profiler and execute plan.But still not sure how to tune sql queries and store procedures.Anyone can share hands-on step by step experiences? I want to know how to tune one sql...

View Article

Get Last Record of same ColumnID

i am currently stuck on the following Task:i have a table that Looks similiar to this one| TableID | EntityID | InvoiceAmount|      Date      ||     1      |  46       | 300000         |14-01-2014||...

View Article


Average Function Not Working as Expected

If you try the following code without the zero, it returns the correct average of 1. Add the zero, and it returns the incorrect average of 0.Is it me? Why?DECLARE @Test AS TABLE(n INTEGER) INSERT INTO...

View Article

Expected End Statement

I cannot figure out what is wrong here.. I'm running this on a .asp page and it seems to work when inserting into a MS Access database but cant into MS SQL database..Error is at line starting with...

View Article

Pass parameters to ssis package through agent job.

I have a SSIS package that need couple of parameters to be mapped. The JOB is called from a Agent JOB and the JOB is called from a SP. How can I pass parameters via JOB?

View Article


Show 0 if there were none for the week

I am running the below query which has a calendar table that joins on the field missedday and will show a count by week of number of students out during that week.  Issue I have is that if by chance...

View Article


Help in union all with 3 queries

could anyone help me in using union all or other method to combine the below 3 queries?? ************* 1st Query   ************WITH a AS ( SELECTclientid,DATEPART(year, row_date) AS...

View Article

Tricky String Operation

I just need the second form of the name like "John Smith" or the name itself like "Jane Davis":DECLARE @Name TABLE (ID INT IDENTITY(1,1) PRIMARY KEY, Name nvarchar(256)) INSERT @Name(Name) SELECT...

View Article

Is reindexing and rebuilding statistics nessiary

I'm reducing the size of a SQL database from 115905 records to about 110000 records.  My SQL server administrator is nowhere to be found.  Is it critical to have the database rebuild indexes and update...

View Article

join two PIVOT table

with NoOfOrder as ( SELECT Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,Jan,Feb,Mar FROM ( select LEFT(datename(month,InvoiceDate),3) mon,InvoiceNo as InvoiceNo from tbl_InvoiceMain...

View Article


Activate Command Prompt from Stored Procedure

Hi I am connecting Sql Server and R together to perform some Statistical Analysis.The R script creates some plots which are Saved as Jpg into a SQL database which can be used for reports etc.Using the...

View Article

The conversion of a char data type to a datetime data type resulted in an...

I have the below query that works fine in non prod env while it throws above error in prod      filecreationdate has VARCHAR(100) datatype and the sample value in the table is 'Dec 19 2013 12:00AM'...

View Article


OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)"...

Hi,i tried in sql server 2008 by executing this querry.SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0;Database=d:\test.xlsx','select * from [sheet1$]')i got this error OLE DB provider...

View Article

Confused - How to Calculate Number of Days Between Dates but Exclude Weekend...

Hello - I've been tearing my hair out over this problem i'm trying to solve, probably just been staring at it too long which is making it worse -I have a series of open support tickets which are...

View Article


Replace Space in Full Text Search

In my query I am using a Function to look for Text.functionname(recordID)So I need to run a full text search in a large memo field where normally I can sayfunctionname(recordID) like '%abcd:%'.In this...

View Article

Function similar to Pivot

Hi All,I was told that there is a function which is similar to the Pivot function which coverts values from row to column can anyone tell me what that is ?Thanks,Prakash

View Article

Image may be NSFW.
Clik here to view.

Help in Writing a query - Tried but unable to put logic together

Hi, Before I ask for this help, I tried with Merge but couldn't get what I needed.so seeking some help in writing a query to move data  from source table to Target table. Query below is for sample...

View Article
Browsing all 23857 articles
Browse latest View live


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