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

Only functions and some extended stored procedures can be executed from...

Hi, I have this function called fn_GetTimedKey() when I run it in my SQL2005 environment it works fine. When I run it in my SQL2008R2 environment I get the error: Only functions and some extended...

View Article


EMONTH equivalent function in sql 2008

Hi,The output of select EOMONTH('2012-12-05')  is 2012-12-31in SQL 2012. Can you tell me the sql server 2008 equivalent function for end of this month ?thanks!

View Article


Insert data into SQL Table from another SQL Table with pipe delimited as one...

I want a query for the below scenario.. Please help. Table "A" : Part#   cost     shippinginfo           ShippingCostAB12    12.43    12|23|43|34         1.00|3.00|4.00|5.00CD34    15.00 56|65|78|89...

View Article

insert statement does not work

i have a proc.. it is kinda a huge with few temp tables, updates .this used to work fine ..i have a simple insert at the end of the proc. this doesnt function when i run teh proc.  but will run fine...

View Article

Image may be NSFW.
Clik here to view.

Plz help

Hi,I am having data as followsThe actual purpose is we neeed to print then onto the letters.but when I am having the blank/null it is bringing blanks in the addressas in32Miles,Lancashires7 2ad. on...

View Article


Send Email from SQL Server

Hi,I have a  Stored procedure which gives me output from job history. I need to take this output and send it as email to the team.I want to write SQL Code and schedule it from the SQL Agent .ThanksRohan

View Article

Query returns incorrect results

I have a database named Mirror1_Server, which is located in Windows Server 2008 and managed by MS SQL Server 2008. I used a static IP to connect: select * from...

View Article

Image may be NSFW.
Clik here to view.

Re: case

Hi,I am having data as followsI am trying to create a case statement such a way that if the  address1 is null it shoild pick address2and if address 2 is null then it should pick address3 and so...

View Article


Script to find who is trying take backup on Database

Hi,I have a script to find who is taking the database backup and physical device information, but i need to know which job is trying to run in a particular time to run the backup on...

View Article


create, drop, create same #temp is an error - why?

Why is this illegal?  Even a parse check generates the error!  SQL 2008 R2.Thanks,Joshcreate table #foo(i int); drop table #foo; create table #foo(i int); drop table #foo; /* Msg 2714, Level 16, State...

View Article

Group By Colunn Question

Woe the Problem:A table contains multiple entries for each student and has a row for each type of financial aid they have received.The record item types fall into ranges which represent Grants, Loans,...

View Article

Query Tuning - High CPU and IO v/s Resposne Time

Hi,I have a question regarding Query tuning that if it shows high CPU and IO intesive query but resposne time is ok so still nedds to be tuned or optimized?Example:While Runing tining script, if it...

View Article

Transaction context in use by another session in Sql Server 2008

Hi All, I have a stored procedure that uses SYNONYMS to insert and get data from (It´s a SQL Server 2008).If a point the ASP.NET application to my local database, it seems to works fine. But, if I...

View Article


show row data into columns

Hi guysi have data coming in multiple rows and want to show same data in columns like multiple colours per product. colour are fixed in numbers i.e only three colours are there per product not more...

View Article

CREATING A VIEW

Hi All,I have the following query which I received helps from our experts here in the forum.  I now want to create a view from the existing query:DECLARE @temp table ( CompanyID varchar(10),...

View Article


Select Statement with In and Like

I would like to find out how to use both keywords IN AND LIKE in a select statement or maybe another way to work around.  Here is the scenario.  I need to get data from a table including last name...

View Article

string concatenation in where clause

I'm trying to do this, just a simple concatenation on the join criterion:select*from[tblJudgement4] j4 innerjoin [tblJudgement4] jwhere j.LoanNum='000'+ j4.LoanNumMsg 156, Level 15, State 1, Line...

View Article


Image may be NSFW.
Clik here to view.

Updating large table take a long time.

I am trying to write a stored procedure to update a large table  .  The table is around 8M records and each time it will update around 15,000 records. Every time, it takes 60 seconds +  which will end...

View Article

multiple insert scope_identity

Hi.I have to insert several records in a table called detallelibrobancos and by each one create another record in table detalleconciliacion.If for example I insert a record in detallelibrobanco and it...

View Article

Working with aggregating information between columns

I know that I am probably not going about this query in the most efficient manner, but I'm working with my limited knowledge to try to accomplish this task, so if you know of a more simplified way of...

View Article
Browsing all 23857 articles
Browse latest View live