Friday, March 30, 2012
How to control MS SQL Server DataBases permissions through visual basic program
Could someone help me to view, add, delete, and modify users of SQL Server DataBase and permissions of them on this database through Visual Basic Programming
Because I want to do VB application through which I will view, add,delete, and modify users of SQL Server DataBase and their permissions on this database.
Thank you very very muchYou can use the system stored procedures.|||Originally posted by rnealejr
You can use the system stored procedures.
Thank you very much Mr. rnealejr for your reply.
Would you like to send me a sample code in visual basic to view ,for example, users of SQL Server DataBase and their permissions??
I will be thankful|||Which version of sql server are you using 7 or 2000 ?|||Originally posted by rnealejr
Which version of sql server are you using 7 or 2000 ?
Hello, Mr. rnealejr
I use MS SQL Server 2000.
Also, I have a problem with SQL Server.
I have about 50 tables and views in an Oracle DataBase and I have tried to translate them to SQL Server DataBases.
They were translated succefully but there was two problems :
1- Key constraints were not translated? (i.e. the destination SQL Server database became without primary key and foreign key constraints and aother constraints)
2- Also, views are translated into tables not into view ??
Could you slove these problems?
After I get more information I will be able to serve your good forum with good posts becuase until now I am student
Thank you very much|||How did you translate from oracle to sql server ?|||You can use sp_helpuser, sp_helplogins - use the ado command object.|||Originally posted by rnealejr
How did you translate from oracle to sql server ?
Yes
I have used DTS Wizard to do this translation but tables were translated without constraints and also views were translated into tables instead of corresponding views although all tables, from whcih views get data, are available in the translated database.
Thank you very much Mr.
Wednesday, March 28, 2012
How to construct a cell value
for an identifier in their projects. The DB will use a bigint for a
record number, but I need to construct the value they'll use for their
"human"-readable value.
It'll go like this: A000, A001, A002, A003... B000, B001... AA00, AA01,
etc. Where each place is cycled through the alphabet first then 0-9.
I figure the first 2 places will give them enough project ids to last 10
years or so, but programming this thing needs to plan for longevity and
maintenance.
What is the best way to build this? Regular expressions, pure SQL in a
sproc? I need to have rules to build it appropriately and
systematically. I'll be writing the front ends in C#.NET.
Thanks in advance.
_E
*** Sent via Developersdex http://www.examnotes.net ***Why A001 is more human readable than 1?
Creating that kind of column will stop you from using bulk inserts without
traversing the set to calculate that value.
AMB
"Esteban404" wrote:
> My users have decided they want to use an alpha-numeric concatenation
> for an identifier in their projects. The DB will use a bigint for a
> record number, but I need to construct the value they'll use for their
> "human"-readable value.
> It'll go like this: A000, A001, A002, A003... B000, B001... AA00, AA01,
> etc. Where each place is cycled through the alphabet first then 0-9.
> I figure the first 2 places will give them enough project ids to last 10
> years or so, but programming this thing needs to plan for longevity and
> maintenance.
> What is the best way to build this? Regular expressions, pure SQL in a
> sproc? I need to have rules to build it appropriately and
> systematically. I'll be writing the front ends in C#.NET.
> Thanks in advance.
> _E
> *** Sent via Developersdex http://www.examnotes.net ***
>|||Thanks for the suggestions, Jim, leoinfo y el estimado Sr. Mesa, but this is
a central ID for all applications across multiple locations, so they need to
be unique.
What I've decided to do it use a table of seed values containing the low and
high values along with a "row" identity. I'll do the check in my object code
.
I tried to create a new numbering system, which would have been great, but
they do not want alpha in the places below 1000, i.e. A999 goes to B000, not
to A99A as in a number system. See the last one in the A999 example should b
e
AYYY then it goes to B000. The seed values fix that, but it's a cludge. No
doubt.
I'm sure it'll have at least 15 changes before it's finished, but I think
I've anticipated most of them. I've written some DOD stuff so version and
revision control code already exists that I can modify. I'll just act like
it's a life altering change. :-]
_E
"Jim Underwood" wrote:
> Why not just use the identifier that you already have and let them input a
> human readable description or short description?
> "Esteban404" <esteban> wrote in message
> news:eaB%23cc$VGHA.2040@.TK2MSFTNGP15.phx.gbl...
>
>sql
Wednesday, March 21, 2012
How to connect generic database field to report?
Hello,
I want to make a report where multiple users can use the same report to connect to their databases and then print out the report with information from those databases. Both databases have the exact same tables and fields but the data that is in them is different. However, I have only been able to figure out how to connect the report to one specific database, and therefore the report always prints out information from that database instead of the user specified one. So let's say I want my report to print out the name that is in the database field Name for any database I connect to, how would I do this?
Assuming SSRS 2005, you can use an expression-based connection string as demonstrated in the ExpressionBasedConnection sample report in this download. Since I think it is a no-no to pass the connection string as a report parameter, the report gets it from the Report Server config file.|||I looked at your samples but I'm not sure I quite understand them. It looks like your ExpressionBasedConnection report just connected to the database named AdventureWorks. But my reports are going to be connecting to databases that have the same underlying structure but with variable names that I won't know when creating the report. I will only know the name of the database when the user runs our software to connect to whatever database they use. But I still want to create a report that will use, for example, the Name, Address, State fields from the Customer table, but I don't want to hook it up to one specific database. How do I do this?|||OK, but somehow the end-user has to specify the database name at some point, correct? Let's assume that the user will pass the database name as a report parameter. Then, you can use an expression-based connection string in the report data source (it must be private), to establish connection to that database.
Did I miss anything?
|||Yes at some point the user will specify what database they want to connect to but I don't think I fully understand how to use that database in the report. So let's say I want to add a dataset to my report by the name of Company. So in the Dataset tab of the report I select new dataset and I get to the Dataset dialog box. So I name the dataset Company. I go into the "Datasource connection" dialog box by clicking the ... button. I've created a parameter for the dataset call ConnectionStr, so therefore in the Connection String edit box, I type " = Parameters!Connection.Value". Then I click OK that dialog and return to the Dataset dialog box. For the query string I type "SELECT * FROM Company" and then click OK. So in the datasets toolbar, I can see a dataset named Company but it doesn't have any of the company fields in it like Name, Address, etc. How to I get these fields in the dataset so I can use them in my report? Since the report doesn't know what the ConnectionStr parameter is yet it doesn't seem like it will be able to do this.|||Start with a normal connection string. Click the Refresh Fields button on the Data tab in the Report Designer. Then change to an expression-based connection string.|||Alright, so I did what you suggested, but when I drag a field from the dataset I want it says First(Fields!Name.Value, "Company"), but I don't want a report that just prints the information of the first company in the dataset, I want a report printed for every company that is in the dataset after my query has been applied.|||This usually happens when the data region is bound to a different dataset than the one you are dragging the fields from. Take a look at the Dataset property of the data region and clear it (or set to Company). Then, you can re-drag your fields or remove the First function so the field reference is =Fields!Name.Value.|||So I've accomplished this, and now I am having a similar problem of connecting a generic data source to the reportviewer. When I'm in the Data Sources window and I select Add New Data Source, in order to add a new one, I have to select a specific database. But I don't want the reportviewer to connect to one specific data source, I just want it to print out the report that I have made following your tips, how do I do this?