CREATE TABLE ItemInformation([Description] varchar(80))
GO
INSERT INTO ItemInformation([Description])
SELECT 'CHOCOLATE CHIP‚' UNION ALL
SELECT '‚COOKIES‚' UNION ALL
SELECT '‚CROISSANTS *PLAIN*‚' UNION ALL
SELECT '‚DONUTS‚' UNION ALL
SELECT '‚DONUTS *DOZEN*‚' UNION ALL
SELECT '‚MUFFINS‚' UNION ALL
SELECT '‚BAGELS‚' UNION ALL
SELECT '‚ROLLS‚' UNION ALL
SELECT '‚CUPCAKES‚' UNION ALL
SELECT '‚CRISPIES‚' UNION ALL
SELECT '‚DANISH/SWEET ROLLS‚' UNION ALL
SELECT '‚FUDGE BROWNIES‚' UNION ALL
SELECT '‚PUFF PASTRIES/ECCLES‚' UNION ALL
SELECT '‚STICKY BUNS‚' UNION ALL
SELECT '‚TURNOVERS‚' UNION ALL
SELECT '‚BLACK & WHITE COOKIES‚' UNION ALL
SELECT '‚LINZER TARTS‚' UNION ALL
SELECT '‚SCONES/BISCUITS‚' UNION ALL
SELECT '‚SCUFFINS‚' UNION ALL
SELECT '‚SINFULL BITS‚'
GO
SELECT * FROM ItemInformation
GO
UPDATE ItemInformation
SET [Description] = REPLACE([Description],',','')
GO
SELECT [Description], LEN([Description]) FROM ItemInformation
GO
SELECT REPLACE([Description],',','')
FROM ItemInformation
SELECT REPLACE([Description],'C','')
FROM ItemInformation
SELECT CHARINDEX(',',[Description])
FROM ItemInformation
GO
INSERT INTO ItemInformation([Description])
SELECT 'CHOCOLATE, CHIP‚' UNION ALL
SELECT 'CHOCOLATE, CHIP‚' UNION ALL
SELECT ',CHOCOLATE, CHIP‚' UNION ALL
SELECT ',CHOCOLATE, CHIP‚ ' UNION ALL
SELECT ',CHOCOLATE, CHIP‚ A' UNION ALL
SELECT ',CHOCOLATE, CHIP‚ , '
GO
SELECT REPLACE([Description],',','')
FROM ItemInformation
GO
Does anyone know where I can get information about undocumented stored procedures and extended stored procedures? I found 'xp_dirtree' and I think I've figured out how to use this one but there are others and I'd like some insight into what they do.
I am trying to determine which are undocumented system procedures used to satisfy our company's security audit. Well, the nature of undocumented system procedures is it's undocumented. Hence, it's hard to find.
So, is there a way I can get a list of SQL Server documented system procedures?
I know there are a lot of undocumented system stored procedures such as xp_ntsec_enumdomains, xp_instance_regread etc, that exist on SQL Server.
Does anyone know of any good websites that contain descriptions of what these stored procedures do? In particular I know that a default installation of SQL Server 2000 leaves permission to execute many of these granted to public and I am interested in finding out what the implications of each one of these are? I have tried Googling this topic but there doesn't seem to me much or there (or what is there is in Chinese and I don't really want to click on to!)
We recently moved our servers from one domain to another. Now, we can't grant Windows users access to any databases. We CAN create the user IDs successfully via Enterprise Manager, and get a corresponding row in MASTER..SYSXLOGINS, but can't click on the Database Access tab in the SQL Server Login Properties dialog and grant accesss to any databases. When we try to do so, we get error 15401, "Windows user or group xxx not found". The underlying call is to MASTER..SP_GRANTDBACCESS, and running that via Query Analyzer returns the same error (naturally)
Looking through the code of SP_GRANTDBACCESS, I've determined that what is failing is a call to the undocumented TSQL function GET_SID. This proc takes two parameters, the first is either G<nt group name> or U<nt user name> and the second is NULL in the call in SP_GRANTDBACCESS. If I execute
SELECT GET_SID('U<valid user>', NULL)
it returns NULL, however, if I run
SELECT SUSER_SID(<valid user>)
then I get the Windows SID of whatever valid user name I supply.
We have 3 servers in question, namely production, development and test. We noticed the problem on production. Curiously enough, development and test worked fine.
NOW THE PLOT THICKENS. If I run this query on the dev box....
SELECT SUSER_SID(<id>), GET_SID('U<id>',NULL)
...the first function returned the SID, BUT THE SECOND FUNCTION DID NOT!!! How could that be? Clearly GET_SID was working inside of SP_GRANTDBACCESS, but not as a discrete call. So I went into the master database and added code to print out the SID returned by GET_SID to the proc. Lo and behold, SP_GRANTDBACCESS promptly failed with a 15401 error. It continues to get 15401s now, even after I returned it to the original code. What gives? Now my dev box has the same error production has, and all I did was recompile SP_GRANTDBACCESS a couple of times. FWIW, I did *not* ever make any changes to SP_GRANTDBACCESS on production.
Why doesn't GET_SID() work outside of SP_GRANTDBACCESS? Why did recompiling SP_GRANTDBACCESS break it permanently?
It almost seems like the query compiler can't correctly link a call to GET_SID to the correct function in some DLL, except I thought that the compiled code didn't survive a restart, and all TSQL procs were recompiled the first time they were called after a restart. If that's the case, then the compiler is - or at least was - producing a functioning compiled version of SP_GRANTDBACCESS after every restart.
Service Broker will let you create two services with the same name (one with contract and another without)
CREATE SERVICE [Order Msg Recieve] AUTHORIZATION [dbo] ON QUEUE [dbo].[Order Return Msg Queue]
CREATE SERVICE [Order Msg Receive] AUTHORIZATION [dbo] ON QUEUE [ODS].[Order Return Msg Queue] ([OrderSubmission])
When you delete the service....
drop service [Order Msg Recieve]
It will only drop the first one. In the BOL there is no syntax for telling it to delete the second one, however you can drop it from SQL Management Studio.
When upgrading a database from MSDE to Visual Studio 2005 Express, I've noticed that the system tables in the MSDB database don't get upgraded. For example, the SYSSCHEDULES table doesn't get added. Is this by design or a bug?
Try this in sql server 2005: select COALESCE(a1, char(254)) as c1 from (select 'Z' as a1 union select 'Ya' as a1 union select 'Y' as a1 union select 'W' as a1) as b1 group by a1 with rollup order by c1 select COALESCE(a1, char(255)) as c1 from (select 'Z' as a1 union select 'Ya' as a1 union select 'Y' as a1 union select 'W' as a1) as b1 group by a1 with rollup order by c1
The only difference is that the first one uses 254 and the second one uses 255. The first sorts like this: WYYaZþ The second one sorts like this: WYÿYaZ Is this expected behavior?
Has anyone noticed that if you created DTS package and try to change connection properties (i.e. change DSN or redirect DTS to different server or Database), as soon you click OK it does not save new password and hence does not work anymore. In my case to move Database from Development to Production server I would have to recreate all DTS packages. Is there any way around it?
Currently - our Reporting Services site is setup so that all Domain Users can access it. We are starting to use Report Builder now. I have enabled the My Reports folder feature that that creates a user folder for anyone that logs onto the site. Is there a way to just create the user folders for certain people?
I just installed SQLExpress, with reporting services on my own laptop
However, when I go to http://localhost/Reports/, I can see my reports uploaded, but the subscription links are not available. In Properties, I cannot see "Execution" either.
Can someone help me to get the Subscriptions feature enable again?
We desperately require the RetainSameConnection to be set to True on our ADO.NET - ODBC connection manager. Unfortunately RetainSameConnection always defaults back to False when you open the package.
* Is RetainSameConnection supposed to work for the ADO.NET - ODBC combination?
* Is it a bug that it defaults back to false for the ADO.NET - ODBC combination?
Hi! I am having a terrible time with the report feature. First of all, my queries through it do not match my queries thru SQL server 2005 Express Management. When I enter my fields, through the auto query function, it moves them. When I try to put them where I think they belong (by editing the SQL code, my queries get all messed up).
Is there a way to import my SQL query and run it through the report feature?
I am using windows XP Pro Microsoft Visual Studio 2005 version 8.0.50727.42 Microsoft SQL Server Reporting Services Designers version 9.00.2047.00
Theres a feature in oracle that allows you to modify tables, colums, values and the data from its enterprise console the same way that you can in sql server. In oracle however theres a button called 'show sql' that allows you to see and copy/paste the resulting sql for the changes made via the console.
I would imagine that sql server has a similar option. The reason i ask is that i would like to more fully learn how to do this through the query analyser and get more familiar with sql involved and I would be able to do this if I could see the resulting sql from enterprise manager.
Hope this makes sense.
I did find something in sql server called 'generate sql' but this doesnt update during changes you make automatically.
I installed full-text feature on a previously installed SQL Server. It seemed it installed and it did not give me error but when I run “EXEC sp_fulltext_database 'enable'� it gives me no full-text search featured installed message. Any idea?
I need some help... I'm trying to execute a stored procedure and I'm getting this message
Run-Time Error '-2147217887 (80040e21)':
[Microsoft][ODBC SQL Server Driver]Optional feature not implemented
Here is the code: Public Function D2L(sconnect As Variant, dDate As Variant) As Variant Dim rsDate As ADODB.Recordset Dim cmdDate As ADODB.Command Dim prmDate As ADODB.Parameter
Set cmdDate = New ADODB.Command Set ADOConn = New ADODB.Connection
ADOConn.Open sconnect
Set cmdDate.ActiveConnection = ADOConn cmdDate.CommandText = "dbo.UP_CVRT_DATE_TO_LONG" cmdDate.CommandType = adCmdStoredProc
Set prmDate = New ADODB.Parameter prmDate.Type = adDate 'prmDate.Size = 32 prmDate.Direction = adParamInput prmDate.Value = dDate cmdDate.Parameters.Append prmDate
Microsoft Internet Information Services (IIS) is either not installed or is disabled. IIS is required by some SQL Server features. Without IIS, some SQL Server features will not be available for installation. To install all SQL Server features, install IIS from Add or Remove Programs in Control Panel or enable the IIS service through the Control Panel if it is already installed, and then run SQL Server Setup again. For a list of features that depend on IIS, see Features Supported by Editions of SQL Server in Books Online.
how do i get hold of Internet Information Services I installed it on vista premium.
I have a package which loads the fact data from Stage into Warehouse database. This packages normally handles early arriving facts. In that package I use lookup to check the dims which exists, and where they don't I populate the dimension and use the surrogate key to load the facts. This works fine.
I had a request to load 7 years worth of historical data. Instead of re-writing the package I took the package which handles early arriving facts and deleted the section which handles early arriving facts. I knew all the dimensions already exists and I don€™t want to hinder the performance when I load millions of rows. During testing I found something very interesting.
If you have configured error path in the lookup component and removed the error path later, the package will NOT fail (won't produce error) even if the lookup can't find matching values.
Correct Behaviour Example 1: [1] Stage fact table has 2 records, with product code 1 and 2. [2] Warehouse Product table has only product code 1. [3] Source - Lookup - Destination in the data flow task. Error port on lookup is not configured. [4] From source we read 2 records, and the package will fail at lookup as it can't find Product Code 2.
Correct Behaviour Example 2: [1] Stage fact table has 2 records, with product code 1 and 2. [2] Warehouse Product table has only product code 1. [3] Source - Lookup - Destination in the data flow task. Error port on lookup is configured to go to RowCount. [4] From source we read 2 records, and the package will run successfully. It will put one record into warehouse table and send the invalid record into RowCount.
Incorrect Behaviour Example 3: [1] Stage fact table has 2 records, with product code 1 and 2. [2] Warehouse Product table has only product code 1. [3] Source - Lookup - Destination in the data flow task. Delete the configured error port from lookup. [4] From source we read 2 records, and the package will run successfully. It will put one record into warehouse table and discard the other.
My understanding if the error port is NOT configured as shown in example 2, it should fail as shown in example 1.
Am I missing a point or is this suppose to be a correct behaviour or is it a bug?
I tried SQL mirroring in beta 1 , then it was gone, until SP1.
Now I can not setup mirror, it is fine if it is just hard to setup, but it seems it is full of bug! The mirroring has to be stable, since I am trying to mirror product db, what a diaster if something goes wrong.
I am trying two servers, both has 9.0.3042. First I tried to setup on my home machine, I VPN to my network, After I config security, I see two connection strings:
and it doesn't show that error anymore, I am not sure why the connection should be like the latter format, but in anyway, how come SMO can not make it right?
then I get another error, SQL server doesn't exist or can not access, I search on the Internet, it seems that error could mean anything, include that the mirror db is not in restore mode.
But I did set the mirror db in restore mode and both sql5 and sql8 are under same domain, pysically close.
I am trying here to get a situation going which includes both transactions and checkpoints to make sure that when something goes wrong I don't get a) data corruption (hence the transactions and b) I don't have to completely restart my 2hr run (hence the checkpoints). However I ran into something of which i cannot see whether it is intended behaviour or simply a bug.
Here's the deal: I have a SSIS-package in which I enable checkpoints (CheckpointUsage: IfExists and SaveCheckpoints: True). I have 2 Dataflows which follow eachother (the first dataflow prepares data for the second dataflow to edit). Because I want to make sure that my data is secure I put a separate transaction on both the dataflows.
And here my problem arises. If I run my package now and the second dataflow breaks then my checkpoint sends me back to the first dataflow and my initial insert is executed again, which isn't meant to happen (I enabled checkpoints to prevent rerunning items). Somehow my checkpoint does not register the fact that the first dataflow has already been executed and it will execute that one again upon rerun.
However: if I put a random task between the 2 transacted dataflows (for example an empty script-task) it will work as intended. Just as long as this inserted item doesnt have a transaction; because if it does then the problem comes back Now if I execute the package then my checkpoint shows that the first dataflow has already been executed and thus it will not execute this one again and it starts at the second dataflow upon re-execution.
I can work around it (with the empty script-task) but still I am wondering as to why this is happening. I am very interested to hear whether this is really a bug or if it is intended behaviour (and if it is then why is it intended?)
I have two input columns (both DT_I4) in a column collection to a Aggregator transform. Now I am doing a group by to one and Count to another column.
To my surprise the output's column datatype is changed for Count Transform (DT_UI8) and I have to put extra Data Conversion Transfrom to get my DT_I4 datatype back.
A new developer tried to import a data file using the ImportExport wizard. Unfortuantely, the file had several format errors and the process aborted after reading one bad line. (I imported it using a BIDS package with error handling. The file had 454 bad rows.)
Are there any options in the I/E Wizard to logskip errors but continue processing? After all, the I/E Wizard is designed for quick-and-dirty use and if it can't "handle" erroneous data "gracefully", it is not a very practical tool.
I am currently using the SSIS Logging feature in my SSIS package. Currently, I have defined a destination log file, and each time the package is executed the log file gets appended with that days log.
Im trying to figure out how best to keep the log file name static (it gets emailed out, and my email client looks for a particular log file name) yet include only todays log information and append the rest of the log information to a history log file or something like that.
Has anyone tried doing something similar, or have any ideas on how best this can be accomplished?
Good day all,I'm looking for suggestions on how to handle the calculating of scores for search results from data. Primarily if it would be best to calculating the score on the SQL server side or in the application's logic itself after the results have been retrieved? I already have an idea of the calculations I want to do which will be pretty simple, just a basic point system for containing all the queried terms and additional points for the number of times those words appear on the page. Feedback or links to articles on this would be appreciated. I'm leaning towards doing so on the SQL side myself but my SQL skills are not as polished as I would like for jumping into that, so examples could be good.
I am looking for a solution to allow users to generate data by selecting tables-->columns-->where clauses on the fly.
I am thinking to maintain relationships, joins, etc., in some configuration tables. Based on the fields selected by the user, I can get these conditions and generate a query, execute and export to excel. Any ideas what is the good way of storing relationships, etc. in configuration table?
Also suggest if there is any good excel add-in to do adhoc reporting. Point me if there is any other ways of doing.
If I have to do it from scratch, i probably use VB.NET.