Forum Replies Created

Viewing 12 posts - 1 through 12 (of 12 total)

  • RE: Linked Servers in all stored procedures

    Please run this query:

    Declare @Results Table

    (

    DBName nvarchar(256),

    LinkedServer nvarchar(256),

    SPName nvarchar(256)

    )

    declare @DBName nvarchar(256)

    declare @LinkedServer nvarchar(256)

    Declare @Qry nvarchar(1024)

    DECLARE LServerCursor CURSOR FOR

    SELECT Name

    FROM sys.servers

    WHERE server_id > 0

    OPEN LserverCursor

    FETCH NEXT FROM LServerCursor INTO @LinkedServer

    WHILE...

  • RE: Possible Update Statement Implementations

    To be on the safer side the first approach will be a better option.

  • RE: How to use a parameter in XML DataType Value method

    If you change the SQLTYPE to varchar the query will run but it will not give you the desired results.

    It will return

    (/PurchaseOrder/MemberNo)[1]

    Therefore when you change the datatype to int...

  • RE: Now my SP working slow?

    It seems that your are calling the SP in a loop for mulitple inserts.

    Calling SP again and again has its cost.

    Try calling the insert SP once even for mutiple inserts....

  • RE: Possible Update Statement Implementations

    There is no noticable difference between these two queries.

    If you look at the execution plan you will notice that both techniques have the same cost.

    It doesn't matter if you...

  • RE: getting at the guts of multiple flat files

    Please follow these steps:

    -Right click on Flat file connection manager and select properties

    -From the property window expand Expressions

    -Select connectionstring in property list box and expand expression

    -In the expression editor drag...

  • RE: CLR function with temp table

    I guess you are using a conventional DB connection string in your CLR function. If yes replace it with

    SqlConnection connection = new SqlConnection("context connection=true")

    This will use the connection of the...

  • RE: From Management studio

    No you cannot. You will have to write a TSQL.

  • RE: retrive the records between two dates in uk standard format

    I presume that the date in DB is in string format.

    Please refer to the following code:

    Declare @FromDate Varchar(10)

    Declare @ToDate Varchar(10)

    Set @FromDate = '1/5/2008'

    Set @ToDate = '31/7/2008'

    Create table #TT

    (

    ID Int,

    Date Varchar(20)

    )

    Insert...

  • RE: Executing T-SQL Batch Scripts stored on PC from DTS

    Please change

    Delete From #Temp Where Lower(IsNull(FileName, '')) Not Like '%.bat'

    to

    Delete From #Temp Where Lower(IsNull(FileName, '')) Not Like '%.sql'

    and

    Set @Cmd = '"' + @FilePath + '"'

    to

    Set @Cmd = 'osql -S....

  • RE: Executing T-SQL Batch Scripts stored on PC from DTS

    Just copy the script in SQL task and change the folder name to point to your DIR

    Declare @Folder Varchar(255)

    Declare @Cmd Varchar(1000)

    Declare @FilePath Varchar(1000)

    Declare @Ret Int

    If Object_ID('TempDB..#Temp') Is Not Null

    Begin

    Drop Table...

  • RE: INSERT & SELECT using Right Outer Join

    The insert into table has only three columns specified.

    Your select however has four columns selected

Viewing 12 posts - 1 through 12 (of 12 total)