I am trying to rewrite a stored procedure that right now works by string concatination.
I would like to mimic that in sql, and have therefore made something that looks like this:
Code Block
declare @guard varchar(20)
set @guard = ''
select *
from Table1
where @guard = '' or
pk in (select pk from Table2)
What I really would have liked was that the guard worked, and Table2 therefore never was searched (because of left to right evaluation), but when I look in the execution plan then I can see that Table2 is getting it's clustered index scan every time.
Does anyone have a good explanation for this, and mabye a good idea on how I can achive what I want?
I can't deploy reports on Visual Studio2005 anymore. I say "anymore", because a few months ago, this went well. After building correctly, VS Studio asks for a Login for Reporting Services via a popup window. I don't know what to enter... In IIS ( version 5.1) , I configured Reports and ReportServer for integrated Windows Authentication. In Reporting Services Configuration, I have the Windows Security set on Windows Account, with a username and password that I also use (withoud success) to deploy the reports from Visual Studio. Since the user is a domain user, I tried as login also the complete domain name : domainusername. Nothing helps, the popup "Login for Reporting Servies" appears again and again. If I change the settings in IIS to allow for anonymous access ( machinenameIUSR_machinename), I get the error message that the permissions granted to that user are insufficient. I also changed the Windows Service Identity into "Local System" and "Local Service"; with the same result. In the Log file of Reporting Services, I also find following phrase : "ReportingServicesService!resourceutilities...INFO: Evaluation copy:0 days left" I don't know of there is a link between this and my problems Can anyone help me in this ?
I need to left pad the column with 0 if it is less than 4 characters long and extract the first 2 characters on the left into a new column COUNTY_CODE.
How can I do that in transact SQL?
I tried:
SELECT RIGHT(RTRIM('0000'+ISNULL([Code],'')),4) FROM [Place] WHERE [Place Code]='B' and [Code]='627'
And I got 0627. And how do I extract the first 2 characters?
How to remove space left to right and right to left
If I give limit >60 for first 60 character; limit 60< second 60 character
Result would be check if space at 60 character if yes remove and go the 59 character check then space remove and 58 character check if there is charater then display
As well as after 60 character to till 120 for right space
SELECT * FROM a LEFT OUTER JOIN b ON a.id = b.id instead of
SELECT * FROM a LEFT JOIN b ON a.id = b.id
generates a different execution plan?
My query is more complex, but when I change "LEFT OUTER JOIN" to "LEFT JOIN" I get a different execution plan, which is absolutely baffling me! Especially considering everything I know and was able to research essentially said the "OUTER" is implied in "LEFT JOIN".
i am having names like AB_12 I want to get all rows with left part similar , AB im that case
SELECT id, name FROM Users WHERE LEFT(name, CHARINDEX('_', name) - 1) AS name IN ( SELECT LEFT(name, CHARINDEX('_', name) - 1) AS ns FROM Users GROUP BY LEFT(name, CHARINDEX('_', name) - 1) HAVING (COUNT(*) > 1) )
does not work
is there any way to use a variable ?
declare @nm nvarchar set @nm = SELECT LEFT(name, CHARINDEX('_', name) - 1) AS ns FROM Users
Im having a problem with a statement i cannot seem to get 2 left joins working at the same time 1 works fine but when i try the second join i get this error:-
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'children_tutorial.school_id=schools.idx LEFT JOIN regions ON children_tutorial.region_id=region.idx'.
My SQL statment is as follows :- SELECT children_tutorial.*,schools.schoolname,regions.rname FROM children_tutorial LEFT JOIN schools ON children_tutorial.school_id=schools.idx LEFT JOIN regions ON children_tutorial.region_id=region.idx
I am using an Access database i have tried all sorts to get it working and its driving me mad!! any help would be really appreciated.
We're going to set up a demo of an Analysis and Reporting server. Does the Evaluation Edition of 2005 come with things like the BI studio, Management Studio and other client-side tools?
Also, does anyone know if the Eval Analysis Services is the full product (e.g. semi-additive measures, ...?)
Is there a way to find out many days you have left on the trial period or is there a way to find out when it was created. I get the feeling it will just not work one of these days and I'll have to figure out something on the fly.
I am running the SQL server 2000 evaluation edition... and enterprise manager..does anyone know if this really expires....or can I keep playing around with it forever???same for enterprise manager...
Does the evaluation download of SQL Server 2005 come with Enterprise Manager, it just doesn't seem to be installing it? I was wondering if anyone else had download it and had a look and had hit the same problem?
I guess this is likely a stupid question, but I have no time for pride riht now...
I installed the evaluation version of SQL Server 7.0 and then installed the full version over top of the evaluation version once I received it.
My problem is that now SQL Server is telling me that the evaluation period has expired! How do I get around this? I assumed that installing a full purchased version would "convert" my installation of the evaluation version to a full version, but it hasn't. Please email with any information as I am trying to track this problem down and may not have time to check back here!
is there any kind of problem if i continue to use "sql server 2000 enterprise evaluation edition"..the evaluation period is for 120 days and my project will complete by that period..shall i continue using that or there are any problems....
Hi,I seemed to me IsNull Evaluation within EXEC fails. Here's some moredetail of the problem.-- goal: provide one parameter (of various value) to generate a-- reportdeclare @col4 varchar(30)select @col4 = null-- pls note, the @col4 var is default to null but may likely-- have a valueexec ('select col1, col2, col3, -- next dynamic col' + @col4 + ',col5, col6count(*) as totalfrom FACT_TBLwhere 1=1-- THE FOLLOWING CONDITION EVALUATION FAILED-- in the sense that if the parameter is not called query does-- not return any result set, which is wrongand COL4 = IsNull('''+@COL4+''',COL4)group by '+@COL4+', col5')
We've been running report server 2005 for several years in development and production. I tried to move the database the other day and everything went fine, aside from creating the scheduled reports/sql jobs. Took a look at the log and it said that report server was in evaluation mode. How can I verify this information?
The version number under /ReportServer is 9.00.2047.00
But that is the same number as my development RS, which did a DB migration just fine.
It is also strange that it has continued to function for so long - if it is in fact an eval version.
Here is the log where things began to go wrong.
Code Block
ReportingServicesService!resourceutilities!9!12/27/2007-19:51:51:: i INFO: Reporting Services starting SKU: Enterprise ReportingServicesService!resourceutilities!9!12/27/2007-19:51:51:: i INFO: Evaluation copy: 0 days left ReportingServicesService!runningjobs!9!12/27/2007-19:51:51:: i INFO: Database Cleanup (NT Service) timer enabled: Next Event: 600 seconds. Cycle: 600 seconds ReportingServicesService!runningjobs!9!12/27/2007-19:51:51:: i INFO: Running Requests Scavenger timer enabled: Next Event: 60 seconds. Cycle: 60 seconds ReportingServicesService!runningjobs!9!12/27/2007-19:51:51:: i INFO: Running Requests DB timer enabled: Next Event: 60 seconds. Cycle: 60 seconds ReportingServicesService!runningjobs!9!12/27/2007-19:51:51:: i INFO: Execution Log Entry Expiration timer enabled: Next Event: 22088 seconds. Cycle: 86400 seconds ReportingServicesService!runningjobs!9!12/27/2007-19:51:51:: i INFO: Memory stats update timer enabled: Next Event: 60 seconds. Cycle: 60 seconds ReportingServicesService!runningjobs!9!12/27/2007-19:51:51:: i INFO: SQM timer timer enabled: Next Event: 25688 seconds. Cycle: 86400 seconds ReportingServicesService!library!11!12/27/2007-19:51:51:: i INFO: Catalog SQL Server Edition = Enterprise ReportingServicesService!crypto!11!12/27/2007-19:51:52:: i INFO: Initializing crypto as user: NT AUTHORITYNETWORK SERVICE ReportingServicesService!crypto!11!12/27/2007-19:51:52:: i INFO: Exporting public key ReportingServicesService!crypto!11!12/27/2007-19:51:52:: i INFO: Performing sku validation ReportingServicesService!crypto!11!12/27/2007-19:51:52:: i INFO: Importing existing encryption key ReportingServicesService!dbpolling!11!12/27/2007-19:51:52:: EventPolling polling service started ReportingServicesService!dbpolling!11!12/27/2007-19:51:52:: NotificationPolling polling service started ReportingServicesService!dbpolling!11!12/27/2007-19:51:52:: SchedulePolling polling service started ReportingServicesService!dbpolling!11!12/27/2007-19:51:52:: UpgradePolling polling service started ReportingServicesService!dbpolling!e!12/27/2007-19:51:52:: EventPolling heartbeat thread started. ReportingServicesService!dbpolling!d!12/27/2007-19:51:52:: NotificationPolling heartbeat thread started. ReportingServicesService!dbpolling!c!12/27/2007-19:51:52:: Polling started ReportingServicesService!schedule!f!12/27/2007-19:51:52:: Unhandled exception caught in Scheduling maintenance thread: System.Data.SqlClient.SqlException: The EXECUTE permission was denied on the object 'sp_help_jobschedule', database 'msdb', schema 'dbo'. at Microsoft.ReportingServices.Library.SchedulePollWorker.CheckScheduleConsistancy(Object state) ReportingServicesService!library!f!12/27/2007-20:01:51:: i INFO: Cleaned 0 batch records, 0 policies, 1 sessions, 0 cache entries, 0 snapshots, 0 chunks, 0 running jobs, 0 persisted streams ReportingServicesService!dbpolling!10!12/27/2007-20:02:48:: EventPolling polling service stopped ReportingServicesService!dbpolling!e!12/27/2007-20:02:48:: EventPolling heartbeat thread exiting for stop. ReportingServicesService!dbpolling!10!12/27/2007-20:02:48:: NotificationPolling polling service stopped ReportingServicesService!dbpolling!d!12/27/2007-20:02:48:: NotificationPolling heartbeat thread exiting for stop. ReportingServicesService!dbpolling!10!12/27/2007-20:02:48:: SchedulePolling polling service stopped ReportingServicesService!dbpolling!10!12/27/2007-20:02:48:: UpgradePolling polling service stopped ReportingServicesService!servicecontroller!10!12/27/2007-20:02:48:: Service controller exiting.
I didn't notice this line in the log until now: ReportingServicesService!schedule!f!12/27/2007-19:51:52:: Unhandled exception caught in Scheduling maintenance thread: System.Data.SqlClient.SqlException: The EXECUTE permission was denied on the object 'sp_help_jobschedule', database 'msdb', schema 'dbo'. at Microsoft.ReportingServices.Library.SchedulePollWorker.CheckScheduleConsistancy(Object state)
Looks like that is the reason for the failed schedule recreation.
I need to save the work I did during my SL Server 2005 Express evaluation which has now expired. I am afraid, very afraid of losing the databases if I uninstall the eval version and upgrade to the newest Express version. Am I ok, or am i toast ? lease clue me in- thanks!
I found it annoying that I have not being able to put more than one conditions in the Evaluation Expression within the For Loop Containter? e.g. iCounter<N , also I want to put another condition there like IsHoliday=1. How can I achieve that?
I have tried to used the LOGICAL AND operator && to combine more than one condition, but it did not work.
Please shed me some light on that.
Thank you very much and I am looking forward to hearing from you shortly.
...(and several permutations of strings I found via search) but get "invalid object name ce35_tbl". Am I doing something wrong here or is this not supported? Is there a way to accomplish this via t-sql on server2005?
This will become a recommendation for my customer; we are struggling with performance on this new install which is temporarily done with the Evaluation version and I see a Service Pack has been published. Please advise?
I'm trying to create a database for an organization for managing contact lists, and mettings with access 2007.
I've 4 tables, organization, person, meeting, participant (contains fields of person and meeting).
the PK for person is, "Fname" and "Lname", and the PK for meeting is "name of meeting" and "date of meeting". How should I link these two tables with "participant" which has no PK, in order to avoid people to insert fields for partcipand before filling out data tables of person and meeting.
For testing purposes only, I'd like to install SQL Server 2000 Evaluation Edition on a server. From what I've read, this edition is a full Enterprise Edition, but it will expire after 160 days. But is it a full edition in the sense that users can connect to it when it's installed on a server, like if it was the Enterprise Edition? So far, I've only had it installed at local computers outside any network.
Hi- I let my sql server evaluation expire and I have no access to the database now. Is there anyway I can create a new server on my old sql server 7 software and import the data? I have stored procedures that I really need to access. I see where the data files are but is there a way to get them opened by SQL Server 7 when I created it all in the latest version? Thanks Nicki
Hi everyone I've just installed the microsoft's evaluation version of sql 2005 at my home computer. Now i'm trying to connect ("sql sever management studio") but i dont know the server's name nor user name. I dont rememeber ever asked to produce any during the installation. Bottom line- the evaluation version of sql server 2005 is installed but i cannot log in. How do i get to know my user name ? server name ? What ever i try i'm announced that the present version is not working for remote connections. I try to connect from the same very machine of the sql server. What is wrong ? Thanks
I have inherited a nice problem when starting a new role.
My SQL server has stopped and i get the 17051 error when i try to start the services, It is the evaluation copy. I do have a registered full copy on another box.
I really want to keep some of the databases i have been using in the test environment. They have not been backing up as the msdb DB became corrupt some time ago.
Is there any way i can get them moved to my other box.
CAn i reinstall SQL server (another eval copy) onto the duff box (keeping the db's) back them up and then move them
Today my SQL Server Express suddenly stopped working. After a few hours troubleshooting I finaly found something in the Event Viewer/Application Errors: SQL Server evaluation period has expired...Isn�t the express edition supposed to be free?.
By the way: Windows did 27 automatic updates just before this happened. Might have something to do with it.
Is there a easy way to deal with this or do I have to reinstall and just hoping that I can restore my database?
hey everbody, i'm absolutely new to any sort of data management here it goes: suppose we store 100 .txt or .doc files in sql server and we want that none of the files data should match more than 60%: the question which arises are
1. how do we store files in ms-sql (binary format or normal text)? 2. how do we match the files? 3. what code we write in c# for this purpose? 4. has this nething to do with pattern recognition?
My request to all new n active experienced user's to participate because Plzzzzz help me?
I have the following query in a user-defined function. It accepts a single string parameter, but for the sake of simplicity, I have substituted actual strings in the query. It basically checks the passed string. If it ends with "Id", it strips off the "Id" and returns the resulting string. If it ends with "Id" followed by a digit, it strips that off and returns the string.
SELECT CASE WHEN LEN('IncidentViolationId') > 2 AND RIGHT('IncidentViolationId', 2) = 'Id' THEN LEFT('IncidentViolationId', LEN('IncidentViolationId') - 2) WHEN PATINDEX('%Id[0-9]', 'IncidentViolationId') > 1 THEN LEFT('IncidentViolationId', PATINDEX('%Id[0-9]', 'IncidentViolationId') - 1) ELSE 'IncidentViolationId' END
This code has worked flawlessly for quite some time and all of a sudden I get "Invalid length parameter passed to left function". I understand why LEFT() would normally fail if I passed it a -1 for the second parameter, but in this scenario, asI understand it, it never should have reached the second WHEN condition since the first one evaluates to true. Why and why all of a sudden?