Forum Replies Created

Viewing 15 posts - 391 through 405 (of 444 total)

  • RE: RPC yes possible, RPC no possible...what is it?

    The code is fine. there is something with the configuration of the linked server.

    Check the Linked Server properties --> Options --> RPC = True

    This will enable the Remote Procedure Calls...

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: Given an employee table( with columns Emp_ID,Emp_Name,Emp_Salary), how would you find out the fifth highest salary?

    How about this query...

    Select Top 1 TrainingPlanID from

    (Select Top 90 Percent TrainingPlanID from

    (Select top 5 TrainingPlanID from tblTrainingPlan Order by TrainingPlanID DESC) Q1

    order By TrainingPlanID ASC ) Q2

    Atif...

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: returning part of string value where separator is '-'

    I think you are looking for CHARINDEX,

    Declare @YourVal as varchar(12)

    Set @YourVal = 'V104 - Luis'

    Select Left(@YourVal, Charindex('-',@YourVal)-1)

    I hope it will help you...

    Atif Sheikh

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: Can SomeOne Explain

    ALOT of stuff on the net. Check this out...

    http://blog.sqlauthority.com/2007/06/03/sql-server-2005-explanation-and-example-self-join/

    Atif Sheikh

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: How to Change the default date format in sql server 2005...

    SET DATEFORMAT setting is used only in the interpretation of character strings as they are converted to date values. It does not affect the display of date values.

    MSDN http://msdn.microsoft.com/en-us/library/ms189491.aspx

    To get...

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: Insert a record and use new ID value to populate FK field in another table

    Dear thomas ,

    The logic described by dolly is right but I think that the syntax is incorrect...

    Set CId =if EXISTS (select CompanyID From Company Where CompanyName Like @CompanyName...

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: Rows per Table

    Sorry...

    didn't looked at the where clause...

    Atif Sheikh

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: Is there a System table that tracks table changes globally?

    There is a way to get the query text of the executed query on the server. I think you can filter the information on UPDATE / INSERT basis.

    This article was...

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: NVARCHAR(MAX) vs NVARCHAR(n)

    I think the following link can answer your question...

    http://www.sqlserverandxml.com/2008/01/varcharnvarchar-n-vs-max.html

    Atif Sheikh

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: Moving Database from one server to other, and rename it

    back-up and restoring with different name is the solution. But do keep in mind that teh physical names are not changed when you specify the name of the database while...

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: sql query

    use the following in the Order by clause instead of ct.date.

    CONVERT(float, ct.Date, 105)

    I hope it will help you.

    Atif Sheikh

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: Joining Tables without PK's

    It will be better for you to create PKs and FKs. But, generally these kind of databases (without PKs and FKs) have alot of data problems. Alot of Duplications, wrong...

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: Inserting value in existing record by condition

    Glad you got it...:D

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: Rows per Table

    Select Distinct a.rows,b.Object_id,b.name from sys.partitions a inner join sys.objects b on b.Object_id = a.Object_id

    where b.type = 'U'

    The logic is same as of Abhijit. It contains all the tables, regardless of...

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: Query Help

    Is there any PK FK relationship between the two tables?

    If yes, create a join between the tables using that column.

    Atif Sheikh

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

Viewing 15 posts - 391 through 405 (of 444 total)