Showing posts with label message. Show all posts
Showing posts with label message. Show all posts

Monday, March 19, 2012

Can I assign rowguid from the client code instead of using default newid()?

Do I have to use default newid() for the rowguid? I would prefer to pass a
sequential GUID from the client code instead.
Message posted via droptable.com
http://www.droptable.com/Uwe/Forums.aspx/sql-server-replication/200701/1
Or can I at least use newsequentialid() instead of newid() as the ROWGUID
default?
Message posted via droptable.com
http://www.droptable.com/Uwe/Forums.aspx/sql-server-replication/200701/1
|||Alex,
Yes,
CREATE TABLE dbo.Table1
(
test uniqueidentifier NOT NULL ROWGUIDCOL
) ON [PRIMARY]
ALTER TABLE dbo.Table1 ADD CONSTRAINT
DF_Table1_test DEFAULT (newid()) FOR test
-- Bill
"Alex via droptable.com" <no@.spam.pls> wrote in message
news:6bd9f60658969@.uwe...
> Or can I at least use newsequentialid() instead of newid() as the ROWGUID
> default?
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forums.aspx/sql-server-replication/200701/1
>
|||Thank you for your response. It seems your code is still using newid(), but
anyway it is not what I was asking. The MS documentation says that one can
create replication ROWGUID column manually as long as it have the following
characteristics:
* The data type as UNIQUEIDENTIFIER.
* The default as NEWID().
* The ROWGUIDCOL property.
* A unique index on the column.
My questions are:
1. Can I use newsequentialid() instead of newid() ?
2. Can I supply GUID from my client code instead of using this default value?
I am interested in transactional replication model with updating subscribers.
AlterEgo wrote:[vbcol=seagreen]
>Alex,
>Yes,
>CREATE TABLE dbo.Table1
> (
> test uniqueidentifier NOT NULL ROWGUIDCOL
> ) ON [PRIMARY]
>ALTER TABLE dbo.Table1 ADD CONSTRAINT
> DF_Table1_test DEFAULT (newid()) FOR test
>-- Bill
Message posted via droptable.com
http://www.droptable.com/Uwe/Forums.aspx/sql-server-replication/200701/1

Can I add user and passw to my OLAP ConnectionString?

Hi all,
I have written a custom assembly that works fine in preview mode, but when I deploy the report I get the '#Error' message instead of the output.
I have copied the assembly to the bin folder of Reportserver, placed it in the GAC and even edited the policyfiles.

Any help would be very appriciated,

Thanks in advance

public static class SimCardBuyer
{
public static string ReturnBuyer(string Seller, string PeriodeCode, string ComDevice)
{
string connstring = "PROVIDER=MSOLAP;DATA SOURCE=srv03-gc-10;INITIAL CATALOG=Invoicing";
AdomdConnection conn = new Microsoft.AnalysisServices.AdomdClient.AdomdConnection(connstring);
//Create a new string builder to store the results
System.Text.StringBuilder result = new System.Text.StringBuilder();
//Connect to the local server
using (conn)
{
conn.Open();
//Create a command, using this connection
AdomdCommand cmd = conn.CreateCommand();
cmd.CommandText = @."SELECT NON EMPTY { [Measures].[InvoiceAmount] } ON COLUMNS, NON EMPTY { ([Buyer].[Company].[Company].ALLMEMBERS ) }
DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM
( SELECT ( { [Com Device].[Com Device].[" + ComDevice + @."] } ) ON COLUMNS FROM
( SELECT ( { [Invoice].[Period Code].[" + PeriodeCode + @."] } ) ON COLUMNS FROM
( SELECT ( { [Seller].[Company].[" + Seller + @."] } ) ON COLUMNS FROM [Invoicing])))
WHERE ( [Seller].[Company].[" + Seller + @."], [Invoice].[Period Code].[" + PeriodeCode + @."], [Com Device].[Com Device].[" + ComDevice + @."] )";

//Execute the query, returning a cellset
CellSet cs = cmd.ExecuteCellSet();
//Output the column captions from the first axis
//Note that this procedure assumes a single member exists per column.
TupleCollection tuplesOnRows = cs.Axes[1].Set.Tuples;
if (tuplesOnRows.Count > 1)
{
for (int row = 0; row < tuplesOnRows.Count - 1; row++)
{
result.Append(tuplesOnRows[row].Members[0].Caption);
result.Append(" / ");
}
result.Append(tuplesOnRows[tuplesOnRows.Count - 1].Members[0].Caption);
}
else if (tuplesOnRows.Count == 1)
{result.Append(tuplesOnRows[0].Members[0].Caption);}
else{result.Append(Seller);}
conn.Close();
return result.ToString();
}
}

Dear readers,

I have solved the problem above, but now I get an error with the Connectionstring.
I'm getting the next error now:


Either the user, NL01\SRV03-GC-10$, does not have access to the Invoicing database, or the database does not exist.
NL01\SRV03-GC-10$ is not a user in my system, so I'm stunned with this strange error.

I would appriciate any reply on this.

regards.

Thursday, March 8, 2012

Can connect to sqlexpress but not the DB ?


whenever i try and choose the database i wish to work with like below. I end up with an error message about the user not being associated with a trusted sql server connection

cnStr = @."Data Source=server\SQLEXPRESS;Initial Catalog=sqldata;User ID=blah\me";

same with this one

cnStr = @."Data Source=STOCKYARD\SQLEXPRESS;Initial Catalog=DB;Trusted_Connection=Yes;";

i figured this was all permission based so i kept dorking around with security adding my user name to anything i could find, and also went through and dozen or so connection strings and found when i take out the DB name that i can open a connection.... as the code below works...

cnStr = @."Data Source=Server\SQLEXPRESS;Trusted_Connection=Yes;";

cn.Open();

I plan on importing another database so how will i later on choose between the two, i notice i can create logins only at the security for the sqlexpress and not for my database? did i mess up how i created the database?
i have added my username and given permissions to the security for the database i wish to connect to, but is there another step im missing? i would keep trucking but i would like to have multiple DB on the sql express and pick and choose at the code level, maybe im misunderstanding what the catalog should include or i can change the connections database at another point?

You need to have specific permissions in a database given to a Database User, and that user needs to be Associated with a Server Login. My guess is that you don't quite have things connected together correctly yet. Check ou this BOL topic that helps lay out how Windows Users, SQL Logins and Database Users all fit together.

Once you have things associated together, you should be able to work in a database.

Mike

|||

You cannot use "User ID=blah\me". If you are trying to use your domain account, just use "Trusted_Connection=Yes". User ID is used for SQL Authentication, and you cannot specify a domain account.

You must have login permission for the "Initial Catalog=DB", otherwise, you won't be able to login. Logins are for server and user id is for database. You can more inside here: http://builder.com.com/5100-6388-5055543.html

some quote:

<<<<While logins belong to servers, users belong to databases. A user ID identifies a particular user of
a particular database. Also, users are specific to databases—that is, user Fred in the Northwind database
is not the same as user Fred in the pubs database, although both Freds may be associated with the same login.>>>>>

Wednesday, March 7, 2012

Can BCP Handle Leap Day: 2/29/08 ?

I have a production job that is killing BCP... If I change the dates to
2/28/08, the file processes just fine. Here is the error message ... is
this a known issue? Is there a fix for this?
#@. Row 11366, Column 2: Invalid date format @.#
1/21/08 2/29/08 1 0073210002300 0 3.68 12
#@. Row 24909, Column 2: Invalid date format @.#
1/21/08 2/29/08 4 0073210002300 0 3.68 12
#@. Row 38452, Column 2: Invalid date format @.#
1/21/08 2/29/08 7 0073210002300 0 3.68 12
#@. Row 51995, Column 2: Invalid date format @.#
1/21/08 2/29/08 14 0073210002300 0 3.68 12
#@. Row 65538, Column 2: Invalid date format @.#
Thanks!
Greg,
I am sure that bcp is simply using the SQL Server engine, so I would expect
it to 'know'. When I tested the following file all rows worked.
2/29/08
2/28/08
2/29/2008
2/28/2008
If the date was invalid, you would get the message that you show. I get the
errorw when I include a row with:
2/30/2008
So, one possibility is that your format file (or the format of your file) is
the problem. Are you using a format file or are you depending on tabs and
column order? (The latter is fine when it works, of course, but sometimes
you need a format file to control things more. See:
http://support.microsoft.com/kb/67409 and look "format files" in the SQL
Server Book Online for some examples.)
RLF
"greg may" <gregory_may [at] yahoo [dot] com> wrote in message
news:%233wz4JyvHHA.736@.TK2MSFTNGP06.phx.gbl...
>I have a production job that is killing BCP... If I change the dates to
>2/28/08, the file processes just fine. Here is the error message ... is
>this a known issue? Is there a fix for this?
> #@. Row 11366, Column 2: Invalid date format @.#
> 1/21/08 2/29/08 1 0073210002300 0 3.68 12
> #@. Row 24909, Column 2: Invalid date format @.#
> 1/21/08 2/29/08 4 0073210002300 0 3.68 12
> #@. Row 38452, Column 2: Invalid date format @.#
> 1/21/08 2/29/08 7 0073210002300 0 3.68 12
> #@. Row 51995, Column 2: Invalid date format @.#
> 1/21/08 2/29/08 14 0073210002300 0 3.68 12
> #@. Row 65538, Column 2: Invalid date format @.#
>
>
> Thanks!
>
|||Thanks Russell for your feedback. I will have to set up some more tests to
track this down further.
We are not using a format file in this case. Its using an implicid
conversion as the table structure and the field lay outs are an exact match
(Using Pipe delimiters) ... this may be part of what is causing the issue?
In this case, the destination table is using a SmallDateTime.
I will see if I can reproduce the problem with only the above conditions.
g.
"Russell Fields" <russellfields@.nomail.com> wrote in message
news:uUKHnIzvHHA.4244@.TK2MSFTNGP04.phx.gbl...
> Greg,
> I am sure that bcp is simply using the SQL Server engine, so I would
> expect it to 'know'. When I tested the following file all rows worked.
> 2/29/08
> 2/28/08
> 2/29/2008
> 2/28/2008
> If the date was invalid, you would get the message that you show. I get
> the errorw when I include a row with:
> 2/30/2008
> So, one possibility is that your format file (or the format of your file)
> is the problem. Are you using a format file or are you depending on tabs
> and column order? (The latter is fine when it works, of course, but
> sometimes you need a format file to control things more. See:
> http://support.microsoft.com/kb/67409 and look "format files" in the SQL
> Server Book Online for some examples.)
> RLF
> "greg may" <gregory_may [at] yahoo [dot] com> wrote in message
> news:%233wz4JyvHHA.736@.TK2MSFTNGP06.phx.gbl...
>

Can backup to disk, but not to tape - Access Denied

I have been trying to use the Maintenance Wizard to setup a backup job to
tape however I continually get an Access Denied message for the failure.
Even when I try to insert a previously successful tape and try to see what
is on it I still get the Access denied message (Bad Password). I am able to
backup to a folder without any problem.
Both SQL server and Agent start with a Domain Admin account and I have
created these jobs while logging in with the accounts. I have even created
the databases with this account as well. No problem accessing the data,
just backing up to tape.
Windows 2003 Server SP1
SQL 2000 SP3
All latest Windows UpdatesJordan wrote:
> I have been trying to use the Maintenance Wizard to setup a backup job to
> tape however I continually get an Access Denied message for the failure.
> Even when I try to insert a previously successful tape and try to see what
> is on it I still get the Access denied message (Bad Password). I am able to
> backup to a folder without any problem.
> Both SQL server and Agent start with a Domain Admin account and I have
> created these jobs while logging in with the accounts. I have even created
> the databases with this account as well. No problem accessing the data,
> just backing up to tape.
> Windows 2003 Server SP1
> SQL 2000 SP3
> All latest Windows Updates
>
>
For what it's worth, most folks don't write SQL backups directly to
tape. Write your SQL backups to disk, and then let your tape backup
software backup those backup files to tape.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||I found that even though the services are run as MYDOMAIN\Administrator the
backup task kept getting set to run as Administrator@.mydomain.com. When I
manually changed the job to MYDOMAIN\Administrator it started to work.
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4526493E.6080206@.realsqlguy.com...
> Jordan wrote:
>> I have been trying to use the Maintenance Wizard to setup a backup job to
>> tape however I continually get an Access Denied message for the failure.
>> Even when I try to insert a previously successful tape and try to see
>> what is on it I still get the Access denied message (Bad Password). I am
>> able to backup to a folder without any problem.
>> Both SQL server and Agent start with a Domain Admin account and I have
>> created these jobs while logging in with the accounts. I have even
>> created the databases with this account as well. No problem accessing
>> the data, just backing up to tape.
>> Windows 2003 Server SP1
>> SQL 2000 SP3
>> All latest Windows Updates
>>
>>
> For what it's worth, most folks don't write SQL backups directly to tape.
> Write your SQL backups to disk, and then let your tape backup software
> backup those backup files to tape.
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com

Can backup to disk, but not to tape - Access Denied

I have been trying to use the Maintenance Wizard to setup a backup job to
tape however I continually get an Access Denied message for the failure.
Even when I try to insert a previously successful tape and try to see what
is on it I still get the Access denied message (Bad Password). I am able to
backup to a folder without any problem.
Both SQL server and Agent start with a Domain Admin account and I have
created these jobs while logging in with the accounts. I have even created
the databases with this account as well. No problem accessing the data,
just backing up to tape.
Windows 2003 Server SP1
SQL 2000 SP3
All latest Windows Updates
Jordan wrote:
> I have been trying to use the Maintenance Wizard to setup a backup job to
> tape however I continually get an Access Denied message for the failure.
> Even when I try to insert a previously successful tape and try to see what
> is on it I still get the Access denied message (Bad Password). I am able to
> backup to a folder without any problem.
> Both SQL server and Agent start with a Domain Admin account and I have
> created these jobs while logging in with the accounts. I have even created
> the databases with this account as well. No problem accessing the data,
> just backing up to tape.
> Windows 2003 Server SP1
> SQL 2000 SP3
> All latest Windows Updates
>
>
For what it's worth, most folks don't write SQL backups directly to
tape. Write your SQL backups to disk, and then let your tape backup
software backup those backup files to tape.
Tracy McKibben
MCDBA
http://www.realsqlguy.com
|||I found that even though the services are run as MYDOMAIN\Administrator the
backup task kept getting set to run as Administrator@.mydomain.com. When I
manually changed the job to MYDOMAIN\Administrator it started to work.
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4526493E.6080206@.realsqlguy.com...
> Jordan wrote:
> For what it's worth, most folks don't write SQL backups directly to tape.
> Write your SQL backups to disk, and then let your tape backup software
> backup those backup files to tape.
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com

Can backup to disk, but not to tape - Access Denied

I have been trying to use the Maintenance Wizard to setup a backup job to
tape however I continually get an Access Denied message for the failure.
Even when I try to insert a previously successful tape and try to see what
is on it I still get the Access denied message (Bad Password). I am able to
backup to a folder without any problem.
Both SQL server and Agent start with a Domain Admin account and I have
created these jobs while logging in with the accounts. I have even created
the databases with this account as well. No problem accessing the data,
just backing up to tape.
Windows 2003 Server SP1
SQL 2000 SP3
All latest Windows UpdatesJordan wrote:
> I have been trying to use the Maintenance Wizard to setup a backup job to
> tape however I continually get an Access Denied message for the failure.
> Even when I try to insert a previously successful tape and try to see what
> is on it I still get the Access denied message (Bad Password). I am able
to
> backup to a folder without any problem.
> Both SQL server and Agent start with a Domain Admin account and I have
> created these jobs while logging in with the accounts. I have even create
d
> the databases with this account as well. No problem accessing the data,
> just backing up to tape.
> Windows 2003 Server SP1
> SQL 2000 SP3
> All latest Windows Updates
>
>
For what it's worth, most folks don't write SQL backups directly to
tape. Write your SQL backups to disk, and then let your tape backup
software backup those backup files to tape.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||I found that even though the services are run as MYDOMAIN\Administrator the
backup task kept getting set to run as Administrator@.mydomain.com. When I
manually changed the job to MYDOMAIN\Administrator it started to work.
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4526493E.6080206@.realsqlguy.com...
> Jordan wrote:
> For what it's worth, most folks don't write SQL backups directly to tape.
> Write your SQL backups to disk, and then let your tape backup software
> backup those backup files to tape.
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com

Sunday, February 12, 2012

Can .net 1.1 work with SQL SERVER 2005 ?

What should I do if I want my asp.net 1.1 work with sql server 2005

I get wrong message :SQL Server does not exist or access denied

Well, you don't need to change any code.. there is no different of working against a SQL 2005, it's the same way as working against SQL server 2000 etc.

If you have some problem to connect to the SQL Server 2005, just check your connection string if it's correct. For example if you provide the right user name and password etc. The connection string for connecting to a SQL Server 2000 and SQL Server 2005 is the same..

|||

Hi,

Yes of course it can work with .Net 1.1. Please make sure that the connection string is correct. If you are using SqlExpress the instance name of the SQL 2005 is MachineName\SQLEXPRESS.

|||

Yes it is work in my boxdev, but id does not work in my web hosting.

I try it in my hosting to set using 2.0 and work fine, but when I use 1.1 it is like the server does not existed. The server name using IP etc xxx.xxx.xxx.xxx. And it work fine too when I used in remote connection using sql server management studio.

So what make this 1.1 can not fine or denied access to sql server. You know I 'm have used right connection string.

|||

I have check that the hosting use sql server 2005 express. Is there a problem when using 1.1 with 2005 express ? Because it is just fine in 2005 developer ?

|||

Hi,

You may try this KB article:http://support.microsoft.com/kb/928319/en-us It indicates the main causes of the problem and provide some solutions for you to refer.

Hopt that helps. Thanks.