Showing posts with label dbo. Show all posts
Showing posts with label dbo. Show all posts

Wednesday, March 28, 2012

model db owner

I have a request to add a user to the model db dbo group.
Can you provide pros/cons to this request
thanks again
"stoney" <stoney@.discussions.microsoft.com> wrote in message
news:DA0A3CE6-26BD-41C9-91D3-1257A1C8B513@.microsoft.com...
>I have a request to add a user to the model db dbo group.
> Can you provide pros/cons to this request
> thanks again
Pro:
That user will be created in any new databases you create.
Con:
That user will be created in any new databases you create.
|||What they're asking is for someone to have dbo access to every database ever
created in that server. I suppose if the user is the CEO that might be
justified but that's a lot of privileged access to give to anyone.
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
"stoney" <stoney@.discussions.microsoft.com> wrote in message
news:DA0A3CE6-26BD-41C9-91D3-1257A1C8B513@.microsoft.com...
>I have a request to add a user to the model db dbo group.
> Can you provide pros/cons to this request
> thanks again
|||"Roger Wolter[MSFT]" <rwolter@.online.microsoft.com> wrote in message
news:ACF4C5D7-F192-4B68-B05D-B1BF5D951204@.microsoft.com...
> What they're asking is for someone to have dbo access to every database
> ever created in that server. I suppose if the user is the CEO that might
> be justified but that's a lot of privileged access to give to anyone.
>
Oops, missed the dbo part. That's probably not a good idea.

> --
> 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
> "stoney" <stoney@.discussions.microsoft.com> wrote in message
> news:DA0A3CE6-26BD-41C9-91D3-1257A1C8B513@.microsoft.com...
>
Greg Moore
SQL Server DBA Consulting
sql (at) greenms.com http://www.greenms.com

model db owner

I have a request to add a user to the model db dbo group.
Can you provide pros/cons to this request
thanks again"stoney" <stoney@.discussions.microsoft.com> wrote in message
news:DA0A3CE6-26BD-41C9-91D3-1257A1C8B513@.microsoft.com...
>I have a request to add a user to the model db dbo group.
> Can you provide pros/cons to this request
> thanks again
Pro:
That user will be created in any new databases you create.
Con:
That user will be created in any new databases you create.|||What they're asking is for someone to have dbo access to every database ever
created in that server. I suppose if the user is the CEO that might be
justified but that's a lot of privileged access to give to anyone.
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
"stoney" <stoney@.discussions.microsoft.com> wrote in message
news:DA0A3CE6-26BD-41C9-91D3-1257A1C8B513@.microsoft.com...
>I have a request to add a user to the model db dbo group.
> Can you provide pros/cons to this request
> thanks again|||"Roger Wolter[MSFT]" <rwolter@.online.microsoft.com> wrote in message
news:ACF4C5D7-F192-4B68-B05D-B1BF5D951204@.microsoft.com...
> What they're asking is for someone to have dbo access to every database
> ever created in that server. I suppose if the user is the CEO that might
> be justified but that's a lot of privileged access to give to anyone.
>
Oops, missed the dbo part. That's probably not a good idea.

> --
> 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
> "stoney" <stoney@.discussions.microsoft.com> wrote in message
> news:DA0A3CE6-26BD-41C9-91D3-1257A1C8B513@.microsoft.com...
>
Greg Moore
SQL Server DBA Consulting
sql (at) greenms.com http://www.greenms.com

model db owner

I have a request to add a user to the model db dbo group.
Can you provide pros/cons to this request
thanks again"stoney" <stoney@.discussions.microsoft.com> wrote in message
news:DA0A3CE6-26BD-41C9-91D3-1257A1C8B513@.microsoft.com...
>I have a request to add a user to the model db dbo group.
> Can you provide pros/cons to this request
> thanks again
Pro:
That user will be created in any new databases you create.
Con:
That user will be created in any new databases you create.|||What they're asking is for someone to have dbo access to every database ever
created in that server. I suppose if the user is the CEO that might be
justified but that's a lot of privileged access to give to anyone.
--
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
"stoney" <stoney@.discussions.microsoft.com> wrote in message
news:DA0A3CE6-26BD-41C9-91D3-1257A1C8B513@.microsoft.com...
>I have a request to add a user to the model db dbo group.
> Can you provide pros/cons to this request
> thanks again|||"Roger Wolter[MSFT]" <rwolter@.online.microsoft.com> wrote in message
news:ACF4C5D7-F192-4B68-B05D-B1BF5D951204@.microsoft.com...
> What they're asking is for someone to have dbo access to every database
> ever created in that server. I suppose if the user is the CEO that might
> be justified but that's a lot of privileged access to give to anyone.
>
Oops, missed the dbo part. That's probably not a good idea.
> --
> 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
> "stoney" <stoney@.discussions.microsoft.com> wrote in message
> news:DA0A3CE6-26BD-41C9-91D3-1257A1C8B513@.microsoft.com...
>>I have a request to add a user to the model db dbo group.
>> Can you provide pros/cons to this request
>> thanks again
>
Greg Moore
SQL Server DBA Consulting
sql (at) greenms.com http://www.greenms.com

Friday, March 9, 2012

Missing SET keyword.

Using the following update command I get the following message

UPDATE Last, First, [Card Number], [Phone Number], IDKey
FROM dbo.LibUserS

error:

Missing SET keyword.
Unable to parse query text.

incorrect syntax near ','

thats correct. The update statement requires the fields to update as well as on which record you want to update. Example:

UPDATE [TableName]

SET [FieldName] = someNewValue

WHERE [fieldName] = SomeValue

typically:

UPDATE [dbo.LibUserS]

SET Last = @.p1,

SET First = @.p2,

SET [Card Number] = @.p3,

SET [Phone Number] = @.p4

WHERE IDKey = @.IDValue

the @.parameter is the parameter you supply in the query on the command object (OleDbCommand or SqlCommand, whichever database connection/driver you are using) so it can take those values and replace them with the @.parameter "placeholder" if you like.

|||Helped, perfect, Thanks!

Missing results from stored proc

ok...I must be blind.
I have this procedure (which I didn't write):
CREATE PROCEDURE dbo.spWebqryAccountList41257
(@.StartDate nvarchar(15)
,@.EndDate nvarchar(15)
,@.ClientID int
,@.ArpCode nvarchar(15)
,@.brchid nvarchar(5)
,@.username nvarchar(10)
)
AS
SELECT *
FROM
dbo.vwWebClaimDetailNext4
WHERE
([Date Handled] between @.StartDate AND @.EndDate)
AND ([Client ID] = @.ClientID)
and ARPCODE in (@.ArpCode)
and BranchID = @.brchid
and username = @.username
Note that all it is doing is selecting from a view and narrowing the results
I have two executions:
EXEC spWebqryAccountList41257
@.StartDate = '2/1/2006',
@.EndDate = '3/3/2006',
@.ClientID = 2287,
@.ARPCode = 'A',
@.BrchID = 'A#79',
@.Username = 'ME2287'
Result = 4 records
EXEC spWebqryAccountList41257
@.StartDate = '2/1/2006',
@.EndDate = '3/3/2006',
@.ClientID = 2287,
@.ARPCode = 'A',
@.BrchID = 'Mil#104',
@.Username = 'ME2287'
Result = 0 records
The only difference between the two is the @.BrchID parameter.
The underlying view run with the same parameters as the second execution in
the WHERE clause returns records (7, to be exact) for the second set, but
the stored proc does not.
If I do this:
SELECT *
FROM
dbo.vwWebClaimDetailNext4
WHERE
([Date Handled] between '2/1/2006' and '3/3/2006')
AND ([Client ID] =2287)
and ARPCODE in ('A')
and BranchID = 'Mil#104'
and username = 'ME2287'
I get the right results...
I've been looking at the # sign as the culprit, but both branches have one
(as do many others).
Help?
--
Kevin Hill
3NF Consulting
www.3nf-inc.com/NewsGroups.htmNevermind...the @.brchid parameter isn't big enough to hold what is being
passed...
Thanks for looking :-)
Kevin Hill
3NF Consulting
www.3nf-inc.com/NewsGroups.htm
www.expertsrt.com - not your average tech Q&A site
"Kevin3NF" <Kevin@.DontNeedNoSpam3NF-inc.com> wrote in message
news:ORLUL$ZQGHA.3896@.TK2MSFTNGP15.phx.gbl...
> ok...I must be blind.
> I have this procedure (which I didn't write):
> CREATE PROCEDURE dbo.spWebqryAccountList41257
> (@.StartDate nvarchar(15)
> ,@.EndDate nvarchar(15)
> ,@.ClientID int
> ,@.ArpCode nvarchar(15)
> ,@.brchid nvarchar(5)
> ,@.username nvarchar(10)
> )
> AS
> SELECT *
> FROM
> dbo.vwWebClaimDetailNext4
> WHERE
> ([Date Handled] between @.StartDate AND @.EndDate)
> AND ([Client ID] = @.ClientID)
> and ARPCODE in (@.ArpCode)
> and BranchID = @.brchid
> and username = @.username
>
> Note that all it is doing is selecting from a view and narrowing the
> results
> I have two executions:
> EXEC spWebqryAccountList41257
> @.StartDate = '2/1/2006',
> @.EndDate = '3/3/2006',
> @.ClientID = 2287,
> @.ARPCode = 'A',
> @.BrchID = 'A#79',
> @.Username = 'ME2287'
> Result = 4 records
> EXEC spWebqryAccountList41257
> @.StartDate = '2/1/2006',
> @.EndDate = '3/3/2006',
> @.ClientID = 2287,
> @.ARPCode = 'A',
> @.BrchID = 'Mil#104',
> @.Username = 'ME2287'
> Result = 0 records
> The only difference between the two is the @.BrchID parameter.
> The underlying view run with the same parameters as the second execution
> in the WHERE clause returns records (7, to be exact) for the second set,
> but the stored proc does not.
> If I do this:
> SELECT *
> FROM
> dbo.vwWebClaimDetailNext4
> WHERE
> ([Date Handled] between '2/1/2006' and '3/3/2006')
> AND ([Client ID] =2287)
> and ARPCODE in ('A')
> and BranchID = 'Mil#104'
> and username = 'ME2287'
> I get the right results...
> I've been looking at the # sign as the culprit, but both branches have one
> (as do many others).
> Help?
> --
> Kevin Hill
> 3NF Consulting
> www.3nf-inc.com/NewsGroups.htm
>
>
>