selecting a record in reverse chronological order of entry
Hi,I want to select data from a table named tbllog. But the data should be displayed in reverse order of its entry..Means data entered today should be displayed in the top and the one entered last...
View ArticleUsing nested IF condition
I am making a vb.net project using SQL-SERVER at back end. Since SQL queries are lengthy i have to use STORED-PROCEDURE.. Following condition have to be tested in T-SQL. But my program frequently gives...
View Articlealter column set default value
hii am using following query to set default value for the columnALTER TABLE [Table] ADD CONSTRAINT [DF_Column Name] DEFAULT N'ABC' FOR [Column Name]and the drop default query isALTER TABLE [Table] DROP...
View Articlewhere clause gives me correct result
hi all, My doubt is when i give where clause with service call id , i am getting correct order of results for the specific order id .But when i give parameter instead of service call id , startdate and...
View ArticleAbout this thread
Can anyone see any answered post in this thread ?http://social.technet.microsoft.com/Forums/sqlserver/en-US/7ac0dc18-1ee6-4f6b-b50b-50aa6bb0d781/alter-column-set-default-value?forum=transactsqlIf we...
View ArticleFind missing IDs using high performance query
I have two tables. The first table contains IDs (unique records), say, 100,000.The second table does not contain all IDs of first table but may contain duplicate values.First TableID int P.KName...
View ArticleCreating temporary/virtual row on SELECT command of sql-server
my table contains 2 rows ( ''amount'' and ''received_from'')so each record will look like======================--amount------+---received from==========+===========- 2000----------+--...
View ArticleHow to Group discontinued time periods
Hi All: I have an issue which costs me bunch of time to develop. Basically I am trying to use discounted time in a select query but feel like get nowhere to start.the scenarios is like this:I have...
View ArticleQuery Rewrite - How to Avoid Multiple Left Outer Join
Hi, We have a database, using Entity–attribute–value model. So, we are using automatic SQL Query generations, which generates a lot of Left Outer Join. Is there a better way to write this query ? I...
View ArticleSame StoredProcdure giving different results at different time
Hi all,When i execute the same StoredProcedure , I am getting different results (Count of value is different )for first time i execute i am getting expected count but at the 3rd or some times i am...
View ArticleSplit rows into several rows
Hi,I have a data that look like this sta.0; from 0, to 1; 5%;boulder; 5%;sand;20%; siltI need the data to look like this:sta. 0; from 0; to 1; 5%;bouldersta.0; from 0;to 1; 5%; sandsta. 0 from 0; to 1;...
View ArticleMigration from Oracle To SQl Server
Could you please suggest how can we migrate data from Oracle database to Sql Database.Currently the system is having Oracle DB and now it has been decided it need to be migrate to SQL Server We need...
View ArticleTrying to join two views that have different column types
I want to join view1 and view2 on region and city int columns. Need to break apart View1 varchar field into two Int fields and replace any non-numeric values with zeros.View1 has a single Region_City...
View ArticleEmployee Project Date
Hi I am currently on a project and i need some help.I need to create a trigger to stop an insert into the project table if the date of the project newly inserted is between the start date and end date...
View ArticleSQL Query
IDNAME1Deepak Kumar2Sourabh Shrivastav2Amit Wadhwa3Ashutosh Tripathi3Ashutosh Kumar3Rizvi “NameList” table has name of persons with ID.Select query is required for following condition:If the Id’s are...
View ArticleTransfer Mysql database to another computer.. need help..
i need help to transfer mysql database to other computer. i read a lot of forum but still did not understand.. some video also but still confuse.. can anyone help me.. that teach step by step.. if...
View ArticleIs There any difference in Set @Var=ColmnName and Select @Var =Column from...
hey there, Kindly elaborate me the difference Between Set and Select clause while Providing value to a Variable or Even a Column. Declare @var nvarchar(Max) Set @var= (Select TestName+...
View ArticleDoes identity value genrator for col is locked in some cases.
http://msdn.microsoft.com/en-us/library/ms186775(v=sql.110).aspxEach new value for a particular transaction is different from other concurrent transactions on the table.q1) Does that mean i can insert...
View Articlevalidating table schema - can I switch this off?
Hi guys,I have an annoying issue with SQL in that when I try to reference a column in a table (that doesn't exist yet) I get an error in ssms prior to executing. Is there any way I can turn this off?...
View ArticleIs there a way to select a max row for each group in SQL ( with distinct code )
Dear friends, My table is as show in below… for each ‘grpid’ I want get row with Max tiv value and code should be distinct. Ie in result, code & grpid will come only...
View Article