How can I get the result Select 1/100 => .010000 instead of Select 1/100.00...
In my T-SQL Why Select 1/100 => 0 But Selet 1/100.00 ==>.010000Thanksdmpcal
View ArticleProblem using T-SQL for Excel Import
In SSMS, working with SQL Server 2008 R2, I can choose Database, Tasks, Import which launches the SQL Server Import and Export Wizard. I can use the Wizard to create and save a SSIS package to import...
View ArticleNeed to combine month and year to get date YYYY-MM-DD format
Month and year are table fields and they will have values likeMonth in format = mm example 01year in format = YYYY example 2010Now i need to concatenate month and year to derive date .Expected result...
View ArticleI want sql querys in such away that when we enter date it should display name...
Is there any inbuilt function please give me query for thatjitendra
View ArticleHigh volume data to and from stored procedure
I want to design a couple of stored procedures of which one would receive a high volume of data and another will return a high volume of data. This is for an accounting solution where input of one proc...
View ArticleUnion on tables with parent-child records and Sorting
Hi,I have an application that has an existing query which returns org units (parent and child) from organization table with a sort on createddate + org_id combinationWITH Org_TREE AS ( SELECT *, null...
View Articlewhen I use debugger in sql server 2008 R2 Developer -- it deletes/removes my...
First I create #tmpTbls (Sql Server 2008 R2 Developer)create table #tmpTbls(tblName varchar(100))I get this message: Command(s) completed successfully. Then I add a breakpoint to the "declare ..."...
View ArticleSSDT script: Problem with order of 'DROP COLUMN' and 'DROP INDEX'
I am sorry! I posted this in the wrong forum. I reposted this question in the SSDT forum, but deleting this post seems to be impossible. Could a moderator delete this thread please?Dear colleagues,We...
View ArticleTrouble using a tariff table with banded pricing units to calculate a total...
I have the task of replicating a pricing model in SQL so that I can do some analysis on theoretical changes to tariffs. The tariffs I am working with are to do with distances travelled, and the price...
View ArticleTSQL query
Hi All,I am joining 4 tables below is the my syntax Select P1.Created,P2.[HQ Partner ID],P2.[HP Organization], P2.[Country],p2.[HQ Partner ID],p2.[Partner English Name],p2.[HQ Channel Segment], Case...
View Articleis it possible to make constraint something like if columnA=0,columnB...
hi i'd like to ask is it possible to make constraint something like if columnA=0,columnB shouldnt be null? thank u very muchbest regardsmartin
View Articlequery issue
I got the error while running the below query select name, right(subject,4) as sub from students group by name, sub
View Articlelogs of sqlserver goes to event viewer of windows OS , or there is any other...
Hi,this line is from following link"Logs the error in the error log and the application log for the instance of the Microsoft SQL Server Database Engine"1) i wanted to conferm are they talking about...
View ArticleDate wise Stock
Hi Everyone this is the original database table Item_NO Posting_date EntryType LocationCode Quantity I0013078 12-2-2013 4 RW003 -1 I0013078 12-2-2013 4 INTRNASIT 1 I0013077 12-2-2013 4 RW003 -1...
View ArticleSum of quantity according to the date
Hi Everyone,we have a table as given belowselect [Entry No_] ,[Item No_] ,[Posting Date] ,[Entry Type] ,[Document Type] ,[Document No_] [Description] ,[Location...
View ArticleOrder by one column, but keep related columns together
I have a view with a number of columns. For simplicity, lets say there are the following columns:SiteID, FeatureID, HighestScore, AverageScoreSo there is a site, with a number of features. Each feature...
View ArticleTrouble with joining based on various combinations of columns
HiI have a load of transaction data which I need to join to a rate table to find the correct rate to price on. The join should be one-to-one and the selection of the correct rate is based on various...
View ArticleT-SQL: Manual Backup of Multiple Databases
I am looking to change the way I do manual backups of multiple databases on the same instance of SQL Server 2008 R2.Currently I have T-SQL scripts for each database that look like this:BACKUP DATABASE...
View ArticleStored Procedure- Multil level employee hierarchy in the same row
I have an employee table where I have employee details which includes the following properties:EmployeeID, EmployeeName, ManagerID, DesignationCode.ManagerID maps to EmployeeID in the Emp table....
View Article