Participants In 112 Service Code By Query

Sep 27, 2013

I am writing a query now where I only want to get participants in the 112 service code only but this query I have is giving me other service codes as well when I have it set to 112. How can I fix this just so i can get this 112 service code only.

declare @bgDte smalldatetime
declare @enDte smalldatetime
declare @rgn char(2)
set @bgDte = '2013-01-01'
set @enDte = '2013-04-30'
set @rgn='05'

[Code] .....

View 3 Replies


ADVERTISEMENT

T-SQL (SS2K8) :: Query Maximum Concurrent Connections (Participants)

Mar 4, 2015

I have a table called dbo.PhoneCalls with below columns

PhoneID |PhoneNumber| Callstarttime| CallEndtime|
1 |111-111-1111|2013-04-01 05:13:03.000|2013-04-01 05:13:03.000
1 |222-222-2222|2013-04-01 05:15:12.000|2013-04-01 05:16:52.000
2 |333-333-3333|2013-04-01 05:17:29.000|2013-04-01 05:24:08.000
2 |444-444-4444|2013-04-01 05:21:50.000|2013-04-01 05:22:31.000
2 |555-555-5555|2013-04-01 05:22:41.000|2013-04-01 05:23:11.000
2 |666-666-6666|2013-04-01 05:23:20.000|2013-04-01 05:23:46.000
..........

1. PhoneID is nothing but the participant in the call. PhoneID = 1 is twice from above. Which means 2 particpants (Same call )with 2 numbers with their callstarttime and callendtime. Similarly for PhoneID =2, there are 4 participants. And the list goes on for a day and then for a month.

2. For example a phone call P1 with 2 participants is going on for a particular day. We should not consider the same phone call having 2 participants involved. So that the concurrency would be 2. We have to ignore that here.

3. Only to be considered is other Phone calls for that day. Lets say P1 having call with 2 participants, P2 having some 4 participants which fall in the time period of P1. Then we should consider P1 and P2 the common period

4. In order to find number of concurrent calls happened for a day basing on callstarttime and callendtime. What would be the query?

5. Should consider the Timeperiod or the bucket with 1 hour as the period.

6. A Phone Call P1, Phone Call P2, should have matching (common) time ( keeping all the scenarios) is required for this query.

Result for Concurrent calls for a day should be like below. Should get all the concurrent connections happened for a particular day.

Date|TimePeriod/Bucket(hr part)|Concurrentconnections|
Jan-01-2015|01 to 02|3
Jan-01-2015|11 to 12|2
Jan-02-2015|04 to 05|5
Jan-02-2015|12 to 13|13
........

ii) So once the above is achieved.

Have to find the Maximum concurrent connections for day from the above.

For below Maximum Concurrent connections are '3'
Date|TimePeriod/Bucket(hr part)|Concurrentconnections|
Jan-01-2015|01 to 02|3
Jan-01-2015|11 to 12|2

Hence the Result for Maximum Concurrent Connections would be

Date|TimePeriod/Bucket(hr part)|MaxConcurrentconnections|
Jan-01-2015|01 to 02|3
Jan-02-2015|12 to 13|13
.............

View 3 Replies View Related

MS Reporting Service - Call Code

Mar 19, 2008

Hello,

I have a microsoft report that uses a dll to calculate a value. If I hard code the value, my report shows it. My method in the dll is connecting to a database in order to calculate a result. However, in order to connect to the database, I am using Microsoft.Practices.EnterpriseLibrary.

The error in my report is:
Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

I have added a reference in the report to the EnterpriseLibrary but this has not made a difference.

Many thanks!

View 1 Replies View Related

C++ Code Sample For Working With Inegration Service

Feb 23, 2007

Hi All,

Are there samples for working with Inegration Service ?

As I see in shipped samples are C# and VB only.

Particulary I need a C++ code for "Enumerating Available Packages Programmatically"



Thanks a lot.

Sergiy

View 3 Replies View Related

Error Code 3417. Cannot Start Sql Server Service

Mar 14, 2008

Hi Guys

I have my Sql server 2005 running perfectly (until yesterday) on vista. But today when I tried to connect to the server I get error 3417 meaning my master database needs rebuilt or repaired.

I tried all sort of techniques I found on internet like checking if my data files in data dir are not compressed and for the SQL Server Servies it logs on local account with interact with desktop checkbox checked. But no luck.

I tried to use setup.exe in my installer CD to rebuild master database but it seems the cmd doing nothing. To rebuild, I use the following command “start /wait setup.exe /qn INSTANCENAME=<instance> REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=<New SA Password>�. This cmd runs but due to some reason my master db is not being repaired. Ideally, I should see recent date change for this file.

Please advice how can I connect back to my server again making sure my databases are not lost.

View 3 Replies View Related

Could Not Setup Web Service Identity --&&> Error Code 80070003

Nov 14, 2006

Hello!
I´m trying to setup a Report Server on my SQL 2005 server. In Reporting Services Configuration Manager I get an error when i try to create the Web Sevice Identity

ReportServicesConfigUI.WMIProvider.WMIProviderException: An unknown error has occurred in the WMI Provider. Error Code 80070003
at ReportServicesConfigUI.WMIProvider.RSReportServerAdmin.SetWebServiceIdentity(String applicationPool)

The default website contains an office sharepoint 2007 beta solution if that could cause the error..

Would be real grateful for some hints...

Regards

Erik B

View 7 Replies View Related

Error Code 2259 Applying SQL2005 Service Pack

Jun 6, 2006

I have SQL 2005 Express installed. When I try to apply service pack 1 to this by going through the upgrade process, I get an error ' THe installer has encountered an unexpected error. The error code is 2259. Table(s) update failed'

Any ideas? Help!

Ranjit Charles

View 4 Replies View Related

Include Macro Code From Reporting Service When Exporting To Excel

Mar 19, 2008

To overcome the inability to manage the sheet tab names when exporting from Reporting Services to Excel, is there anyway to include a short macro with the exported Excel workbook to Auto_Run macro when the Excel file is opened to rename the tabs?

View 1 Replies View Related

Installation Problem: Unable To Start Service (3) - Error Code: 0x80070003

Sep 5, 2007

Hello,

I have Vista x64 and I had been fighting SQL Server for a few days and yesterday I decided for reinstallation. Unfortunately now I am not able to instal the server back!

Each time I got the following error (it refers to SQL Server service):




Code Snippet
<Func Name='LaunchFunction'>
Function=Do_sqlShutDownRANUInstance
<Func Name='GetCAContext'>
<EndFunc Name='GetCAContext' Return='T' GetLastError='203'>
Doing Action: Do_sqlShutDownRANUInstance
PerfTime Start: Do_sqlShutDownRANUInstance : Tue Sep 04 23:32:16 2007
<Func Name='Do_sqlShutDownRANUInstance'>
Service SQLEXPRESS with parameters '' is being started at Tue Sep 04 23:32:16 2007
Unable to start service (3)
Error Code: 0x80070003 (3)
Windows Error Text: System nie może odnaleźć określonej ścieżki.
Source File Name: sqlsetuplibservice.cpp
Compiler Timestamp: Wed Jun 14 16:29:04 2006
Function Name: sqls::Service::Start
Source Line Number: 316

---- Context -----------------------------------------------

Setting status of unmanaged components and removing unmanaged resources

Error Code: 3
MSI (s) (F4:E4) [23:32:24:490]: I/O on thread 3716 could not be cancelled. Error: 1168
MSI (s) (F4:E4) [23:32:24:493]: I/O on thread 788 could not be cancelled. Error: 1168
MSI (s) (F4:E4) [23:32:24:493]: I/O on thread 2948 could not be cancelled. Error: 1168
MSI (s) (F4:E4) [23:32:24:493]: I/O on thread 4392 could not be cancelled. Error: 1168
MSI (s) (F4:E4) [23:32:24:493]: I/O on thread 5048 could not be cancelled. Error: 1168
MSI (s) (F4:E4) [23:32:24:495]: I/O on thread 4464 could not be cancelled. Error: 1168
MSI (s) (F4:E4) [23:32:24:495]: I/O on thread 4992 could not be cancelled. Error: 1168
MSI (s) (F4:E4) [23:32:24:495]: I/O on thread 4768 could not be cancelled. Error: 1168
MSI (s) (F4:E4) [23:32:24:497]: I/O on thread 3004 could not be cancelled. Error: 1168
MSI (s) (F4!4C) [23:32:24:497]: Product: Microsoft SQL Server 2005 -- Error 29503. The SQL Server service failed to start. For more information, see the SQL Server Books Online topics, "How to: View SQL Server 2005 Setup Log Files" and "Starting SQL Server Manually."
The error is (3) System nie może odnaleźć określonej ścieżki.
.
Error 29503. The SQL Server service failed to start. For more information, see the SQL Server Books Online topics, "How to: View SQL Server 2005 Setup Log Files" and "Starting SQL Server Manually."
The error is (3) System nie może odnaleźć określonej ścieżki.
.
<Failure Type='Fatal' Error='3'>
<EndFunc Name='LaunchFunction' Return='3' GetLastError='203'>
MSI (s) (F4:80) [23:32:24:507]: User policy value 'DisableRollback' is 0
MSI (s) (F4:80) [23:32:24:507]: Machine policy value 'DisableRollback' is 0
Action ended 23:32:24: InstallFinalize. Return value 3.
MSI (s) (F4:80) [23:32:24:512]: Executing op: Header(Signature=1397708873,Version=400,Timestamp=925154312,LangId=1033,Platform=0,ScriptType=2,ScriptMajorVersion=21,ScriptMinorVersion=4,ScriptAttributes=1)
MSI (s) (F4:80) [23:32:24:512]: Executing op: DialogInfo(Type=0,Argument=1033)
MSI (s) (F4:80) [23:32:24:513]: Executing op: DialogInfo(Type=1,Argument=Microsoft SQL Server 2005)
MSI (s) (F4:80) [23:32:24:514]: Executing op: RollbackInfo(,RollbackAction=Rollback,RollbackDescription=Rolling back action:,RollbackTemplate=[1],CleanupAction=RollbackCleanup,CleanupDescription=Removing backup files,CleanupTemplate=File: [1])
MSI (s) (F4:80) [23:32:24:516]: Executing op: ActionStart(Name=Do_sqlShutDownRANUInstance.D20239D7_E87C_40C9_9837_E70B8D4882C2,Description=Running action to shutdown instance(Run As Normal User),)
MSI (s) (F4:80) [23:32:24:517]: Executing op: ProductInfo(ProductKey={C3F5DBA5-ABFC-443E-AA60-928223AADF53},ProductName=Microsoft SQL Server 2005,PackageName=sqlrun_sql.msi,Language=1033,Version=151129058,Assignment=1,ObsoleteArg=0,ProductIcon=ARPIcon.ico,PackageMediaPath=Setup,PackageCode={08AD0897-0300-4F7D-A3CC-A0CCEDD42E0D},,,InstanceType=1,LUASetting=0,RemoteURTInstalls=0,ProductDeploymentFlags=3)
MSI (s) (F4:80) [23:32:24:518]: Executing op: ActionStart(Name=ProcessComponents,Description=Updating component registration,)
MSI (s) (F4:80) [23:32:24:519]: Executing op: RegOpenKey(Root=-2147483646,Key=SOFTWAREMicrosoftWindowsCurrentVersionSharedDLLs,,BinaryType=0,)
MSI (s) (F4:80) [23:32:24:520]: Executing op: RegOpenKey(Root=-2147483646,Key=SOFTWAREMicrosoftWindowsCurrentVersionSharedDLLs,,BinaryType=0,)
MSI (s) (F4:80) [23:32:24:520]: Executing op: ComponentUnregister(ComponentId={68C6D258-77E0-11D5-8528-00C04F68155C},ProductKey={C3F5DBA5-ABFC-443E-AA60-928223AADF53},BinaryType=0,)
MSI (s) (F4:80) [23:32:24:520]: Executing op: ComponentUnregister(ComponentId={68C6D257-77E0-11D5-8528-00C04F68155C},ProductKey={C3F5DBA5-ABFC-443E-AA60-928223AADF53},BinaryType=0,)





What can I do solve the problem?

View 1 Replies View Related

Microsoft SQL Server 2005 Express Edition Service Pack 2 Error Code: 0x2B22

May 19, 2007

Hi i tried to install the Microsoft SQL Server 2005 Express Edition Service Pack 2 but was unable to do so. I got an error message saying: Error Code: 0x2B22



I went through what the message said, but i was unable to solve the problem. Below is the summary of the problem. Please help me solve it.



Time: 05/19/2007 12:32:24.781
KB Number: KB921896
Machine: DET-NB0631262
OS Version: Microsoft Windows XP Professional Service Pack 2 (Build 2600)
Package Language: 1033 (ENU)
Package Platform: x86
Package SP Level: 2
Package Version: 3042
Command-line parameters specified:
/quiet
/allinstances
Cluster Installation: No

**********************************************************************************
Prerequisites Check & Status
SQLSupport: Passed

**********************************************************************************
Products Detected Language Level Patch Level Platform Edition
Express Database Services (SQLEXPRESS) ENU RTM 2005.090.1399.00 x86 EXPRESS
Express Database Services (SQLExpress) ENU SP2 x86 EXPRESS

**********************************************************************************
Products Disqualified & Reason
Product Reason
Express Database Services (SQLEXPRESS) Unable to start service

**********************************************************************************
Processes Locking Files
Process Name Feature Type User Name PID

**********************************************************************************
Product Installation Status
Product : Express Database Services (SQLEXPRESS)
Product Version (Previous): 1399
Product Version (Final) :
Status : Not Applied
Log File :
SQL Express Features : SQL_Data_Files,SQL_Engine,SQL_Replication,SQL_SharedTools
Error Number : 11042
Error Description : Unable to start service
----------------------------------------------------------------------------------
Product : Express Database Services (SQLExpress)
Product Version (Previous):
Product Version (Final) :
Status : Not Applied
Log File :
SQL Express Features : Client_Components,Connectivity,SDK
Error Number : 0
Error Description :
----------------------------------------------------------------------------------

**********************************************************************************
Summary
Unable to start service
Exit Code Returned: 11042

View 3 Replies View Related

Why The Query Works In Query Analyser And Doesn't Work In Reporting Service ?

Apr 30, 2007



Hello everybody,



I'm developing a report using the following structure :



declare @sql as nvarchar(4000)

declare @where as nvarchar(2000)



set @sql = 'select ....'



If <conditional1>

begin

set @where = 'some where'

end



If <conditional2>

begin

set @where = 'some where'

end



set @sql = @sql + @where



exec(@sql)



I run it in query analyser and works fine, but when I try to run in Reporting Services, Visual studio stops responding and the cpu reaches 100 %.



I realize that when I cut off the if clauses, then it works at Reporting services.

Does anybody know what is happening?

Why the query works in query analyser and doesn't work in Reporting Service ?



Thanks,



Maurício

View 2 Replies View Related

Getting Sql Query In C# Code

Nov 19, 2007

Dear All

I am a beginner and looking for some help. I have a database with just one column (some names). That is the primary key aswell. Because I want the names to be unique.I used a grid view control to display the data and included the insert functionality in the grid view by using some code and the part of the code that does the insert is  1 public static void Insert(Categories category)
2 {
3 string connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
4 using (IDbConnection cn = new SqlConnection(connectionString))
5 {
6 cn.Open();
7
8 IDbCommand cmd = new SqlCommand();
9
10 cmd.CommandText = "INSERT INTO Categories (CategoryName) VALUES " +
11 "('" + category.CategoryName + "')";
12
13 cmd.Connection = cn;
14 cmd.ExecuteNonQuery();
15 }
16 }
 Question: when someone tried to enter a new name which already exists in the database it throws an error page which is what I want but is there a way to be able to display the user a message sayin g that he/she has entered a name that already exists and hence they need to try a different name? instead of the ugly error page? Thank you in advance,Prasad.   

View 7 Replies View Related

Help In Query Or Code

Nov 17, 2003

Hi,
I need to bind to dropdown list, the conference names from the last one to the first one.
I'm using following query, the problem is it returns the conference names the number of dates created, since it's one table with all data I can't change it now.
Is there a way to get the names one time for each name without repeating?

string Sql = "SELECT DISTINCT conference_name,creation_date FROM Conference ORDER BY creation_date DESC";
SqlDataAdapter da = new SqlDataAdapter(Sql, myConn);
dataSet = new DataSet();
da.Fill(dataSet);
ddlConfName.DataTextField = "conference_name";
ddlConfName.DataSource = dataSet.Tables[0];
ddlConfName.DataBind();

View 2 Replies View Related

Sql Code Query

Nov 16, 2006

Forgive me if i'm being really stupid but... we have an accounts package (Exchequer) using sql. I would like to use the tables in sql to interrogate the db further. However my numeric fields e.g. Credit Limit are split into 2 fields. One is a smallint type and one is an integer. How do I combine these fields to get an accurate value?
Thanks

View 4 Replies View Related

The SQL Server Service Broker For The Current Database Is Not Enabled, And As A Result Query Notifications Are Not Supported. Please Enable The Service Broker For This Database If You Wish To Use Notifications.

Feb 16, 2008

Hello,          I receive this error  "The SQL Server Service Broker for the current database is not enabled, and as a result query notifications are not supported.  Please enable the Service Broker for this database if you wish to use notifications." I attach the database in Management Studio to query and enable the broker using the scrip below but to no avail. ALTER DATABASE DataName SET ENABLE_BROKER ‘''<<------successfulandSELECT is_broker_enabled FROM sys.databases WHERE name = 'Database name' ‘'''<<-------value is 1 Global.asax ...    Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)        System.Data.SqlClient.SqlDependency.Start(ConfigurationManager.ConnectionStrings("dataConnectionString1").ConnectionString)    End Sub...Web.config ...    <connectionStrings>        <add name="dataConnectionString1" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|jbp_data.mdf;Integrated Security=True;User Instance=True"         providerName="System.Data.SqlClient" />        <add name="ASPNETDBConnectionString" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|ASPNETDB.MDF;Integrated Security=True;User Instance=True"         providerName="System.Data.SqlClient" />    </connectionStrings>... Hope you could help.  cheers,imperialx 

View 1 Replies View Related

What's Wrong With This SQL Query/code?

Sep 12, 2007

 I keep getting the error "Invalid attempt to read when no data is present" when trying to query a table in my SQL DB.  I have checked and rechecked and the table name and column names within it are spelled correctly.  There are only three records in the database, they all have data in them, and the code in Country.Text precisely matches the data in the Country field in one of the records.
 
 It's worth mentioning that when I use Visual Studio 2005's little direct SQL query tool to build and run the following SQL statement that it works properly:
 
SELECT        Country, WordForStateFROM            data_CountriesWHERE        (Country = N'Jordan')
 
I am perplexed.  Any ideas anybody...here is the code...?
 
Dim SelectSQL_Countries As String
SelectSQL_Countries = "SELECT * FROM data_Countries "
SelectSQL_Countries &= "WHERE Country='" & Country.Text & "'"Dim con_Countries As New SqlConnection(ConfigurationManager.ConnectionStrings("MySiteMainDB").ConnectionString)
Dim cmd_Countries As New SqlCommand(SelectSQL_Countries, con_Countries)Dim reader_Countries As SqlDataReader
Try
con_Countries.Open()
reader_Countries = cmd_Countries.ExecuteReader()StateID.Text = reader_Countries("WordForState")
reader_Countries.Close()Catch err As Exception
lblResults.Text = err.Message
Finally
con_Countries.Close()
End Try

View 3 Replies View Related

Query By Database Or Code

Nov 8, 2007

I have a database and would like to retrieve specific data via queries. This database is also connected to an ASP .Net 2.0 application to be the front end. Ive created the query in the database. Would you recommend i use parameter names to retrieve the data via code or should i have the query within my code to retrieve the data?
Thanks

View 6 Replies View Related

Can This Sub Query Code Can Be Done In Grouping

Feb 26, 2008

HI all, I got a tsql that needs to be simplified.
 Select * from Table1 where condition1 and id not in
    ( Select id from table1 where condition2 and id in
             ( Select id from Table1 where condition1 )
    )
basicly all records thats in condition1 but that doesnt have condition2 but limited to condition1. I'm probably maken this to complicated. but im tired and im losing time just on one stupid query. Thanks for the help.

View 9 Replies View Related

Query Code (newbie)

Nov 27, 2005

Hey everyone,

I know this is a very simple problem however I've literally just begun learning about SQL and this is the first ever code i've created using the language.

The error is:

Msg 102, Level 15, State 1, Line 30
Incorrect syntax near ')'. Located on line containing "create table Trailer_Type"

create table Tralier
(load_types varchar(20),
Serial_no varchar(5),
constraint trailerkey primary key(Serial_no));

create table Tractor
(Reg_no varchar(8),
Descript varchar(20),
constraint tractorkey primary key(Reg_no));

create table Unit
(Unit_no varchar(4),
Total_length int(3),
Max_load int(2),
constraint unitkey primary key(Unit_no));

create table Maintenance
(Reg_no varchar(8),
Date_in date(8),
Date_out date(8),
Descript varchar(20),
Job_no varchar(6),
Mech_name varchar(20),
constraint maintenancekey primary key(Job_no));

create table Load_type
(load_type varchar(20),
constraint typekey primary key(load_type));

create table Trailer_Type
(constraint holds foreign key (serial_number) references
Trailer(serial_no),
Constraint holds foreign key (load_type)
references Load_type(load_type));

I'd be very greatful if someone could help me.

Thanks

David

View 6 Replies View Related

How Do I Edit A Query Through Code?

May 15, 2007

Hi!



Can someone tell me how or where I can find information on editind an SQL query through code?



I want to be able to run a user-defined lookup, where the user can choose what the query will look for.



Thanks in advance.



Guy

View 5 Replies View Related

Query A Table For A Value In The Code File.

Feb 7, 2008

Ok, so im pretty much finished writing my forum web page.  However to display things like how many replies each thread has and who replied last, i need to perform a query in the code file.  Im guessing its simple enough but i cant get the syntax for actually performing any query.  I already know the sql syntax like select * from all that stuff but how do i get do something like:
Dim x as integer = sqlQuery("Select count(*) FROM ...")
 Currently i have it all working by creating a table and making it invisible and just pulling data from the table but thats sloppy and pretty ineffecient if i databind a table for every single topic name.

View 9 Replies View Related

Variables In Query, Error In My Code ?

Oct 10, 2006

When I want to user variable in the name of the database, I have an error. What's wrong with my code ?

DECLARE @BASE_SOURCE varchar (30),@BASE_DESTI varchar(30),@TEST varchar(30)
set @BASE_SOURCE='BASE1'
set @BASE_DESTI='BASE2'


select * from @BASE_SOURCE.dbo.FOURNISS

Msg*170, Niveau*15, État*1, Ligne*4
Ligne 4 : syntaxe incorrecte vers '.'.

View 2 Replies View Related

Execute Query Within Custom Code

Apr 2, 2008

Hi,
Is it possible to connect to a database and fetch data from it from within custom code inside a report?
Appreciate any help.

Regards,
Asim.

View 4 Replies View Related

Return Code RC In Query Analyzer

Feb 26, 2007



Hi,

I've created a stored procedure which inserts values into a table and upon successful execution the RC column gets returned along with the Identity value (I'm using SELECT SCOPE_IDENTITY()), but I don't want to RC column, I only want to get the Id number of the current row. I'm doing this using the Query Analyzer.

Is there a way to suppress the RC column? I have run the same query on different servers and the RC col doesn't show up. I only want the ID value to put into an ASP.NET page.

While testing different query methods from ASP.NET (Output parameter, Return_Value, etc) did I set a flag within SQL Server?

Sincerely,

Fred

View 1 Replies View Related

How Would You Design This Query Better ( Does Not Contain Lots Of Code)

Apr 18, 2006

i have a number of business programs. Each program is started anew at the beginning of each fiscal year. each program has a number of goals and customers subscribe to the goals.

i have to pull all this info out of the database.

i have a cursor that gets the first program, inside this program i have a cursor that gets the first period, and inside that i have a cursor that gets the info on each goal.

program cursor

{

period cursor

{

goal cursor

}

}

}

}

this takes ages ( hours and hours ) to run. is there any way i could have designed this using joins and simple selects to make it more efficient??

View 4 Replies View Related

Query Database From Custom Code

Dec 17, 2007

Hi experts,

I have a custom code that successfully query my database in SSRS 2005 report.
However, I am hard coding its connection string (in the custom code) and I want it to be able to use the same connection string as the ones that the report use. This information is available in my registry setting, but if it is possible, I want to avoid that, since I aim for a quite simple solution. If I am able to get the connection string details at the report level or from within the custom code, it would be great.

Anybody have a suggestion? Anything would be really appreciated.

Thanks

View 1 Replies View Related

SQL Query Code Correction Require Urgently

May 25, 2008

Hi All,First of all its very very urgent. Secondly I am not an expert. Now here is my problem.I want to loop through my html files and want to save the data in my table column. here is the Code which need correction.CODE:USE [AdventureWorks]DECLARE @cmd varchar(1000);DECLARE @FileName varchar(100);DECLARE @FilePath varchar(100);SET @FileName = 'C: est'+@FilePath+'html';SET @cmd = 'INSERT INTO myTable(FileName, FileType, Document)' +     'SELECT ' +  @FilePath + ', FileType,     * FROM OPENROWSET(BULK @FileName, SINGLE_CLOB) AS Document'EXEC (@cmd);Select * from myTableJust for practice I am using Adventureworks db. I am using SQL Express 2005.My html files are named something like this:AC0234.htmlDB9803.htmlCG4571.htmlI cannot change my file names.Thanks in advance.Regards; 

View 1 Replies View Related

Unique Zip Code With The Category Having The Maximum Value (was Sql Query Help)

Nov 30, 2005

Hello,

I'm trying to select the maximim value for certain zip codes, for example my table looks like this:

ZIP Category Value
90210 S1 5
90210 S2 10
90210 S3 2
90210 S4 3
10221 S1 24
10221 S2 3

And I want the end result to be each unique zip code with the category having the maximum value, for example 90210 S2, 10221 S1, etc

View 4 Replies View Related

Constrain Result Set By Unique Code In Query

Jul 8, 2013

If I have a simple query like:

select * from bigtable
where product_code in ('abc','def','hij','klm')

I know that each of those product_codes will return a large data set. What I'd like to do is to run the same query but constrain the result set to a max rownum of 200.

Is this possible?

View 1 Replies View Related

Custom Code Database Query And Connectionstring

Jun 1, 2007

I have some custom code in my report <Code> element that I use to query a database. I have hardcoded the connectionstring in this code but I would like to use the same datasource that the report uses. Is there some report property that allows me to access this datasource?

View 11 Replies View Related

How To Check If A Table Is Empty Using Query Code

Aug 9, 2013

I want to check if a table is empty using query code?

How to do this?

View 4 Replies View Related

Llimit On Lines Of Code In Query Builder

May 22, 2007

Does anyone know if there is a limit on characters or lines of code that can be used to create your dataset?



I cut and pasted some sql code of a report in there and it's cutting off the last 100 lines or so.

View 1 Replies View Related

No Response To Code And Query Analyser Cannot Read Statement

Feb 20, 2004

hi

have a problem ...
I tried to test my statement in QA as it returns no dataset ,it gives me empty columns in return,I though it will return all the columns and some records of (lmeyer) as the current user ,who logged in on windows auth,but it return only the columns,is that means my query analyser cannot read the login1 ,column which has the username as (lmeyer)

select * from tstudents where (login1='@param1')

if not what could me wrong in my code ,because I get no response to the sql server




Public Function login(ByVal login1 as string) as dataset

Dim myconnection as new sqlconnection("server=G103-TT03;database=CampusLANDB;Trusted_Connection=yes")
dim mycommand as new sqlcommand ("Select * from tStudents Where login1 = @param1",myconnection)
mycommand.parameters.add(new SQLClient.SqlParameter("@param1",login1))

dim DS as new dataset()


try
myconnection.open

dim adpt as new sqldataadapter
adpt.selectcommand = mycommand
adpt.fill(DS,"tStudents")


catch ex as exception
throw new exception(ex.message)
return nothing
finally
myconnection.close
end try

try
mydatagrid.datasource=DS.Tables("tStudents")
mydatagrid.databind()
catch ex as exception
errorlabel.text=ex.message
end try

return DS

End Function





thankx in advance
pamela mkosana

View 12 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved