Showing posts with label mssql2005. Show all posts
Showing posts with label mssql2005. Show all posts

Friday, March 9, 2012

MSsQL2005; OPENROWSET, BLOB/IMAGE and STORED PROCEDURE problems

All,

I work with Microsoft SQL Server 2005 on windows XP professional.
I'd like to create stored procdure to add image to my database (jpg file).
I managed to do it using VARCHAR variable in stored procedure
and then using EXEC, but it don't work directly.

My Table definiton:
CREATE TABLE [dbo].[Users](
[UserID] [int] IDENTITY(1,1) NOT NULL,
[Login] [char](10),
[Password] [char](20),
[Avatar] [image] NULL,
CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED
(
[UserID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

My working solution using stored procedure:
ALTER PROCEDURE [dbo].[AddUser]
@.Login AS VARCHAR(255),
@.Password AS VARCHAR(255),
@.AvatarFileLocation AS VARCHAR(255),
@.UserId AS INT OUTPUT
AS
BEGIN
SET @.Query = 'INSERT INTO USERS ' + CHAR(13)
+ 'SELECT '''+ @.Login + ''' AS Login, ' + CHAR(13)
+ '''' + @.Password + ''' AS Password,' + CHAR(13)
+ '(SELECT * FROM OPENROWSET(BULK ''' + @.AvatarFileLocation + ''', SINGLE_BLOB) AS OBRAZEK)'
EXECUTE (@.Query)
SET @.UserID = @.@.IDENTITY
END

I'd like to use statement in the stored procdure:
ALTER PROCEDURE [dbo].[AddUser]
@.Login AS VARCHAR(255),
@.Password AS VARCHAR(255),
@.AvatarFileLocation AS VARCHAR(255),
@.UserId AS INT OUTPUT
AS
BEGIN
DECLARE
@.Query AS VARCHAR(MAX)

SET @.AvatarFileLocation = 'C:\hitman1.jpg'
INSERT INTO USERS
SELECT @.Login AS Login,
@.Password AS Password,
(SELECT * FROM OPENROWSET(BULK @.AvatarFileLocation, SINGLE_BLOB) AS OBRAZEK)


SET @.UserID = @.@.IDENTITY

END


It generates error:
Incorrect syntax near '@.AvatarFileLocation'.

My question is:
Why it does not work and how to write the stored procedure code to run this code without errors.

Thanks for any reply

You can't use a variable inside OPENROWSET.

What you are doing, in any case, IS VERY DANGEROUS. There

are many ways in which dynamic SQL is vulnerable to SQL

injection. Please read about it, so that you don't lose

everything you have when a malicious user joins your

site/forum with a password like

O',0x; delete from USERS where Password <> 'O';return 0;--

You might start reading here:

http://www.sommarskog.se/dynamic_sql.html

Steve Kass

Drew University

Michal1979@.discussions.microsoft.com wrote:

> All,

>

> I work with Microsoft SQL Server 2005 on windows XP professional.

> I'd like to create stored procdure to add image to my database (jpg

> file).

> I managed to do it using VARCHAR variable in stored procedure

> and then using EXEC, but it don't work directly.

>

> My Table definiton:

> CREATE TABLE [dbo].[Users](

> [UserID] [int] IDENTITY(1,1) NOT NULL,

> [Login] [char](10),

> [Password] [char](20),

> [Avatar] [image] NULL,

> CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED

> (

> [UserID] ASC

> )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]

> ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

>

> My working solution using stored procedure:

> ALTER PROCEDURE [dbo].[AddUser]

> @.Login AS VARCHAR(255),

> @.Password AS VARCHAR(255),

> @.AvatarFileLocation AS VARCHAR(255),

> @.UserId AS INT OUTPUT

> AS

> BEGIN

> SET @.Query = 'INSERT INTO USERS ' + CHAR(13)

> + 'SELECT '''+ @.Login + ''' AS Login, ' + CHAR(13)

> + '''' + @.Password + ''' AS Password,' + CHAR(13)

> + '(SELECT * FROM OPENROWSET(BULK ''' + @.AvatarFileLocation + ''',

> SINGLE_BLOB) AS OBRAZEK)'

> EXECUTE (@.Query)

> SET @.UserID = @.@.IDENTITY

> END

>

> I'd like to use statement in the stored procdure:

> ALTER PROCEDURE [dbo].[AddUser]

> @.Login AS VARCHAR(255),

> @.Password AS VARCHAR(255),

> @.AvatarFileLocation AS VARCHAR(255),

> @.UserId AS INT OUTPUT

> AS

> BEGIN

> DECLARE

> @.Query AS VARCHAR(MAX)

>

> SET @.AvatarFileLocation = 'C:\hitman1.jpg'

> INSERT INTO USERS

> SELECT @.Login AS Login,

> @.Password AS Password,

> (SELECT * FROM OPENROWSET(BULK @.AvatarFileLocation, SINGLE_BLOB) AS

> OBRAZEK)

>

>

> SET @.UserID = @.@.IDENTITY

>

> END

>

>

> It generates error:

> Incorrect syntax near '@.AvatarFileLocation'.

>

> My question is:

> Why it does not work and how to write the stored procedure code to run

> this code without errors.

>

> Thanks for any reply

>

>

>

>|||

NNTP User

Lot thanks for the repy,

The article link is very interesting.

I understand risks from using dynamic sql, but I'm not goiing to allow user call my stored procedure directly.

All arguments of the stored procedure will be validated and constructed my my application.

My real question is why can I use OPENROWSET function in stored procedure when I build the query

using varchar variable and then execute it, although I can't do it direclty using OPENROWSET in

stored procedure.

|||You cannot use a variable like this:

OPENROWSET(BULK @.AvatarFileLocation, SINGLE_BLOB)

The file name must be hard-coded, like this:

OPENROWSET(BULK 'C:\picture.jpg', SINGLE_BLOB)

SK

Michal1979@.discussions.microsoft.com wrote:

> NNTP User

>

>

> Lot thanks for the repy,

>

> The article link is very interesting.

>

> I understand risks from using dynamic sql, but I'm not goiing to allow

> user call my stored procedure directly.

>

> All arguments of the stored procedure will be validated and constructed

> my my application.

>

> My real question is why can I use OPENROWSET function in stored

> procedure when I build the query

>

> using varchar variable and then execute it, although I can't do it

> direclty using OPENROWSET in

>

> stored procedure.

>

>

>

>

>

>|||

NNTP User,

Yes,I can not use directly OPENROWSET function in strored procedure, but I can use dynamic sql.

My problem is not how to store image using stored procedure (I can do it, however I don't like the way I do it)

but why can't I do it directly.

By the way I tried to use sp_executesql to run the code but it didn't work as well - so for now the only way

to store image or file using stored procedure is dynamic sql.

But I'm still wandering WHY? Is it a bug or something like that?

|||

As Steve indicated, you will have to specify the filename as a literal in the OPENROWSET call. Otherwise you will have to use dynamic SQL to form the entire statement and execute it. And with dynamic SQL you will have protect against SQL injection attacks. Optionally, you can do the following for a bulk import process:

1. Create temporary table to hold the user accounts

2. Use the new BulkCopy managed API to stream the user data from the client to server

3. Write SP to dump the rows from temporary table to the main table

For adding or modifying single values, you can just have a SP with image parameter and manipulate the data in the table. There is no need to use OPENROWSET which requires a file (creation of file by client, server having permissions to access file, etc) among other things and parameterization is not straight-forward.

|||

Umachandar Jayachandran - MS,

I'd like to know if there is other than OPENROWSET form of loading images or binary files into MSSQL,

I could missed it in documentation. It is sure that there will be no possibility to sql injection using dynamic sql

in my case.

Probably I should mentioned it before, the problem I described is not critical for me, becouse I found solution.

The solution may not be ideal (especialy for me) but it still works. Anyway probably I'll use C# and ADO.NET to

perform put and get image from database.

Maybe you know why the only way to use OPENROWSET in stored procedure is to use dynamic sql.

Thanks

MSsQL2005; OPENROWSET, BLOB/IMAGE and STORED PROCEDURE problems

All,

I work with Microsoft SQL Server 2005 on windows XP professional.
I'd like to create stored procdure to add image to my database (jpg file).
I managed to do it using VARCHAR variable in stored procedure
and then using EXEC, but it don't work directly.

My Table definiton:
CREATE TABLE [dbo].[Users](
[UserID] [int] IDENTITY(1,1) NOT NULL,
[Login] [char](10),
[Password] [char](20),
[Avatar] [image] NULL,
CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED
(
[UserID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

My working solution using stored procedure:
ALTER PROCEDURE [dbo].[AddUser]
@.Login AS VARCHAR(255),
@.Password AS VARCHAR(255),
@.AvatarFileLocation AS VARCHAR(255),
@.UserId AS INT OUTPUT
AS
BEGIN
SET @.Query = 'INSERT INTO USERS ' + CHAR(13)
+ 'SELECT '''+ @.Login + ''' AS Login, ' + CHAR(13)
+ '''' + @.Password + ''' AS Password,' + CHAR(13)
+ '(SELECT * FROM OPENROWSET(BULK ''' + @.AvatarFileLocation + ''', SINGLE_BLOB) AS OBRAZEK)'
EXECUTE (@.Query)
SET @.UserID = @.@.IDENTITY
END

I'd like to use statement in the stored procdure:
ALTER PROCEDURE [dbo].[AddUser]
@.Login AS VARCHAR(255),
@.Password AS VARCHAR(255),
@.AvatarFileLocation AS VARCHAR(255),
@.UserId AS INT OUTPUT
AS
BEGIN
DECLARE
@.Query AS VARCHAR(MAX)

SET @.AvatarFileLocation = 'C:\hitman1.jpg'
INSERT INTO USERS
SELECT @.Login AS Login,
@.Password AS Password,
(SELECT * FROM OPENROWSET(BULK @.AvatarFileLocation, SINGLE_BLOB) AS OBRAZEK)


SET @.UserID = @.@.IDENTITY

END


It generates error:
Incorrect syntax near '@.AvatarFileLocation'.

My question is:
Why it does not work and how to write the stored procedure code to run this code without errors.

Thanks for any reply

You can't use a variable inside OPENROWSET.

What you are doing, in any case, IS VERY DANGEROUS. There

are many ways in which dynamic SQL is vulnerable to SQL

injection. Please read about it, so that you don't lose

everything you have when a malicious user joins your

site/forum with a password like

O',0x; delete from USERS where Password <> 'O';return 0;--

You might start reading here:

http://www.sommarskog.se/dynamic_sql.html

Steve Kass

Drew University

Michal1979@.discussions.microsoft.com wrote:

> All,

>

> I work with Microsoft SQL Server 2005 on windows XP professional.

> I'd like to create stored procdure to add image to my database (jpg

> file).

> I managed to do it using VARCHAR variable in stored procedure

> and then using EXEC, but it don't work directly.

>

> My Table definiton:

> CREATE TABLE [dbo].[Users](

> [UserID] [int] IDENTITY(1,1) NOT NULL,

> [Login] [char](10),

> [Password] [char](20),

> [Avatar] [image] NULL,

> CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED

> (

> [UserID] ASC

> )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]

> ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

>

> My working solution using stored procedure:

> ALTER PROCEDURE [dbo].[AddUser]

> @.Login AS VARCHAR(255),

> @.Password AS VARCHAR(255),

> @.AvatarFileLocation AS VARCHAR(255),

> @.UserId AS INT OUTPUT

> AS

> BEGIN

> SET @.Query = 'INSERT INTO USERS ' + CHAR(13)

> + 'SELECT '''+ @.Login + ''' AS Login, ' + CHAR(13)

> + '''' + @.Password + ''' AS Password,' + CHAR(13)

> + '(SELECT * FROM OPENROWSET(BULK ''' + @.AvatarFileLocation + ''',

> SINGLE_BLOB) AS OBRAZEK)'

> EXECUTE (@.Query)

> SET @.UserID = @.@.IDENTITY

> END

>

> I'd like to use statement in the stored procdure:

> ALTER PROCEDURE [dbo].[AddUser]

> @.Login AS VARCHAR(255),

> @.Password AS VARCHAR(255),

> @.AvatarFileLocation AS VARCHAR(255),

> @.UserId AS INT OUTPUT

> AS

> BEGIN

> DECLARE

> @.Query AS VARCHAR(MAX)

>

> SET @.AvatarFileLocation = 'C:\hitman1.jpg'

> INSERT INTO USERS

> SELECT @.Login AS Login,

> @.Password AS Password,

> (SELECT * FROM OPENROWSET(BULK @.AvatarFileLocation, SINGLE_BLOB) AS

> OBRAZEK)

>

>

> SET @.UserID = @.@.IDENTITY

>

> END

>

>

> It generates error:

> Incorrect syntax near '@.AvatarFileLocation'.

>

> My question is:

> Why it does not work and how to write the stored procedure code to run

> this code without errors.

>

> Thanks for any reply

>

>

>

>|||

NNTP User

Lot thanks for the repy,

The article link is very interesting.

I understand risks from using dynamic sql, but I'm not goiing to allow user call my stored procedure directly.

All arguments of the stored procedure will be validated and constructed my my application.

My real question is why can I use OPENROWSET function in stored procedure when I build the query

using varchar variable and then execute it, although I can't do it direclty using OPENROWSET in

stored procedure.

|||You cannot use a variable like this:

OPENROWSET(BULK @.AvatarFileLocation, SINGLE_BLOB)

The file name must be hard-coded, like this:

OPENROWSET(BULK 'C:\picture.jpg', SINGLE_BLOB)

SK

Michal1979@.discussions.microsoft.com wrote:

> NNTP User

>

>

> Lot thanks for the repy,

>

> The article link is very interesting.

>

> I understand risks from using dynamic sql, but I'm not goiing to allow

> user call my stored procedure directly.

>

> All arguments of the stored procedure will be validated and constructed

> my my application.

>

> My real question is why can I use OPENROWSET function in stored

> procedure when I build the query

>

> using varchar variable and then execute it, although I can't do it

> direclty using OPENROWSET in

>

> stored procedure.

>

>

>

>

>

>|||

NNTP User,

Yes,I can not use directly OPENROWSET function in strored procedure, but I can use dynamic sql.

My problem is not how to store image using stored procedure (I can do it, however I don't like the way I do it)

but why can't I do it directly.

By the way I tried to use sp_executesql to run the code but it didn't work as well - so for now the only way

to store image or file using stored procedure is dynamic sql.

But I'm still wandering WHY? Is it a bug or something like that?

|||

As Steve indicated, you will have to specify the filename as a literal in the OPENROWSET call. Otherwise you will have to use dynamic SQL to form the entire statement and execute it. And with dynamic SQL you will have protect against SQL injection attacks. Optionally, you can do the following for a bulk import process:

1. Create temporary table to hold the user accounts

2. Use the new BulkCopy managed API to stream the user data from the client to server

3. Write SP to dump the rows from temporary table to the main table

For adding or modifying single values, you can just have a SP with image parameter and manipulate the data in the table. There is no need to use OPENROWSET which requires a file (creation of file by client, server having permissions to access file, etc) among other things and parameterization is not straight-forward.

|||

Umachandar Jayachandran - MS,

I'd like to know if there is other than OPENROWSET form of loading images or binary files into MSSQL,

I could missed it in documentation. It is sure that there will be no possibility to sql injection using dynamic sql

in my case.

Probably I should mentioned it before, the problem I described is not critical for me, becouse I found solution.

The solution may not be ideal (especialy for me) but it still works. Anyway probably I'll use C# and ADO.NET to

perform put and get image from database.

Maybe you know why the only way to use OPENROWSET in stored procedure is to use dynamic sql.

Thanks

MSSQL2005 SP2 and DB-Lib Connection

We have some legacy processes written in C with embedded SQL. They were
compiled with MSSQL2000 libraries and used db-lib for database connections.
After the database was upgraded to MSSQL2005, they could still make the
connection. Recently we have applied MSSQL2005 service pack 2 on the test
server and these processes can no longer connect (error message: SQL Server
is unavailable or does not exist). All other apps using the native client
work OK. Is there anything I can do at the MSSQL side to allow those legacy
processes to connect? Thanks.
Wow... it's been awhile since I supported C and DBLib. I taught this at MSU
for 5 years or so but that was a LONG time ago...
Ok, consider that DBLib requires a matched set of the named pipes DLL and
the dblib dll. If these get out of sync then you're pooched.
I'm really surprised that you've been able to hold out this long. I would
get up on Connect and report a bug but I doubt if they support DBLib any
longer. I don't think there is anything you can do on the server side to fix
it--except rolling back SP2. I expect the tightened the TDS in some way that
made it incompatible with legacy DBLib apps.
hth
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
------
"mason" <masonliu@.msn.com> wrote in message
news:O8MZ$FsdHHA.984@.TK2MSFTNGP04.phx.gbl...
> We have some legacy processes written in C with embedded SQL. They were
> compiled with MSSQL2000 libraries and used db-lib for database
> connections. After the database was upgraded to MSSQL2005, they could
> still make the connection. Recently we have applied MSSQL2005 service pack
> 2 on the test server and these processes can no longer connect (error
> message: SQL Server is unavailable or does not exist). All other apps
> using the native client work OK. Is there anything I can do at the MSSQL
> side to allow those legacy processes to connect? Thanks.
|||We will rewrite them if we have to, but if there is a way to give them
another life, ... Thanks.
"William (Bill) Vaughn" <billvaRemoveThis@.betav.com> wrote in message
news:ubW7bCudHHA.3272@.TK2MSFTNGP03.phx.gbl...[vbcol=seagreen]
> Wow... it's been awhile since I supported C and DBLib. I taught this at
> MSU for 5 years or so but that was a LONG time ago...
> Ok, consider that DBLib requires a matched set of the named pipes DLL and
> the dblib dll. If these get out of sync then you're pooched.
> I'm really surprised that you've been able to hold out this long. I would
> get up on Connect and report a bug but I doubt if they support DBLib any
> longer. I don't think there is anything you can do on the server side to
> fix it--except rolling back SP2. I expect the tightened the TDS in some
> way that made it incompatible with legacy DBLib apps.
> hth
> --
> ____________________________________
> William (Bill) Vaughn
> Author, Mentor, Consultant
> Microsoft MVP
> INETA Speaker
> www.betav.com/blog/billva
> www.betav.com
> Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> __________________________________
> Visit www.hitchhikerguides.net to get more information on my latest book:
> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
> ------
> "mason" <masonliu@.msn.com> wrote in message
> news:O8MZ$FsdHHA.984@.TK2MSFTNGP04.phx.gbl...
|||Did the test server work before you applied SP@. and did you also upgrade the
test server from SQL 2000? The reason I ask is that SQL Server 2005 doesn't
include the dblib dll anymore so the only way it would have worked is if the
dll was left over from SQL Server 2000.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"mason" <masonliu@.msn.com> wrote in message
news:O8MZ$FsdHHA.984@.TK2MSFTNGP04.phx.gbl...
> We have some legacy processes written in C with embedded SQL. They were
> compiled with MSSQL2000 libraries and used db-lib for database
> connections. After the database was upgraded to MSSQL2005, they could
> still make the connection. Recently we have applied MSSQL2005 service pack
> 2 on the test server and these processes can no longer connect (error
> message: SQL Server is unavailable or does not exist). All other apps
> using the native client work OK. Is there anything I can do at the MSSQL
> side to allow those legacy processes to connect? Thanks.
|||Yes. It worked with MSSQL2005 SP1. The test server was created from scratch
with MSSQL2005. We copied two DLLs (ntwdblib.dll and sqlakw32.dll) from
MSSQL2000 client.
"Roger Wolter[MSFT]" <rwolter@.online.microsoft.com> wrote in message
news:70709573-251D-4E13-8F60-75AF6858DD62@.microsoft.com...
> Did the test server work before you applied SP@. and did you also upgrade
> the test server from SQL 2000? The reason I ask is that SQL Server 2005
> doesn't include the dblib dll anymore so the only way it would have worked
> is if the dll was left over from SQL Server 2000.
> --
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> "mason" <masonliu@.msn.com> wrote in message
> news:O8MZ$FsdHHA.984@.TK2MSFTNGP04.phx.gbl...
>
|||Did you register both DLLs?
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
------
"mason" <masonliu@.msn.com> wrote in message
news:%2301l8PvdHHA.5056@.TK2MSFTNGP02.phx.gbl...
> Yes. It worked with MSSQL2005 SP1. The test server was created from
> scratch with MSSQL2005. We copied two DLLs (ntwdblib.dll and sqlakw32.dll)
> from MSSQL2000 client.
>
> "Roger Wolter[MSFT]" <rwolter@.online.microsoft.com> wrote in message
> news:70709573-251D-4E13-8F60-75AF6858DD62@.microsoft.com...
>
|||No. Tried to register now and got error msgs such as
DllRegisterServer/DllInstall entry points not found.
Those processes are working fine under MSSQL2005 SP1 in production.
"William (Bill) Vaughn" <billvaRemoveThis@.betav.com> wrote in message
news:e4nA%23i5dHHA.984@.TK2MSFTNGP04.phx.gbl...[vbcol=seagreen]
> Did you register both DLLs?
> --
> ____________________________________
> William (Bill) Vaughn
> Author, Mentor, Consultant
> Microsoft MVP
> INETA Speaker
> www.betav.com/blog/billva
> www.betav.com
> Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> __________________________________
> Visit www.hitchhikerguides.net to get more information on my latest book:
> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
> ------
> "mason" <masonliu@.msn.com> wrote in message
> news:%2301l8PvdHHA.5056@.TK2MSFTNGP02.phx.gbl...

MSSQL2005 SP2 and DB-Lib Connection

We have some legacy processes written in C with embedded SQL. They were
compiled with MSSQL2000 libraries and used db-lib for database connections.
After the database was upgraded to MSSQL2005, they could still make the
connection. Recently we have applied MSSQL2005 service pack 2 on the test
server and these processes can no longer connect (error message: SQL Server
is unavailable or does not exist). All other apps using the native client
work OK. Is there anything I can do at the MSSQL side to allow those legacy
processes to connect? Thanks.Wow... it's been awhile since I supported C and DBLib. I taught this at MSU
for 5 years or so but that was a LONG time ago...
Ok, consider that DBLib requires a matched set of the named pipes DLL and
the dblib dll. If these get out of sync then you're pooched.
I'm really surprised that you've been able to hold out this long. I would
get up on Connect and report a bug but I doubt if they support DBLib any
longer. I don't think there is anything you can do on the server side to fix
it--except rolling back SP2. I expect the tightened the TDS in some way that
made it incompatible with legacy DBLib apps.
hth
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
----
---
"mason" <masonliu@.msn.com> wrote in message
news:O8MZ$FsdHHA.984@.TK2MSFTNGP04.phx.gbl...
> We have some legacy processes written in C with embedded SQL. They were
> compiled with MSSQL2000 libraries and used db-lib for database
> connections. After the database was upgraded to MSSQL2005, they could
> still make the connection. Recently we have applied MSSQL2005 service pack
> 2 on the test server and these processes can no longer connect (error
> message: SQL Server is unavailable or does not exist). All other apps
> using the native client work OK. Is there anything I can do at the MSSQL
> side to allow those legacy processes to connect? Thanks.|||We will rewrite them if we have to, but if there is a way to give them
another life, ... Thanks.
"William (Bill) Vaughn" <billvaRemoveThis@.betav.com> wrote in message
news:ubW7bCudHHA.3272@.TK2MSFTNGP03.phx.gbl...[vbcol=seagreen]
> Wow... it's been awhile since I supported C and DBLib. I taught this at
> MSU for 5 years or so but that was a LONG time ago...
> Ok, consider that DBLib requires a matched set of the named pipes DLL and
> the dblib dll. If these get out of sync then you're pooched.
> I'm really surprised that you've been able to hold out this long. I would
> get up on Connect and report a bug but I doubt if they support DBLib any
> longer. I don't think there is anything you can do on the server side to
> fix it--except rolling back SP2. I expect the tightened the TDS in some
> way that made it incompatible with legacy DBLib apps.
> hth
> --
> ____________________________________
> William (Bill) Vaughn
> Author, Mentor, Consultant
> Microsoft MVP
> INETA Speaker
> www.betav.com/blog/billva
> www.betav.com
> Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> __________________________________
> Visit www.hitchhikerguides.net to get more information on my latest book:
> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
> ----
---
> "mason" <masonliu@.msn.com> wrote in message
> news:O8MZ$FsdHHA.984@.TK2MSFTNGP04.phx.gbl...|||Did the test server work before you applied SP@. and did you also upgrade the
test server from SQL 2000? The reason I ask is that SQL Server 2005 doesn't
include the dblib dll anymore so the only way it would have worked is if the
dll was left over from SQL Server 2000.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"mason" <masonliu@.msn.com> wrote in message
news:O8MZ$FsdHHA.984@.TK2MSFTNGP04.phx.gbl...
> We have some legacy processes written in C with embedded SQL. They were
> compiled with MSSQL2000 libraries and used db-lib for database
> connections. After the database was upgraded to MSSQL2005, they could
> still make the connection. Recently we have applied MSSQL2005 service pack
> 2 on the test server and these processes can no longer connect (error
> message: SQL Server is unavailable or does not exist). All other apps
> using the native client work OK. Is there anything I can do at the MSSQL
> side to allow those legacy processes to connect? Thanks.|||Yes. It worked with MSSQL2005 SP1. The test server was created from scratch
with MSSQL2005. We copied two DLLs (ntwdblib.dll and sqlakw32.dll) from
MSSQL2000 client.
"Roger Wolter[MSFT]" <rwolter@.online.microsoft.com> wrote in message
news:70709573-251D-4E13-8F60-75AF6858DD62@.microsoft.com...
> Did the test server work before you applied SP@. and did you also upgrade
> the test server from SQL 2000? The reason I ask is that SQL Server 2005
> doesn't include the dblib dll anymore so the only way it would have worked
> is if the dll was left over from SQL Server 2000.
> --
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> "mason" <masonliu@.msn.com> wrote in message
> news:O8MZ$FsdHHA.984@.TK2MSFTNGP04.phx.gbl...
>|||Did you register both DLLs?
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
----
---
"mason" <masonliu@.msn.com> wrote in message
news:%2301l8PvdHHA.5056@.TK2MSFTNGP02.phx.gbl...
> Yes. It worked with MSSQL2005 SP1. The test server was created from
> scratch with MSSQL2005. We copied two DLLs (ntwdblib.dll and sqlakw32.dll)
> from MSSQL2000 client.
>
> "Roger Wolter[MSFT]" <rwolter@.online.microsoft.com> wrote in message
> news:70709573-251D-4E13-8F60-75AF6858DD62@.microsoft.com...
>|||No. Tried to register now and got error msgs such as
DllRegisterServer/DllInstall entry points not found.
Those processes are working fine under MSSQL2005 SP1 in production.
"William (Bill) Vaughn" <billvaRemoveThis@.betav.com> wrote in message
news:e4nA%23i5dHHA.984@.TK2MSFTNGP04.phx.gbl...[vbcol=seagreen]
> Did you register both DLLs?
> --
> ____________________________________
> William (Bill) Vaughn
> Author, Mentor, Consultant
> Microsoft MVP
> INETA Speaker
> www.betav.com/blog/billva
> www.betav.com
> Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> __________________________________
> Visit www.hitchhikerguides.net to get more information on my latest book:
> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
> ----
---
> "mason" <masonliu@.msn.com> wrote in message
> news:%2301l8PvdHHA.5056@.TK2MSFTNGP02.phx.gbl...

MSSQL2005 SP1 setup

I have an Evaluation version of Enterprise edition MSSQL2005 for development. I tried to install MSSQL2005 sp1 and it is necessary to upgrade to the release version of SQL2005. Currently, I just got the release CD on hand, how can I upgrade the evaluation version to release version except uninstalling the eval and install with the release edition? Thanks in advance

You can "Upgrade" from Eval to the release version by launching setup from the CD. Setup will find the existing eval instance inform you that you can upgrade the instance.

jeff.

MSSQL2005 Express SP2 on Vista Professional does not support Extended SP?

Can you explain please why Extended SP does not work under Vista ?

Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86) Feb 9 2007 22:47:07 Copyright (c) 1988-2005 Microsoft Corporation Express Edition on Windows NT 6.0 (Build 6000: )

UAC turned off. MSQSL runs under Administrator account.

Any call of user esp - and SQL server goes to loop.
If I call system esp - all works fine.

If I try to read properties of ESP from Management Studio - I have the same effect - SQL server is in loop.

select object_id('dbo.xp_mylog')

-- works.


EXEC('sp_helpextendedproc ''xp_mylog''')

xp_mylog c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\LogEsp.dll

exec master..xp_mylog

die forever

Konstantin

Hi Konstantin,

Have you enabled extended sprocs? They are disabled by default.

Mike

|||

No I did not. How to do this ? I know how to do in Stanard Edition. But this option not visible in Express edition.

There is a TSQL statement to change it or change it in the registry ?

|||

is any body can halp me ?

|||

Is there is anybody from Microsoft who knows how to enable ESP ?

|||

I guess, this is what Mike means:

Open SAC > ...for features ... Navigate your instance ... OLE Automation > enable

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

Extended Stored Procedure is not ActiveX

MSSQL2005 Express SP2 on Vista Professional does not support Extended SP?

Can you explain please why Extended SP does not work under Vista ?

Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86) Feb 9 2007 22:47:07 Copyright (c) 1988-2005 Microsoft Corporation Express Edition on Windows NT 6.0 (Build 6000: )

UAC turned off. MSQSL runs under Administrator account.

Any call of user esp - and SQL server goes to loop.
If I call system esp - all works fine.

If I try to read properties of ESP from Management Studio - I have the same effect - SQL server is in loop.

select object_id('dbo.xp_mylog')

-- works.


EXEC('sp_helpextendedproc ''xp_mylog''')

xp_mylog c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\LogEsp.dll

exec master..xp_mylog

die forever

Konstantin

Hi Konstantin,

Have you enabled extended sprocs? They are disabled by default.

Mike

|||

No I did not. How to do this ? I know how to do in Stanard Edition. But this option not visible in Express edition.

There is a TSQL statement to change it or change it in the registry ?

|||

is any body can halp me ?

|||

Is there is anybody from Microsoft who knows how to enable ESP ?

|||

I guess, this is what Mike means:

Open SAC > ...for features ... Navigate your instance ... OLE Automation > enable

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

Extended Stored Procedure is not ActiveX

MSSQL2005 Express SP2 on Vista Professional does not support Extended SP?

Can you explain please why Extended SP does not work under Vista ?

Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86) Feb 9 2007 22:47:07 Copyright (c) 1988-2005 Microsoft Corporation Express Edition on Windows NT 6.0 (Build 6000: )

UAC turned off. MSQSL runs under Administrator account.

Any call of user esp - and SQL server goes to loop.
If I call system esp - all works fine.

If I try to read properties of ESP from Management Studio - I have the same effect - SQL server is in loop.

select object_id('dbo.xp_mylog')

-- works.


EXEC('sp_helpextendedproc ''xp_mylog''')

xp_mylog c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\LogEsp.dll

exec master..xp_mylog

die forever

Konstantin

Hi Konstantin,

Have you enabled extended sprocs? They are disabled by default.

Mike

|||

No I did not. How to do this ? I know how to do in Stanard Edition. But this option not visible in Express edition.

There is a TSQL statement to change it or change it in the registry ?

|||

is any body can halp me ?

|||

Is there is anybody from Microsoft who knows how to enable ESP ?

|||

I guess, this is what Mike means:

Open SAC > ...for features ... Navigate your instance ... OLE Automation > enable

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

Extended Stored Procedure is not ActiveX

MSSQL2005 Express SP2 on Vista Professional does not support Extended SP?

Can you explain please why Extended SP does not work under Vista ?

Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86) Feb 9 2007 22:47:07 Copyright (c) 1988-2005 Microsoft Corporation Express Edition on Windows NT 6.0 (Build 6000: )

UAC turned off. MSQSL runs under Administrator account.

Any call of user esp - and SQL server goes to loop.
If I call system esp - all works fine.

If I try to read properties of ESP from Management Studio - I have the same effect - SQL server is in loop.

select object_id('dbo.xp_mylog')

-- works.


EXEC('sp_helpextendedproc ''xp_mylog''')

xp_mylog c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\LogEsp.dll

exec master..xp_mylog

die forever

Konstantin

Hi Konstantin,

Have you enabled extended sprocs? They are disabled by default.

Mike

|||

No I did not. How to do this ? I know how to do in Stanard Edition. But this option not visible in Express edition.

There is a TSQL statement to change it or change it in the registry ?

|||

is any body can halp me ?

|||

Is there is anybody from Microsoft who knows how to enable ESP ?

|||

I guess, this is what Mike means:

Open SAC > ...for features ... Navigate your instance ... OLE Automation > enable

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

Extended Stored Procedure is not ActiveX

mssql2005 and vs2003

Hi just wondering if mssql 2005 integrates ok with vs2003, thanks.
Paul G
Software engineer.
Absolutely.
"Paul" wrote:

> Hi just wondering if mssql 2005 integrates ok with vs2003, thanks.
> --
> Paul G
> Software engineer.
|||ok thanks for the information.
Paul G
Software engineer.
"mulhall" wrote:
[vbcol=seagreen]
> Absolutely.
> "Paul" wrote:

mssql2005 and vs2003

Hi just wondering if mssql 2005 integrates ok with vs2003, thanks.
--
Paul G
Software engineer.Absolutely.
"Paul" wrote:

> Hi just wondering if mssql 2005 integrates ok with vs2003, thanks.
> --
> Paul G
> Software engineer.|||ok thanks for the information.
--
Paul G
Software engineer.
"mulhall" wrote:
[vbcol=seagreen]
> Absolutely.
> "Paul" wrote:
>

mssql2005 and vs2003

Hi just wondering if mssql 2005 integrates ok with vs2003, thanks.
--
Paul G
Software engineer.Absolutely.
"Paul" wrote:
> Hi just wondering if mssql 2005 integrates ok with vs2003, thanks.
> --
> Paul G
> Software engineer.|||ok thanks for the information.
--
Paul G
Software engineer.
"mulhall" wrote:
> Absolutely.
> "Paul" wrote:
> > Hi just wondering if mssql 2005 integrates ok with vs2003, thanks.
> > --
> > Paul G
> > Software engineer.

MSSQL2005 Analysis Service Distinct Count

hi,

i am currently trying to build a distinct count on my cube (mssql2005 analysis services).

But after i added the discount count on the field i want to and start the processing, the following errors appear.

- Errors in the OLAP storage engine: The sort order specified for distinct count records is incorrect.

- Errors in the OLAP storage engine: An error occurred while processing the 'FACT VIEW STATISTIC' partition of the 'FACT VIEW STATISTIC 1' measure group for the 'Accident Statistic' cube from the OLAP_PROJECT database.

the count measure works fine.

will appreciate any help on this distinct count problem.

thanks in advance.

-

HY

Try and see what kind of query Analysis Services sends to the relational database during processing of distinct count measure.

You will see it sending a query containing ORDER BY clause asking relational database to sort results accourding to the distinct count measure.

It it possible the view you defined your partitions on, brings data sorted differently?
Any new data becomes avaliable during processing of the partition?

The error indicates Analysis Server detecting inconsistencies in sorting of data coming from relational database.

See if you might need to define collation correctly for your sort.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Thanks edward.

as i drew data from Oracle view, the collation must be specify correctly.

check the Oracle collation and discovered it is binary.

changed the distinct count to binary collation and it works.

thanks.

-

HY

|||

Could any one explain about the error and solution elaborately. I am not sure how this can be rectified. Appreciate any help.

Thanks

|||

Hi there,

We encountered the same issue:

And changing the collation to binary allowed us to process the cube ...

But I still don't understand why I got the error with the collation set to SQL_Latin1_CI_AS

By the way, I also encountered a difference of 1 by browsing the cube and when I count on the table:

Browse on the measure with the distinct count = 800

Result of "select count (distinct (sessionid)) from dbo.facttransaction" = 799

(NB: some sessionid are NULL)

Does the cube take in consideration the NULL values ?

Thanks

|||

OK found why I got the diff :

Analysis Services handle a NULL value like a 0 value in a DISTINCT COUNT measure

MSSQL2005 Analysis Service Distinct Count

hi,

i am currently trying to build a distinct count on my cube (mssql2005 analysis services).

But after i added the discount count on the field i want to and start the processing, the following errors appear.

- Errors in the OLAP storage engine: The sort order specified for distinct count records is incorrect.

- Errors in the OLAP storage engine: An error occurred while processing the 'FACT VIEW STATISTIC' partition of the 'FACT VIEW STATISTIC 1' measure group for the 'Accident Statistic' cube from the OLAP_PROJECT database.

the count measure works fine.

will appreciate any help on this distinct count problem.

thanks in advance.

-

HY

Try and see what kind of query Analysis Services sends to the relational database during processing of distinct count measure.

You will see it sending a query containing ORDER BY clause asking relational database to sort results accourding to the distinct count measure.

It it possible the view you defined your partitions on, brings data sorted differently?
Any new data becomes avaliable during processing of the partition?

The error indicates Analysis Server detecting inconsistencies in sorting of data coming from relational database.

See if you might need to define collation correctly for your sort.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Thanks edward.

as i drew data from Oracle view, the collation must be specify correctly.

check the Oracle collation and discovered it is binary.

changed the distinct count to binary collation and it works.

thanks.

-

HY

|||

Could any one explain about the error and solution elaborately. I am not sure how this can be rectified. Appreciate any help.

Thanks

|||

Hi there,

We encountered the same issue:

And changing the collation to binary allowed us to process the cube ...

But I still don't understand why I got the error with the collation set to SQL_Latin1_CI_AS

By the way, I also encountered a difference of 1 by browsing the cube and when I count on the table:

Browse on the measure with the distinct count = 800

Result of "select count (distinct (sessionid)) from dbo.facttransaction" = 799

(NB: some sessionid are NULL)

Does the cube take in consideration the NULL values ?

Thanks

|||

OK found why I got the diff :

Analysis Services handle a NULL value like a 0 value in a DISTINCT COUNT measure

MSSQL2005 Analysis Service Distinct Count

hi,

i am currently trying to build a distinct count on my cube (mssql2005 analysis services).

But after i added the discount count on the field i want to and start the processing, the following errors appear.

- Errors in the OLAP storage engine: The sort order specified for distinct count records is incorrect.

- Errors in the OLAP storage engine: An error occurred while processing the 'FACT VIEW STATISTIC' partition of the 'FACT VIEW STATISTIC 1' measure group for the 'Accident Statistic' cube from the OLAP_PROJECT database.

the count measure works fine.

will appreciate any help on this distinct count problem.

thanks in advance.

-

HY

Try and see what kind of query Analysis Services sends to the relational database during processing of distinct count measure.

You will see it sending a query containing ORDER BY clause asking relational database to sort results accourding to the distinct count measure.

It it possible the view you defined your partitions on, brings data sorted differently?
Any new data becomes avaliable during processing of the partition?

The error indicates Analysis Server detecting inconsistencies in sorting of data coming from relational database.

See if you might need to define collation correctly for your sort.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Thanks edward.

as i drew data from Oracle view, the collation must be specify correctly.

check the Oracle collation and discovered it is binary.

changed the distinct count to binary collation and it works.

thanks.

-

HY

|||

Could any one explain about the error and solution elaborately. I am not sure how this can be rectified. Appreciate any help.

Thanks

|||

Hi there,

We encountered the same issue:

And changing the collation to binary allowed us to process the cube ...

But I still don't understand why I got the error with the collation set to SQL_Latin1_CI_AS

By the way, I also encountered a difference of 1 by browsing the cube and when I count on the table:

Browse on the measure with the distinct count = 800

Result of "select count (distinct (sessionid)) from dbo.facttransaction" = 799

(NB: some sessionid are NULL)

Does the cube take in consideration the NULL values ?

Thanks

|||

OK found why I got the diff :

Analysis Services handle a NULL value like a 0 value in a DISTINCT COUNT measure

Wednesday, March 7, 2012

MSSQL2005 64 bit + Client's 32 bit ODBC

Hi,
If I have a Intel x86 64 bit server, installed Win2003 64bit OS + MSSQL2005
64 bit version, and the client running Intel "Core2 Duo" (32 bit), installed
WinXP Prof, is the client able to connect to MSSQL2005 64 bit Database thro
ODBC drivers?
Thanks.Correcttion: Intel x64 not x86. x86 is 32 bit.
Of course they can.
You even can even install SQL Server 2005 x86 on your x64 environment. (of
course you better install x64 ver.)
However you can not install x64 on an x86 environment.
--
Ekrem Önsoy
"Markco Wong" <markcowong@.markcowong.com> wrote in message
news:erneasQ8HHA.3900@.TK2MSFTNGP02.phx.gbl...
> Hi,
> If I have a Intel x86 64 bit server, installed Win2003 64bit OS +
> MSSQL2005 64 bit version, and the client running Intel "Core2 Duo" (32
> bit), installed WinXP Prof, is the client able to connect to MSSQL2005 64
> bit Database thro ODBC drivers?
> Thanks.
>

mssql2005

how do I bring files from mssql2000 to mssql2005? A BAK from 2000 doesnt
seem to work as it did in mssql97 & 2000
thanks,
Raul Rego
NJPIES> A BAK from 2000 doesnt seem to work as it did in mssql97 & 2000
It should do. You can both restore a 2000 backup into 2005 and also attach a
2000 database (mdf etc
files) into 2005. What error message do you get?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"news.microsoft.com" <jjkgr@.hotmail.com> wrote in message
news:u0s8ppDzGHA.4232@.TK2MSFTNGP04.phx.gbl...
> how do I bring files from mssql2000 to mssql2005? A BAK from 2000 doesnt
seem to work as it did
> in mssql97 & 2000
> thanks,
> Raul Rego
> NJPIES
>

mssql2005

how do I bring files from mssql2000 to mssql2005? A BAK from 2000 doesnt
seem to work as it did in mssql97 & 2000
thanks,
Raul Rego
NJPIES> A BAK from 2000 doesnt seem to work as it did in mssql97 & 2000
It should do. You can both restore a 2000 backup into 2005 and also attach a 2000 database (mdf etc
files) into 2005. What error message do you get?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"news.microsoft.com" <jjkgr@.hotmail.com> wrote in message
news:u0s8ppDzGHA.4232@.TK2MSFTNGP04.phx.gbl...
> how do I bring files from mssql2000 to mssql2005? A BAK from 2000 doesnt seem to work as it did
> in mssql97 & 2000
> thanks,
> Raul Rego
> NJPIES
>

msSQL2000 to mssql2005

I have set up a replication between mssql2000 to mssql2005
Mssql2000 is the publisher and mssql is subscriber.
And it work fine.
Then I remove the publication because I need to do spm Alter statement
against Tables in the database
When I try to add subscription
with @.sync_type = N'none' (In This case the data i alredy in the subscribers
databse)
I get theese error:
Violation of PRIMARY KEY constraint 'PK__@.snapshot_seqnos__328568A3'.
Cannot insert duplicate key in object '#3191446A'.
(Source: SRVIQDB03 (Data source); Error number: 2627)
Her is Add subscr.
use [Tellus_DB209]
exec sp_addsubscription @.publication = N'pub_Tellus_DB209_2005',
@.subscriber = N'RDASP21', @.destination_db = N'Tellus',
@.subscription_type = N'Push', @.sync_type = N'none',
@.article = N'all', @.update_mode = N'read only',
@.loopback_detection = N'True',
@.frequency_type = 64, @.frequency_interval = 0, @.frequency_relative_interval
= 0,
@.frequency_recurrence_factor = 0, @.frequency_subday = 0,
@.frequency_subday_interval = 0,
@.active_start_time_of_day = 0, @.active_end_time_of_day = 235959,
@.active_start_date = 20060202, @.active_end_date = 99991231, @.offloadagent =
0,
@.enabled_for_syncmgr = N'False', @.dts_package_location = N'Distributor'
What is this about.
What sp is SQL 2000? You may need to check this link to fix the problem.
http://groups.google.com/group/micro...5?dmode=source
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Roger Nygrd" <roger@.askit.no> wrote in message
news:11u4op7pil83qf4@.corp.supernews.com...
>I have set up a replication between mssql2000 to mssql2005
> Mssql2000 is the publisher and mssql is subscriber.
> And it work fine.
> Then I remove the publication because I need to do spm Alter statement
> against Tables in the database
> When I try to add subscription
> with @.sync_type = N'none' (In This case the data i alredy in the
> subscribers databse)
> I get theese error:
> Violation of PRIMARY KEY constraint 'PK__@.snapshot_seqnos__328568A3'.
> Cannot insert duplicate key in object '#3191446A'.
> (Source: SRVIQDB03 (Data source); Error number: 2627)
> Her is Add subscr.
> use [Tellus_DB209]
> exec sp_addsubscription @.publication = N'pub_Tellus_DB209_2005',
> @.subscriber = N'RDASP21', @.destination_db = N'Tellus',
> @.subscription_type = N'Push', @.sync_type = N'none',
> @.article = N'all', @.update_mode = N'read only',
> @.loopback_detection = N'True',
> @.frequency_type = 64, @.frequency_interval = 0,
> @.frequency_relative_interval = 0,
> @.frequency_recurrence_factor = 0, @.frequency_subday = 0,
> @.frequency_subday_interval = 0,
> @.active_start_time_of_day = 0, @.active_end_time_of_day = 235959,
> @.active_start_date = 20060202, @.active_end_date = 99991231, @.offloadagent
> = 0,
> @.enabled_for_syncmgr = N'False', @.dts_package_location = N'Distributor'
> What is this about.
>