Difference between SELECT .. INTO and INSERT.. SELECT
Hi All,I am on SQL Server 2008 R2. I have a very basic question.What is the difference between SELECT ... INTO command and INSERT ... SELECT command, when inserting data into a tamp table or even a...
View ArticleBest Practice in Scenario
I am currently trying to accomplish the following:get the Last Weekstamp for the last 6 Months, the following ilustrates how the end result might look like:MonthĀ Ā | Weekstamp |2013-12|Ā 2013-52...
View Articleinner join through View extremely slow
I have a very large database (several TB) where I am doing a complex inner join between three tables. The largest of the tables has a simple View on it. In fact, it looks pretty much just like the base...
View ArticleDifference between SQL SERVER 2008 & SQL SERVER 2012 & SQL SERVER 2014
Difference between SQL SERVER 2008 & SQL SERVER 2012 & SQL SERVER 2014 ?
View Articletsql max
HiIn the below scenario i need to update theI need to update the flag value to 'Y' for each ticket which has highest priceCreate table #SLA ( Ticket varchar(20),sdate datetime,price decimal(8,2),Item...
View ArticleHow to output the database backup to a log file
I am running MS SQL Server 2008 R2.Ā I just want to know if there is a way to output the backup job results to a txt file.Ā I have another program that reads the text file to see it is failed or...
View ArticleNeed help with DATEDIFF query
I have found several samples for this, but none are quiet the same as what I need to do (note: I am running this query in a vb.net form to an access database, not sql - still figured this was the best...
View ArticleManage SQL Server Agent Jobs
What is the best way to manage SQL Server Agent Jobs?Requirement: If any job fails I need an entry(log)Ā to be done in a table.Please use Mark as Answer; if my reply solved your problem. Use Vote As...
View ArticleSQL COUNT data by date, and then COUNT by date range
Hi All, hoping someone can help point me in the right direction here. I am using SQL2005 and need to perform some counts based on date ranges.An extract of table looks as follows (real table is several...
View Articlesql Query to replace the square bracket and the whole text inside with a...
Hi All,I Ā have a question.I am using Sql Server 2012.I have a Ā situation where i need to replace the entire text and the square bracket with a single charecter.Eg:->Ā I have atext...
View ArticleHow to convert from XML to tdataset
Hi Experts, I amĀ struggling to get from xml to dataset.Ā Ā XML Like:Ā <BudgetGroups><BudgetGroup GroupID="001"Ā Description="Soft costs"><LineItems>Ā Ā <LineItem LineItemID="01"...
View ArticleLinked List Like Tables
Dear AllThank you for your attention.I am writing a hiking guide system that helps user to find out if they go wrong path.I would like to know the BEST PRACTICE and DATA TABLE STRUCTURE for storing the...
View ArticleError converting data type nvarchar to bigint.
hi alli used this t-sql codesSELECT PAH.TypeRef,PAH.ProductActionHeaderNum,PAH.ProductActionHeaderDate,PAH.AccountDetailRef ,AD.AccountDeatil ,PAH.StorageRef ,S.StoragesName...
View Articledoes derive table use where clause fillters inside
dear all.Table "A" has two cols aid and col1 , aid is pk.Table "B" has two colsĀ bid , aid , and colb .followin query can be formulated in other ways ,but i wanted to ask something about query...
View ArticleDifferent row counts between SQL management studio and Visual Studio
HiI'm pulling data from a NAV database using a stored procedure containing a Pivot (due to bad table design), the problem is my SQL management studio is returning 53 rows of records yet Visual studio...
View ArticleIdentity column
Hi Experts,i need your help for the following:Assuming that i have a table called temp with just one column (ID) which is an identity column, and its having 1000 rows having values 1 to 1000. Suppose...
View Articlehow would I write this query
[USERNAME][GROUP]User1New MemberUser2New MemberUser1All MembersUser1Gold MemberHow would I write a query so that I could select * from the above table where a user has more than 1 group (user1) and if...
View Articlegenerate random string of length 5 [A-Z][0-9]
I want to generate random string of length 5 from the following range [A-Z][0-9]Any help.....saleem
View ArticleHow to cast a column of a derived column in a view to NULL
I have a derived column in my view and this column by default is picked up as not null.I want to cast it to null how can i do it ?Actual columncolumn1 varchar(3) not nullExpected columncolumn1...
View ArticleMicrosoft TechNet Wiki T-SQL Guru - Winners for January!!
The results for January's TechNet Guru competition were posted!http://blogs.technet.com/b/wikininjas/archive/2014/02/16/technet-guru-awards-january-2014.aspxPost your FEBRUARY contributions...
View Article