Hi,I'm having a few problems with my forms saving things like £ signs.I'm trying to store all my data in plain text with-in a MS SQL 2000 database, but for some reason certain characters are being automatically removed. I don't really want to use the HTML code for these characters so was wondering if anyone know how I could stop these characters automatically being removed.Many thanks in advance.Below is the code I'm using to insert the text to the database:------------Dim MyConnection9 As New SQLConnection(ConfigurationSettings.AppSettings("ConnectionString")) Dim MySQL9 as string MySQL9 = "INSERT INTO NEWS_ARTICLES " & _ "(NewsTitle, NewsText, NewsDate, NewsShow) " & _ "VALUEs (@title, @text, @date, @show)" Dim Cmd9 as New SqlCommand(MySQL9, MyConnection9) Dim strtitle, strtext, strimage, strdate, strshow strtitle = txttitle.Text strtext = txtText.Text strdate = DateTime.Now strshow = ddlShow.SelectedItem.Value cmd9.Parameters.Add(New SqlParameter("@title", strtitle)) cmd9.Parameters.Add(New SqlParameter("@text", strtext)) cmd9.Parameters.Add(New SqlParameter("@date", strdate)) cmd9.Parameters.Add(New SqlParameter("@show", strshow)) MyConnection9.Open() cmd9.ExecuteNonQuery MyConnection9.Close()------------Regards,Rich
At the moment my asp.net app is working ok and I can connect to the database using windows authentication, however i'm trying to use sql authentication on my local computer.i'm using sql server studio at the moment to manage the database. And tried numerious combinations of things to try and get it working and allow me to connect to the database using SQL authentication but still no luck :(can anyone give me some rough step by step instructions to setting up the sql username and password for forms authentication and activating it for a certain database?thanks
If I have a connection open which is in database master, can I switch to another database within that connection without having to close the connection and recreating it?
Guys! I'm using SQL Mail to send out Emails to Customers re: outstanding Invoices. I also use SQL Mail on the same box to send out emails to our Sales Reps with summaries of outstanding invoices. Now, I've set up multiple outlook profiles on the server. I tried using
DOES NOT WORK!!! the profile does'nt switch at all. SQL Mail sends out all the emails using the profile that it started with. How can I use xp_startmail and xp_stopmail to switch between different user profiles.
If I dump a replicated Db and restore it onto another DB, how do I switch off replication from the restored DB. I believe there were some scripts developed for this in 6.5.
I got the following code to add a column in a matrix with a variance:
IIF(IsNothing(Previous(Sum(Fields!Amount.Value))) or Fields!year.Value=First(Fields!year.Value,"Category") or Previous(Sum(Fields!Amount.Value))=0,nothing, ( (Fields!Amount.Value) /Previous(sum(Fields!Amount.Value)) ) )
This code works fine, except that the first row of the matrix shows an #error
This happens with each matrix where I use this expression. A warning emerges:
rsruntimeerrorinexpression the value expression for the textrun Textbox43.Paragraphs[0].TextRuns[0]' contains an error.
Attempted to divide by zero.
The strange thing is that the part
Fields!year.Value=First(Fields!year.Value,"Category") should prevent an error and I expect it to show 'nothing'
An screenshot of the table. (each color is a different category. Each row stands for 2013, 2014, 2015)
As you can see, all other 2013 rows show a blank cell, except the first row.
I have a Matrix table that expands to the right when choosing an amount of months to be shown. Under this matrix I have to Charts. The two charts are situated together, that is no space between them, and to the left of the report.
Now, if I choose a lot of months, say three years the matrix diagram will be huge to the right. The problem I have is that the second diagram, the one on the right, moves to the right depending on how big the report gets, and this is not good at all. The two charts are supposed to be all the way to the left.
We have an active database that sits on SQL Server 2000 that currently has per seat license...but now want to switch to per processor. If I go to ControlSQL Server 2000 License Set up...it doe not give me the option to choose per processor.
Do I need to un-install/re-install SQL Server 2000 and choose the per processor choice and then re-attach our database ?
I sometimes have problems when running index rebuilds due to the tran log growing too big. MS suggest switching the db from full recovery mode to bulk-logged mode fur the duration of the rebuild. Question is, when you switch a db from full recovery to bulk logged, does that invalidate the tran log backups up to that point? When the db is switched back into full-recovery mode, are the following tran log backups still in sequence?
I would like to know how I can switch from one database to another within the same script. I have a script that reads the header information from a SQL BAK file and loads the information into a Test database. Once the information is in the temp table (Test database) I run the following script to get the database name.
This part works fine.
INSERT INTO @HeaderInfo EXEC('RESTORE HEADERONLY FROM DISK = N''I:TESTdatabase.bak'' WITH NOUNLOAD') DECLARE @databasename varchar(128); SET @databasename = (SELECT DatabaseName FROM @HeaderInfo);
The problem is when I try to run the following script nothing happens. The new database is never selected and the script is still on the test database.
EXEC ('USE '+ @databasename)
The goal is switch to the new database (USE NewDatabase) so that the other part of my script (DBCC CHECKDB) can run. This script checks the integrity of the database and saves the results to a temp table.
My C# application has a DataGridView which is bound to a DataSet. I used Visual Studio to add/configure the data source. Everything works fine on my computer. When I try to run the application on another computer I can't connect to the database, because it uses a wrong connection string.
How can I make a specific connection/connection string permanent for a specific application?
I've got a situation where I need to execute portions of a script against every database on a given instance. I don't know the name of all the databases beforehand so I need to scroll through them all and call the "use" command appropriately.
I need the correct syntax, the following won't work:
DECLARE DBS CURSOR FOR SELECT dbname FROM #helpdb ORDER BY dbname
OPEN DBS
FETCH NEXT FROM DBS INTO @dbname
WHILE @@FETCH_STATUS = 0 BEGIN
USE @dbname
The last line - the "USE" statement - is invalid. The following for example works:
USE master
But when supplied a declared variable a syntax error results for the use command because it expects an identifier.
So .. what is the correct syntax to pass a declared parameter to "USE", or is there another way to meet this requirement?
i want to upload reports in ssrs , when i trying to configure reporting service configuration manager, getting error" there was an error while switching panels. The most likely cause is an error retrieving wmi properties. the exception details are access is denied . You must have an administrator on the report server computer to use this tool".
It is simple question, just slipped out of my mind at this time...... how do we change Security Context for 2005 version from network to local system. thanks,
One of our client application launches a execuatable on server by calling master..xp_cmdshell. We are migrating to SQL 2005 and I would like to use the Context Switching feature
We have sql login client? which is used by clinet application and has very least privelge and have only required access to requried database and tables. xp_cmdshell is disabled by default on our server and I would like to enable xp_cmdshell, launch the executable on the server and disable xp_cmdshell.I have created another SQL Login Bob? and is member of sysadmin. The below SP is created by logging in as Bob?. My objective is to grant execute access on this SP and grant impersonate access to sql login client? . So that client application connecting to SQL server can launch the executable by calling the SP
create proc Bob.[Bob_enable_xp_cmdshell] with execute as 'Bob' as EXEC sp_configure N'show advanced options', N'1' RECONFIGURE WITH OVERRIDE EXEC sp_configure N'xp_cmdshell', N'1' RECONFIGURE WITH OVERRIDE EXEC sp_configure N'show advanced options', N'0' RECONFIGURE WITH OVERRIDE -- launch the application using xp_cmdshell and disable the xp_command shell
When I try to execute (exec [Bob].[jtr_enable_xp_cmdshell] ) the above SP by logging in as Bob, Im getting the below error
Msg 15247, Level 16, State 1, Procedure sp_configure, Line 94 User does not have permission to perform this action. Msg 5812, Level 14, State 1, Procedure jtr_enable_xp_cmdshell, Line 4 You do not have permission to run the RECONFIGURE statement. Msg 15123, Level 16, State 1, Procedure sp_configure, Line 51 The configuration option 'xp_cmdshell' does not exist, or it may be an advanced option. Msg 5812, Level 14, State 1, Procedure jtr_enable_xp_cmdshell, Line 6 You do not have permission to run the RECONFIGURE statement. Msg 15247, Level 16, State 1, Procedure sp_configure, Line 94 User does not have permission to perform this action. Msg 5812, Level 14, State 1, Procedure jtr_enable_xp_cmdshell, Line 7 You do not have permission to run the RECONFIGURE statement.
Please note the SQL Login Bob? is a member of sysadmin fixed role. Thank in advance for you help.
I need to allow only a specific group of users to use a linked server. Rather than granting each user access in the linked server I create and give access to a local SQL login "link_user" and then grant the group impersonate to "link_user". The folllowing statements then work fine:
EXECUTE AS LOGIN = 'link_user'
SELECT * FROM OPENQUERY(linked_server, 'SELECT * FROM ...)
But when I use the exact same statements in a stored procedure I get the folllowing error:
Msg 7416, Level 16, State 1, Procedure linktest2, Line 5
Access to the remote server is denied because no login-mapping exists.
I need to be able to work with the result set which is why I use OPENQUERY rather than EXECUTE... AS... AT which works fine also in stored procedures!?
Is there another workaround then to create all users in the linked server security?
I need to pull data from an Excel Workbook (DTS Excel Source) where the data is stored in worksheets that are each named one of the twelve months of the year. The package is fired by a job that runs once a month. Currently, I have to go into the select statement of the Excel source before the process runs and change the name of the Worksheet that the data is pulled from.
How can I set up the sql statement for the Excel source so that I can pull from the Worksheet that contains the name of the current month?
Hi all--I used the following type of script to migrate tables, views and stored procedures from 'dbo' to 'hqmsuser': alter authorization on dbo.PK_T_PQ_MASTER to HQMSUSER alter schema HQMSUSER transfer dbo.PK_T_PQ_MASTER go
This was per recommendations from the BOL to use instead of the 'sp_changeobjectowner' procedure. I returned the following error:
Msg 15346, Level 16, State 1, Line 3 Cannot change owner for an object that is owned by a parent object. Change the owner of the parent object instead. Msg 15347, Level 16, State 1, Line 4 Cannot transfer an object that is owned by a parent object.
How do I find and change the parent object on this from 'dbo' to a non-dbo schema ownership?
I’m looking for clearity on partition switching. The idea is to use many BULK INSERT statements into table dbo.X_n in parallel and when BULK INSERT for table dbo.X_n is completed, switch dbo.X_n into dbo.bigdaddy. I think this is the fastest way to upload a couple hundred GB of data.
In learning about partition switching (in part) from The Data Loading Performance Guide under Partition SWITCH, I hear the instructions to say copy the main table exactly to become a target. But in that same step (#1), I read that we need to change the default file group of the target (dbo.X_n) from the default file group. Then it says I need to match indexes and lists the filegroup as something we need to match with the main table.
As an overview of the partition switching strategy, I think the whole point of BULK INSERT with partitioning is to have seperate files (in same group) to enable concurrent uploading where each table has its own file. Once the upload is completed to a table (dbo.X_n) then we do the partition switch into the main table (dbo.bigdaddy). The data we just uploaded doesn’t actually move, just the metadata for it.
When I read the instructions linked above, I hear “Don’t have the same filegroup on your target as the main table. You must have the same filegroup on your target as the main table.”
I’m looking for clearity on partition switching. The idea is to use many BULK INSERT statements into table dbo.X_n in parallel and when BULK INSERT for table dbo.X_n is completed, switch dbo.X_n into dbo.bigdaddy. I think this is the fastest way to upload a couple hundred GB of data.
In learning about partition switching (in part) from The Data Loading Performance Guide under Partition SWITCH, I hear the instructions to say copy the main table exactly to become a target. But in that same step (#1), I read that we need to change the default file group of the target (dbo.X_n) from the default file group. Then it says I need to match indexes and lists the filegroup as something we need to match with the main table.
As an overview of the partition switching strategy, I think the whole point of BULK INSERT with partitioning is to have seperate files (in same group) to enable concurrent uploading where each table has its own file. Once the upload is completed to a table (dbo.X_n) then we do the partition switch into the main table (dbo.bigdaddy). The data we just uploaded doesn’t actually move, just the metadata for it.
“Don’t have the same filegroup on your target as the main table. You must have the same filegroup on your target as the main table.”
I am setting up a 3 node cluster as part of an availability group.Initially I tested failover between nodes using SQL Management Studio and everything failed over successfully when I stopped a node, and I was still able to write queries. I started to test with an application which connects using an SQL user and whenever I would switch nodes, I would get login failed. I believe the cause of this issue is because the server logins SID's which are tied to the database are different than the server logins on the other nodes which resulted in login failed.how can I ensure that the server logins SID's are the same between nodes? Is there a way of copying this over or how is this supposed to be done? I read a little about contained databases where I could just set the login on the database itself vs. creating a server login but I would rather not go down that route.
Hello. I hope to explain myself well - I want to make a matrix with two rows. Lats say my data is this: I hava a list of months and in every month I have a number of pepole and there age. How can I show this in a matrix? It need to be in a matrix since I need the columns to expand acording to the month but I don't know how to create two diffrent rows in my matrix.
I have a report thats fully functional. I just want to add a filter so that my "Visits" field only displays the Visits per day that are less then 6. When i try to filter out the matrix or the group, it tells me the datatypes are different . Something about int32. Its in a matrix, but i have seen this happen in a table too, so i guessing thats not the problem. I just want to be able to display the information for Sales Reps with less then 6 Visits. Any help, will be greatlly appreciated.
Adding more columns in a matrix report that dont belong to the columns drilldown dimensions
That is, for example, having the following report:
Product Family
Product
Country City Number of units sold
Then I would add some ratios, that is, Units Sold/Months (sold per month) and other that is the average for Product Family (Units Sold/Number of Product Family), for putting an example some columns should be precalculated prior to the report so do not get into it, the real problem I dont see how to solve is adding one or two columns for showing these calculated column that doesnt depend on the column groups but they do for the rows groups
Any guidance on that?
The only way I am seeing by now is to set it as two different reports, and that is not what my client wants
Hi there,I have installed MS SQL Server 2005 on my machine with windows authentication. But now I want to switch the authentication mode to SQL Authentication. I am unable to switch, I can’t find the proper way to do so here in 2005.Could any one help me in doing this?Thank you,-Ahsan