Monday, March 26, 2012
Named instance question
server/instancename resolve back to servername/? We are looking to migrate
over from using a named instance, to a default instance, but don't want to
have to go change all of the connection strings in many applications, to
that have named instances attached.
If so, can someone point me in the direction to do so?Only from the clients connecting to it. You can install MDAC 2.6 or later
and use the alias.
"Gary" <clgary@.yahoo.com> wrote in message
news:#j9tS57uEHA.1404@.TK2MSFTNGP11.phx.gbl...
> Can instance names be aliased back to the the default instance? ie can
> server/instancename resolve back to servername/? We are looking to migrate
> over from using a named instance, to a default instance, but don't want to
> have to go change all of the connection strings in many applications, to
> that have named instances attached.
> If so, can someone point me in the direction to do so?
>
Named instance question
server/instancename resolve back to servername/? We are looking to migrate
over from using a named instance, to a default instance, but don't want to
have to go change all of the connection strings in many applications, to
that have named instances attached.
If so, can someone point me in the direction to do so?Only from the clients connecting to it. You can install MDAC 2.6 or later
and use the alias.
"Gary" <clgary@.yahoo.com> wrote in message
news:#j9tS57uEHA.1404@.TK2MSFTNGP11.phx.gbl...
> Can instance names be aliased back to the the default instance? ie can
> server/instancename resolve back to servername/? We are looking to migrate
> over from using a named instance, to a default instance, but don't want to
> have to go change all of the connection strings in many applications, to
> that have named instances attached.
> If so, can someone point me in the direction to do so?
>
Named instance question
server/instancename resolve back to servername/? We are looking to migrate
over from using a named instance, to a default instance, but don't want to
have to go change all of the connection strings in many applications, to
that have named instances attached.
If so, can someone point me in the direction to do so?
Only from the clients connecting to it. You can install MDAC 2.6 or later
and use the alias.
"Gary" <clgary@.yahoo.com> wrote in message
news:#j9tS57uEHA.1404@.TK2MSFTNGP11.phx.gbl...
> Can instance names be aliased back to the the default instance? ie can
> server/instancename resolve back to servername/? We are looking to migrate
> over from using a named instance, to a default instance, but don't want to
> have to go change all of the connection strings in many applications, to
> that have named instances attached.
> If so, can someone point me in the direction to do so?
>
Wednesday, March 7, 2012
My vb form displays error data when the server is busy
My Vb form gives error data when the server is busy. I am using Sql Server as my back end and MTS in the middle.When I run the Qurey Analyser it returns the values correctly. I am getting the wrong data only when the server is busy.
Bye,
MError data? Do you mean bad data or do you mean an error message? What exactly are you getting?
blindman
my store procedure that call back itself doesn't seems to work.
I have written a store procedure that will delete the record and any children record of it. That store procedure is suppose to call back itself to for every children record, but it only seems to delete the first record (the parent record). Below is my store procedure, pls help.
CREATE PROCEDURE [deleteCMSPage]
(@.PROJ_CMS_PAGE_ID [int])
AS
/* do not delete page id 1 */
if @.PROJ_CMS_PAGE_ID <> 1
begin
-- For storing the list of child activities.
DECLARE @.page_list_cursor CURSOR
DECLARE @.CHILD_ID INTEGER
/* get the children of this page, for every child, call deleteCMSPage */
SET @.page_list_cursor = CURSOR FOR
SELECT PROJ_CMS_PAGE_ID
FROM TBL_PROJ_CMS_PAGE
WHERE PARENT_ID = @.PROJ_CMS_PAGE_ID
ORDER BY PAGE_ORDER
-- Populate the cursor.
OPEN @.page_list_cursor
WHILE (@.@.FETCH_STATUS = 0)
BEGIN
-- Fetch the details for next activity.
FETCH NEXT FROM @.page_list_cursor
INTO @.CHILD_ID
-- Calls itself, i.e
-- as parent to get all child nodes associated with it.
EXECUTE deleteCMSPage @.CHILD_ID
END
-- Close the cursor.
CLOSE @.page_list_cursor
-- Deallocate the cursor.
DEALLOCATE @.page_list_cursor
DELETE TBL_PROJ_CMS_PAGE
WHERE PROJ_CMS_PAGE_ID = @.PROJ_CMS_PAGE_ID
end
GO
The global variable @.@.FETCH_STATUS is set only when you perform a fetch. So the WHILE loop condition is wrong. You should code it like:
while (1=1)
begin
fetch...
if @.@.fetch_status < 0 break
...
end
|||I have change the code, and right now it only delete the first branch, eg. root, first child, child of first child ..etc, I am not sure why.
CREATE PROCEDURE [deleteCMSPage]
(@.PROJ_CMS_PAGE_ID [int])
AS
/* do not delete page id 1 */
if @.PROJ_CMS_PAGE_ID <> 1
begin
-- For storing the list of child activities.
DECLARE @.page_list_cursor CURSOR
DECLARE @.CHILD_ID INTEGER
/* get the children of this page, for every child, call deleteCMSPage */
SET @.page_list_cursor = CURSOR FOR
SELECT PROJ_CMS_PAGE_ID
FROM TBL_PROJ_CMS_PAGE
WHERE PARENT_ID = @.PROJ_CMS_PAGE_ID
ORDER BY PAGE_ORDER
-- Populate the cursor.
OPEN @.page_list_cursor
while (1=1)
BEGIN
-- Fetch the details for next activity.
FETCH NEXT FROM @.page_list_cursor
INTO @.CHILD_ID
-- Calls itself, i.e
-- as parent to get all child nodes associated with it.
EXECUTE deleteCMSPage @.CHILD_ID
if @.@.fetch_status < 0 break
END
-- Close the cursor.
CLOSE @.page_list_cursor
-- Deallocate the cursor.
DEALLOCATE @.page_list_cursor
DELETE TBL_PROJ_CMS_PAGE
WHERE PROJ_CMS_PAGE_ID = @.PROJ_CMS_PAGE_ID
end
GO
You have the CHECK for FETCH in the wrong place not like what I showed. Here you are checking FETCH_STATUS of some fetch operation that happened within the delete SP not the one before the call to the SP. So you should change below:
-- Fetch the details for next activity.
FETCH NEXT FROM @.page_list_cursor
INTO @.CHILD_ID
-- Calls itself, i.e
-- as parent to get all child nodes associated with it.
EXECUTE deleteCMSPage @.CHILD_ID
if @.@.fetch_status < 0 break
to:
-- Fetch the details for next activity.
FETCH NEXT FROM @.page_list_cursor
INTO @.CHILD_ID
if @.@.fetch_status < 0 break
-- Calls itself, i.e
-- as parent to get all child nodes associated with it.
EXECUTE deleteCMSPage @.CHILD_ID