Friday, March 30, 2012
Populate a table with a guid
creating the field, entering NewID() as the default, and isrowguid Yes but
it just gives me errors that the field cannot be null because it already is
null. Do i have to create a blank table with the new id, then dump the data
into it, then rename the tables? I have a lot of relationships taht will
break if I have to do that. Thanks for your help.Stop using Enterprise Manager for this stuff.
CREATE TABLE foo
(
a INT
)
GO
INSERT foo SELECT 1
INSERT foo SELECT 2
ALTER TABLE foo ADD guid UNIQUEIDENTIFIER
GO
ALTER TABLE foo ADD CONSTRAINT guidDefault DEFAULT(NEWID()) FOR guid
GO
UPDATE foo SET guid = NEWID()
GO
SELECT * FROM foo
GO
INSERT foo(a) SELECT 3
GO
SELECT * FROM foo
GO
DROP TABLE foo
GO
"eagle" <eagle@.yahoo.com> wrote in message
news:uR4rkB3pFHA.156@.TK2MSFTNGP11.phx.gbl...
> How do I populate a table with existing data with a new guid field? I
> tried creating the field, entering NewID() as the default, and isrowguid
> Yes but it just gives me errors that the field cannot be null because it
> already is null. Do i have to create a blank table with the new id, then
> dump the data into it, then rename the tables? I have a lot of
> relationships taht will break if I have to do that. Thanks for your help.
>|||Never Mind, updating the table with set newfield=newid() did the trick.
"eagle" <eagle@.yahoo.com> wrote in message
news:uR4rkB3pFHA.156@.TK2MSFTNGP11.phx.gbl...
> How do I populate a table with existing data with a new guid field? I
> tried creating the field, entering NewID() as the default, and isrowguid
> Yes but it just gives me errors that the field cannot be null because it
> already is null. Do i have to create a blank table with the new id, then
> dump the data into it, then rename the tables? I have a lot of
> relationships taht will break if I have to do that. Thanks for your help.
>|||Hi,
You can set the column to allow nulls and then do a simple update statement
to update the column
You don't need to to set isrowguid is you don't need to
--
kind regards
Greg O
Need to document your databases. Use the firs and still the best AGS SQL
Scribe
http://www.ag-software.com
"eagle" <eagle@.yahoo.com> wrote in message
news:uR4rkB3pFHA.156@.TK2MSFTNGP11.phx.gbl...
> How do I populate a table with existing data with a new guid field? I
> tried creating the field, entering NewID() as the default, and isrowguid
> Yes but it just gives me errors that the field cannot be null because it
> already is null. Do i have to create a blank table with the new id, then
> dump the data into it, then rename the tables? I have a lot of
> relationships taht will break if I have to do that. Thanks for your help.
>
Monday, March 26, 2012
PollingInterval
need to be the same? I've found that if I don't change the default in the
job (no parameter) for the LogReader Agent and I include the parameter in the
job for the Distribution Agent, the Distribution Agent just hangs on Step1
(Starting agent).
Thanks,
Mark
they don't have to be the same, but ideally the log reader agent should be
more than the distribution agent. I have not noticed them hanging.
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
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
"mrprice" <mrprice@.discussions.microsoft.com> wrote in message
news:E8218B91-B40F-46A9-BFA2-AFE3383C3FD5@.microsoft.com...
> Does the PollingInterval parameter on the LogReader and Distribution Agent
> need to be the same? I've found that if I don't change the default in the
> job (no parameter) for the LogReader Agent and I include the parameter in
> the
> job for the Distribution Agent, the Distribution Agent just hangs on Step1
> (Starting agent).
> Thanks,
> Mark
Friday, March 9, 2012
PLEASE! - Login failed for user MACHINENAME\ASPNET.
Help!! I am using Sql Server 2005 Express.
I am trying to connect to it from an aspx page.
I get the error:
Cannot open user default database. Login failed.
Login failed for user 'MACHINENAME\ASPNET'.
I have added MACHINENAME\ASPNET as a user to the database I am trying to connect to using SQL Server Management Studio Express.
Why wont it let me connect?
Any help on the matter would be most welcome.
Thanks you.
Hi,
I use sql server 2000 but I had th same problem a few months ago. You should examine 2 options. First look at the groups in your windows not on the sql server and see if aspnet and guest accounts are enabled or disabled. If they are disabled pls make them enabled then delete the available aspnet account in your sql. Create again an aspnet account in your sql choosing available accounts in your windows account, dont create aspnet account by typing aspnet yourself. just choose. Finally as you know, give this account necessary permissions you need to do your work in your database. I hope this will solve the problem :)
The Ghost of PC
[ Peace in country, peace in the world]
Cannot open user default database
The user you set up does not have permissions on the database you set as the users default database.
|||ghost,
I'm a real newbie. How do I look at groups in my windows? I have the same problem, only with some databases and not others.
dennist685
|||No offense but I kind of guessed that! If you see my message you'll see that I already added the user so that wasn't the problem.I actually changed the way I connected to the database to:
Data Source=.\SQLEXPRESS;Initial Catalog=myDb;Integrated Security=True;
previously I was using:
Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|myDb.mdf
Now, here's the wiered thing. If I connect using the top method, it works and I'm connecting as machinename/ASPNET.
If I use the second connection string, I'm still connecting as machinename/ASPNET but the login fails.
So, if anyone can explain that, I'd be interested to know why it happens. I've set up machinename/ASPNET as a user so that ISN'T the problem as it lets me connect using the top connection string. It seems to be when I use the bottom method for connecting that I get the error even though I know that machinname/ASPNET is set up as a user on the database.
Saturday, February 25, 2012
Please help. How to set a Parameter in SSRS in runtime? Parameters!myParam.Value property is rea
You can set the default value of a reporting services parameter by any expression.
But with code I'm NOT allowed to do:
Parameters!myParam.Value = CDate("01.01.2007")
This is cause Value property is read-only.
So the question would be:
Are there any way I set a parameter value in runtime ?
Hope anyone can help...
Use VB.Net or C# code (Report -> Report Properties -> Code tab) to store the parameter in some shared variable. Use this variable to set and retrieve value whenever and wherever you need in the report by using the syntax Code.MySharedVar
Shyam
|||Hi Shyam,
I have tried that also, but the problem is that the calendar control turn into a drop-down combo control when you apply either code or connect it to a dataset.
The parameter is a datetime type. As long as you add logic to the "default value" it showns the calendar control, if you add anything to "available values" the calendar disappears and a combo is shown. Any ida what I can do to keep it displaying the calendar control ?
|||I guess you are raising a new issue now. I dont think your issue can be solved at the reporting services level.