SQL Query Check And Validate (Urgent)

Jan 9, 2007

Hello All,

It seems the following queries are causing my DB connections to time out, but I cant seem to figure out why.

These queries reside within my xml.config file.

The connection to the DB is fine and live. I get timeout errors every few hours or so.

Can anyone take a look at the queries which I pasted below and tell me why I keep getting timeout errors? PLEASE, I need all the help I can get.

<query name="Products" rowElementName="Product">
<sql>
<![CDATA[
SELECT p.*,
pv.VariantID, pv.name VariantName, pv.Price, pv.Description VariantDescription, isnull(pv.SalePrice, 0) SalePrice, isnull(SkuSuffix, '') SkuSuffix, pv.Dimensions, pv.Weight, isnull(pv.Points, 0) Points,
sp.name SalesPromptName,
isnull(e.Price, 0) ExtendedPrice
FROM Product p
join productvariant pv on p.ProductID = pv.ProductID
join SalesPrompt sp on p.SalesPromptID = sp.SalesPromptID
left join ExtendedPrice e on pv.VariantID=e.VariantID and e.CustomerLevelID=@CustomerLevelID
WHERE p.ProductID = @ProductID
and p.Deleted = 0
and pv.Deleted = 0
and p.Published = 1
and pv.Published = 1
ORDER BY p.ProductID, pv.DisplayOrder, pv.Name
]]>
</sql>
<queryparam paramname="@CustomerLevelID" paramtype="runtime" requestparamname="CustomerLevelID" sqlDataType="int" defvalue="0" validationpattern="" />
<queryparam paramname="@ProductID" paramtype="request" requestparamname="ProductID" sqlDataType="int" defvalue="0" validationpattern="^d{1,10}$" />
</query>

<query name="Ratings" rowElementName="Rating">
<sql>
<![CDATA[
SELECT ProductID, CAST ( AVG(CAST(Rating AS decimal)) as decimal (10,2)) as Rating
FROM Rating
WHERE ProductID = @ProductID
Group By ProductID
ORDER BY ProductID
]]>
</sql>
<queryparam paramname="@ProductID" paramtype="request" requestparamname="ProductID" sqlDataType="int" defvalue="0" validationpattern="^d{1,10}$" />
</query>

<query name="TotalRatings" rowElementName="TotalRating">
<sql>
<![CDATA[
SELECT ProductID, Count(Rating) as TotalRating
FROM Rating
WHERE ProductID = @ProductID
Group By ProductID
ORDER BY ProductID
]]>
</sql>
<queryparam paramname="@ProductID" paramtype="request" requestparamname="ProductID" sqlDataType="int" defvalue="0" validationpattern="^d{1,10}$" />
</query>

<query name="popup" rowElementName="popit">
<sql>
<![CDATA[
SELECT ProductID as rateID
FROM Product
WHERE ProductID = @ProductID
Group By ProductID
]]>
</sql>
<queryparam paramname="@ProductID" paramtype="request" requestparamname="ProductID" sqlDataType="int" defvalue="0" validationpattern="^d{1,10}$" />
</query>

View 9 Replies


ADVERTISEMENT

Write A Query To Validate Data

Sep 10, 2014

I'm trying to write a query to validate the data.

Here is the scenario:
1. The table has Three columns 1.ID, 2.Sqno, 3. Adj
2. The values for adj are (0,1,2)

Case1: The Sqno should start at '001000' for adj in (0,2) and increment by 2, i.e the next sqno would be '001002' and '001004' so on.
Case2: The sqno should start at '001001' for adj in (1) and increment by 2 i.e the next sqno would be '001003' and '001005' so on.

Finally when you do order by sqno and group by ID it will be a running sqno.

ID Sqno Adj
123A 001000 0
123A 001001 1
123A 001002 2
123A 001003 1
123A 001004 2
123A 001005 1
123A 001006 0
123A 001007 1
123A 001008 2
123A 001009 1

write a query that can validate this scenario.

View 2 Replies View Related

Urgent Multiple-step OLE DB Operation Generated Errors. Check Each OLE DB Status Value

Nov 30, 2007

I am using execute sql task and my sql statement contains

EXEC test ?

procedure test has 2 parameters. I added parameters using parametermapping tab. When I run i get an error message


Multiple-step OLE DB operation generated errors. Check each OLE DB status value

View 1 Replies View Related

Urgent : DB-Library Error 10007: General SQL Server Error: Check Messages From The SQL

Jul 20, 2005

DB-Library Error 10007: General SQL Server error: Check messages fromthe SQLServer.CREATE PROCEDURE [dbo].[spu_Import_Export_Image](@srvr varchar(50),@db varchar(50),@usr varchar(15),@pwd varchar(50),@tbl varchar(50),@col varchar(50),@mod varchar(1),@imgpath1 varchar(1000),@pk varchar(50))ASBEGINdeclare @path varchar(50)declare @whr varchar(200)declare @fil varchar(100)declare @cmd varchar(1000)declare @imgpath varchar(800)declare @ext varchar(5)--declare @pk varchar(50)declare @KeyValue varchar(8000)declare @image varchar(50)--declare @imgpath1 varchar(1000)declare @imgpath2 varchar(1000)declare @sellist varchar(2000)set @path = 'c: extCopy.exe'select @sellist = 'DECLARE curKey CURSOR FOR SELECT ' + @pk +' FROM '+ @tbl + ' ORDER BY ' + @pkexec (@sellist)OPEN curKeyFETCH NEXT FROM curKey INTO @KeyValueWHILE (@@fetch_status = 0)BEGINset @whr = '"where '+ @pk +' = "' + @KeyValueset @fil = @imgpath1 + '' + @KeyValue --+ @extset @cmd = @path + ' /S ' + @srvr + ' /D ' + @db + ' /U ' + @usr+ ' /P ' + @pwd+ ' /T ' + @tbl + ' /C ' + @col + ' /W ' + @whr + '/F ' + @fil+ ' /' + @modexec Master..xp_cmdShell @cmdFETCH NEXT FROM curKey INTO @KeyValueENDCLOSE curKeyDEALLOCATE curKeyENDGOAbove srcipt runs fine with image data type in one table but when irun for some other table it gives me Error MessageTEXTCOPY Version 1.0DB-Library version 8.00.194SQL Server 'WSQL01' Message 170: Line 1: Incorrect syntax near '99'.(Concerning line 1)DB-Library Error 10007: General SQL Server error: Check messages fromthe SQLServer.ERROR: Could not use database 'test1'NULL-----------Aslo it only runs on server console if i run it from workstation uingsame files and tables it gives me an error again. Can anybody help meand reply me at Join Bytes! asap.thnx,dharmesh

View 1 Replies View Related

Query Works In 'test Query' But Refuses To Show Up In The Datagrid On A Web Page - Urgent!

Mar 28, 2007

Hey, i've written a query to search a database dependant on variables chosen by user etc etc. Opened up a new sqldatasource, entered the query shown below and went on to the test query page. Entered some test variables, everything works as it should do. Try to get it to show in a datagrid on a webpage - nothing. No data shows.
 SELECT dbo.DERIVATIVES.DERIVATIVE_ID, count(*) AS Matches
FROM dbo.MAKES INNER JOIN
dbo.MODELS ON dbo.MAKES.MAKE_ID = dbo.MODELS.MAKE_ID INNER JOIN
dbo.DERIVATIVES ON dbo.MODELS.MODEL_ID = dbo.DERIVATIVES.MODEL_ID INNER JOIN
dbo.[VALUES] ON dbo.DERIVATIVES.DERIVATIVE_ID = dbo.[VALUES].DERIVATIVE_ID INNER JOIN
dbo.ATTRIBUTES ON dbo.[VALUES].ATTRIBUTE_ID = dbo.ATTRIBUTES.ATTRIBUTE_ID
WHERE ((ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID1 and (@VAL1 is null or VALUE = @VAL1)) or
(ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID2 and (@VAL2 is null or VALUE = @VAL2)) or
(ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID3 and (@VAL3 is null or VALUE = @VAL3)) or
(ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID4 and (@VAL4 is null or VALUE = @VAL4)) )
GROUP BY dbo.DERIVATIVES.DERIVATIVE_ID
HAVING count(*) >= CASE WHEN @VAL1 IS NOT NULL THEN 1 ELSE 0 END +
CASE WHEN @VAL2 IS NOT NULL THEN 1 ELSE 0 END +
CASE WHEN @VAL3 IS NOT NULL THEN 1 ELSE 0 END +
CASE WHEN @VAL4 IS NOT NULL THEN 1 ELSE 0 END -2
ORDER BY count(*) DESC

 Here is the page source
 
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DevConnectionString1 %>"
SelectCommand="&#9;SELECT dbo.DERIVATIVES.DERIVATIVE_ID, count(*) AS Matches&#13;&#10;&#9;FROM dbo.MAKES INNER JOIN&#13;&#10;&#9;&#9;&#9;&#9; dbo.MODELS ON dbo.MAKES.MAKE_ID = dbo.MODELS.MAKE_ID INNER JOIN&#13;&#10;&#9;&#9;&#9;&#9; dbo.DERIVATIVES ON dbo.MODELS.MODEL_ID = dbo.DERIVATIVES.MODEL_ID INNER JOIN&#13;&#10;&#9;&#9;&#9;&#9; dbo.[VALUES] ON dbo.DERIVATIVES.DERIVATIVE_ID = dbo.[VALUES].DERIVATIVE_ID INNER JOIN&#13;&#10;&#9;&#9;&#9;&#9; dbo.ATTRIBUTES ON dbo.[VALUES].ATTRIBUTE_ID = dbo.ATTRIBUTES.ATTRIBUTE_ID&#13;&#10;&#9;WHERE ((ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID1 and (@VAL1 is null or VALUE = @VAL1)) or&#13;&#10;&#9;&#9; (ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID2 and (@VAL2 is null or VALUE = @VAL2)) or&#13;&#10;&#9;&#9; (ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID3 and (@VAL3 is null or VALUE = @VAL3)) or&#13;&#10;&#9;&#9; (ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID4 and (@VAL4 is null or VALUE = @VAL4)) )&#13;&#10;&#9;GROUP BY dbo.DERIVATIVES.DERIVATIVE_ID&#13;&#10;&#9;HAVING count(*) >= CASE WHEN @VAL1 IS NOT NULL THEN 1 ELSE 0 END +&#13;&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; CASE WHEN @VAL2 IS NOT NULL THEN 1 ELSE 0 END +&#13;&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; CASE WHEN @VAL3 IS NOT NULL THEN 1 ELSE 0 END +&#13;&#10;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; CASE WHEN @VAL4 IS NOT NULL THEN 1 ELSE 0 END -2&#13;&#10;&#9;ORDER BY count(*) DESC&#13;&#10;">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="ATT_ID1" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="TextBox1" Name="VAL1" PropertyName="Text" />
<asp:Parameter Name="ATT_ID2" />
<asp:Parameter Name="VAL2" />
<asp:Parameter Name="ATT_ID3" />
<asp:Parameter Name="VAL3" />
<asp:Parameter Name="ATT_ID4" />
<asp:Parameter Name="VAL4" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:DevConnectionString1 %>"
SelectCommand="SELECT * FROM [ATTRIBUTES]"></asp:SqlDataSource>
<br />
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource2"
DataTextField="ATTRIBUTE_NAME" DataValueField="ATTRIBUTE_ID">
</asp:DropDownList>
<asp:TextBox ID="TextBox1" runat="server" AutoPostBack="True"></asp:TextBox><br />
<br />
<br />
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="DERIVATIVE_ID"
DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="DERIVATIVE_ID" HeaderText="DERIVATIVE_ID" InsertVisible="False"
ReadOnly="True" SortExpression="DERIVATIVE_ID" />
<asp:BoundField DataField="Matches" HeaderText="Matches" ReadOnly="True" SortExpression="Matches" />
</Columns>
</asp:GridView>
</asp:Content>
 AFAIK I have configured the source to pick up the dropdownlist value and the textbox value (the text box is autopostback).
 Am i not submitting the data correctly? (It worked with a simple query...just not with this one). I have tried a stored procedure which works when testing just not when its live on a webpage.
 Please help!
 
(Visual Web Devleoper 2005 Express and SQL Server Management Studio Express)
 

View 4 Replies View Related

Can You Please Check Out My Sql Query And Tell Me What's Wrong With It? Thank You

Jul 20, 2007

the error message shows it's now allow " =�!=�<�<=�>�>=" after sub query..
 
Select * From ZT_MediaImportLog Where isNumeric(ImportFileTime) = 1 And ImportFileTime < Convert(varchar(10),DateAdd(Month,-CAST                              (( select keepmonth from ZT_MediaImportLog, ZT_BillerChain a,ZT_BillerInfo b,ZT_Biller c,ZT_databackup d where a.BillerInfoCode = b.BillerInfoCode AND c.CompanyCode = d.Companycode AND ZT_MediaImportLog.Importsource = a.ChainCode ) AS int),GetDate()),112)

View 6 Replies View Related

SQL Query To Check Against A List

Jul 23, 2005

SQL gurus...I have one table of items that is the master file. We will call this Table A.I have another table that contains few, some or all items from Table A. Wewill call this Table B.I want to run a query that compares the list of items on Table B against themaster list on Table A.If the item is not present on Table B, show it in the SQL results.Best way to achieve this? I am looping and doubling results in my sql tries.Jeff--Message posted via http://www.sqlmonster.com

View 1 Replies View Related

Check Query Status

Sep 26, 2007

Is it possible to create an SSIS package that checks for a running Query on my SQL db?
I need to some how check my SQL server and see if there is a query running, if its running I need to set an indicator in my table for my app. This job needs to be scheduled and run nightly (which I can do). But how can I query SQL and see if the query is still running?


View 4 Replies View Related

How To Validate Tables In DTS

Jan 4, 2000

Hai,

Can any one suggest me how to use the DTS to validate and transfer data from couple of tables of one database to different Server database
Is there any procedure how to pass variables (validations) while using DTS.
Can I use the following code for validation in DTS, if so can any one direct me how to use.


For example"

DECLARE CUR_X CURSOR FOR
SELECTsource column FROM sourcetable
WHERE sourcetable.sourcecolumn <> [some value]
ORDER BY sourcetable.sourcecolumn
OPEN CUR_X
FETCH NEXT
INTO CUR_X WHILE (@@FETCH_STATUS = 0)
BEGIN
INSERT INTO destinationserver.destinationtable(Destination columns)
SELECT source columns
FROM source table
WHERE source column = @sourcecolumn

Will appreciate for your time

View 1 Replies View Related

Validate Telephone No.

Aug 6, 2004

i want this column to accept telephone number of this format
000-000-0000

what's validation expression do i use? or how can get this db to accept this tel no. format
i use varchar for data type
thanks

View 2 Replies View Related

How Do You Validate And Scrub Using DTS?

Feb 11, 2004

When I use the DTS GUI and insert a "Bulk Insert Task" the main tab says:

"Import text files into SQL Server. You cannot validate, scrub, or transform data using this task".

So my question is, what shoud you use to validate and scrub?

In particular I have fixed-format text file with some occasional bad records (e.g. wrong length, empty record). What should I be using? If you suggest vbscript could you show me some examples? I'm new to vbscript.

Thanks!

View 2 Replies View Related

How To Validate Timestamp

Aug 31, 2013

How to validate timestamp,i have tried so many time ,but iam not getting correct result, hwo to validate source data has timestamp or not ? i would like result s if the data is timestamp that should be 1, if the data is not timestamp that should be 0 ,iam using code like this

CASE
WHEN TO_CHAR(OE_TECH_VLD_FROM_DTTM,'ddmonyyyy:hh:mi:ss.sssssss') then 1
ELSE 0
END

View 7 Replies View Related

Validate By Column Name

Jan 17, 2006

Hi,
I would like to validate a large file using an IS package before importing it into a table using IS. The Validation rules are stored in the database against each column name

Question
1. Is there a way I can get the column names of Input (coming from the file)? (So I could check them against the validation table)
2. Can I store these rules in memory, may be using an array if so how do i create an array?
3. What would be the best way to go abt doing this?? (I really appreciate any ideas)

Appreciate your help...

View 1 Replies View Related

DTExec /validate

May 23, 2008

HI, with a dataflow that has delay validation property = true, DTExec will not try to validate it when I call it with /validate option. Is there a way to see if the dataflow validate even though the delay validation property is set to true?

Thanks,

View 3 Replies View Related

Query With Multiple ID To Check And Response...

Jan 27, 2007

Hi there, I tried to make it different as usual but i´m stacked into this problem:Supose TABLE DetailsID_DET    ID_CAR    DETAILS1              3             1,2,3,4,5,62              4             2,43              5             5,6,7,8andTABLE  Details_ItemsID_DI       DETAIL_NAME1             Stereo HiFi CD2             Alarm3             AirConditioning4             LeatherSeats5             Pro Wires6             Aluminium WheelsThe problem appears when i need to bring CAR DETAILS (NAME) from TABLE DETAIL_ITEMS.Mi guess i that I should make something like:SELECT * FROM DETAILS_NAME WHERE id_di = ((  Array(i) FROM  Details  )) one by one...I really dont know how to face it.First I thought in bringing ALL details_Items (datafieldtext = id_di and datavaluetext=Details_names) into a dataview.And then "somohow?" filter this dataview according with the Array previuosly splited by me with a For each function.Then I thought "Perhaps" there is a simpliest way to do that using SQL views, o advanced SQL QUERYS.and Finally I thought that creating a VIEW in for both TABLES would be great.The point is that, neither 1,2,3 options, honestly , I dont know how to face them.Thanks in advance, apologise my "rude" English grammar.LUCAS ( From Argentina )
 
 
 

View 2 Replies View Related

Performing Insert Query With Check

Feb 29, 2008

hii,,i am using asp.net 2005 and sql server 2005.i have a web page in which i can enter details and it gets stored in a table in a database..in the table thrs a column called as sme_id,,what i want is when one inserts a new sme_id from the page,,it should check in the table so tht no duplicate sme_id wil b generated..,,this code is workin fine,,i just want to implement the above condition...here is the insert code which i have used along with sql datasource:::__________________________
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues"
ConnectionString="<%$ ConnectionStrings:sme_trackerConnectionString %>"
InsertCommand="INSERT INTO SME_Master(SME_Id, FirstName, LastName, Type_of_SME, Agency_id, Agency_Name, Email, Address, Phone, Mobile, Fax, TimeZone_Id, Experience, City, State, Status, Level_Of_Exam, Other_Comments, Certificate, Expertise)
 VALUES (@SME_Id, @FirstName, @LastName, @Type_of_SME, @Agency_id, @Agency_Name, @Email, @Address, @Phone, @Mobile, @Fax, @TimeZone_Id, @Experience, @City, @State, @Status, @Level_Of_Exam, @Other_Comments, @Certificate, @Expertise)"
OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [SME_Master]">
_______hope u got my problem,,,,,reply asap....thnks in advance

View 11 Replies View Related

Query Question - Check Before Insert

Dec 1, 2003

I have a table, emailaddresses with an emailaddress field.

before i do an insert from a stored proc, i want to check if the emailaddress is already in the database.

pseudo-code:

if emailaddresssparameter is IN emailaddress then
do not insert
else
insert into table
end

i've got the insert statement and the stored proc, but how do i write the check to see if it's already there? I mean i could do a select * from emailaddress wehre emailaddress=emailaddressparam

but how to i test it? if the count=1 then skip?

here's my proc now:

ALTER PROCEDURE dbo.AddOneEmailAddress

(
@emailAddress varchar(255),
@emailID int=0 OUTPUT
)

AS
/* SET NOCOUNT ON */
insert into EmailAddresses
(email_address)
values
(@emailAddress)
set @emailID=@@identity

RETURN @@identity

View 2 Replies View Related

Query Response Time Check

Sep 28, 2006

Is there a global variable or something of the sort that would tell me how long it took to execute a query??

I need to monitor my DB response times and we have a query that runs in under 2 seconds. So we want to run this query every couple of minutes and if it takes more than 12 sec to run, we want to send an email to our DB staff...

I know that I could take a time stamp before and after then subtract but I wanted to know if there was an easier way to do it..

Thanks.

View 3 Replies View Related

How To Check Multiple Records With One Query

Sep 3, 2007

i have a table which is having size and pieces information and say it is having following 4 records.



Size, pieces, sizeID, sizecombID (SizeCombination Id)

S, 1, 1, 1

M, 3, 2, 1

L, 3, 3, 1

XL, 1, 4, 1



Now suppose user enters all these 4 records which i will pass as xml string to my stored procedure.

Is there any way to check existense of all these 4 records in this table from the xml data which i pass by using one SQL statement ? Or what is the right way of checking it, Is it through using cursor ??

Finally after checking it should retrun SizeCombID for a existing record, and if record is not existent then it should add these 4 records in table and return the new SizeCombID.

Can somebody pls help on this..

View 7 Replies View Related

Help Needed To Validate 2 Users At Once

Sep 12, 2007

hi all, i want to ask about validating 2 users (2 userids and 2 pws) with one button. my database table called login and it has loginId and password.have tried
"SELECT * FROM login Where loginId = '" + hoName + "', '" + toName + "' AND password = '" + hoPassword + "', '" + toPassword + "'"
please help me!!

View 5 Replies View Related

Validate Sql Statements Before Inserting?

Mar 31, 2005

Hi experts!

I need to know how can i validate the sql querries so that they don't contain any scripts.

I am not using any web application or any other application.

I am only using query analyzer to write statements and execute.

So all my co workers are doing the same thing to insert the information
in database by using query analyzer. And at the end of the each day the
database files are shipped at another warehouse.

So where in sql server 2000/7 i can validate those statements before inserting them.

I don't want the my co-workers to know that i am validating their querries.

Thanks

View 3 Replies View Related

How To Validate Timestamp In ETL Studio

Aug 31, 2013

How to validate timestamp, I have tried so many time ,but iam not getting correct result, hwo to validate source data has timestamp or not ? i would like result s if the data is timestamp that should be 1, if the data is not timestamp that should be 0 , I am using code like this :

................................................................
CASE
WHEN TO_CHAR(OE_TECH_VLD_FROM_DTTM,'ddmonyyyy:hh:mi:ss.sssssss') then 1
ELSE 0
END
..................................................................

View 1 Replies View Related

Validate Subscriptions, Turn It Off

Feb 17, 2006

I added Validate Subscriptions to my publication using the procedure outlined in BOL. Procedure is listed below. I want to stop the validation for this publication. I do not want to validate any longer. How can I stop this process?
To validate transactional data using SQL Server Enterprise Manager

At the Distributor, expand Replication Monitor, expand Publishers, and then expand a specific Publisher.


Right-click a transactional publication, and then click Validate subscriptions.


Choose whether you want to validate all subscriptions or just specific subscriptions, and if you want to validate specific subscriptions, select those in the text box.


To choose the type of validation, click Validation Options.


Choose whether you want to compute a fast rowcount based on cached table information, compute an actual row count by querying the tables directly, or compute a fast row count and if differences are found, compute an actual row count.


You can also choose to enable Compare checksums to validate data, a binary checksum (if the Subscriber is running SQL Server 2000), and you can choose to stop the Distribution Agent after the validation has completed.

View 5 Replies View Related

How To Validate The Parameter Values?

Apr 25, 2007

Hi,

Is there any way to validate the input paratemers for the report? For example: I want to restrict the value to be less than 100 in one parameter. How to achieve this?



Thnx in advance.

View 2 Replies View Related

Validate Stored Procedure

Aug 23, 2006

Can i enforce the sql to refuse create the stored procedure if it select of non existing table?

View 3 Replies View Related

Could Not Validate The Service Accounts

Mar 22, 2008



Trying to install Backup Exec 12 which comes bundled with SQL Server 2005 Express.
OS is a clean install of Swedish Windows Server 2003 Std R2, fully patched.


SQL fails to install, and the following is in the SQL summary-log:

Product : Microsoft SQL Server 2005 Express Edition
Product Version : 9.2.3042.00
Install : Failed
Log File : C:ProgramMicrosoft SQL Server90Setup BootstrapLOGFilesSQLSetup0002_VAXSRV02_SQL.log
Last Action : Validate_ServiceAccounts
Error String : SQL Server Setup could not validate the service accounts. Either the service accounts have not been provided for all of the services being installed, or the specified username or password is incorrect. For each service, specify a valid username, password, and domain, or specify a built-in system account.
The logon account cannot be validated for the service SQL Server.
Error Number : 28075

Install log:
"C:Documents and SettingsadministratorSkrivbordBEWS_12.1364_32BIT_VERSIONWINNTINSTALLSQLExpressSQLEXPR.exe" /wait /qn /norestart /lv "C:ProgramMicrosoft SQL Server90Setup BootstrapLOGSummary.txt" INSTANCENAME=BKUPEXEC INSTALLSQLDIR="C:ProgramMicrosoft SQL Server" INSTALLSQLDATADIR="C:ProgramMicrosoft SQL Server" INSTALLSQLSHAREDIR="C:ProgramMicrosoft SQL Server" SQLACCOUNT="NT AUTHORITYSYSTEM" SQLPASSWORD="" ADDLOCAL=SQL_Engine,SQL_Data_Files,SQL_Replication,Client_Components,Connectivity SAPWD=**** DISABLENETWORKPROTOCOLS=0
03-19-2008,13:52:10 : V-225-53: ERROR: Failed to install SQL Express BKUPEXEC instance with error 28075.


Since the installation of SQL is bundled with the Backup Exec installation, there is no(?) possibility for me to specify usernames for the different services. The Backup Exec installation is initiated under the Domain Admin's login.

I suspect the problem occurs because of the OS not being English, but I am not sure. Have installed earlier versions of Backup Exec with SQL Server 2005 Express, on Swedish Windows Server 2003, before without issues.
No help at Veritas/Symantec's homepage.

Grateful for any help.

View 4 Replies View Related

When Does ConnectionManagerBase.Validate() Get Executed?

Feb 13, 2008

[Microsoft follow-up]

Hi,
I'm pondering building a custom connection manager and within the Validate() method I want to initiate a connection to a SQL Server instance, check something out, and then close he connection at the end of the method. Here's the code I have so far:




Code Snippet
public override Microsoft.SqlServer.Dts.Runtime.DTSExecResult Validate(Microsoft.SqlServer.Dts.Runtime.IDTSInfoEvents infoEvents)
{
DTSExecResult execRes = DTSExecResult.Success;
if (String.IsNullOrEmpty(_serverName))
{
infoEvents.FireError(0, "SqlConnectionManager", "No server name specified", String.Empty, 0);
execRes = DTSExecResult.Failure;
}
else
{

//Establish a connection and check that it is pointing to an MDM DB
SqlConnection sqlConnToValidate = new SqlConnection();
sqlConnToValidate.ConnectionString = this._connectionString;
try
{
sqlConnToValidate.Open();
if (!IsMDMDatabase(sqlConnToValidate))
{
execRes = DTSExecResult.Failure;
}
}
catch (Exception e)
{
infoEvents.FireError(0, "MDMConnectionManager", e.Message, String.Empty, 0);
execRes = DTSExecResult.Failure;
}
finally
{
if (sqlConnToValidate.State != ConnectionState.Closed)
sqlConnToValidate.Close();
}
}
return execRes;
}






I'm worried about the overhead of establishing a connection every time Validate() is called. So the questions are


When does Validate() get called?

Does it get called for every component/task that uses it?

Does anyone suspect that what I'm doing here is necassarily a bad thing or not?

Thanks
Jamie

View 5 Replies View Related

Can You Check My Select Max Query ? The Result Not Corret...

Aug 1, 2007

in table Databackup
company       keepmonth
-----------------  -------------------
001                 12002                 12003                  6005                  607917              609747              6
 
I run this query
select Max(keepmonth) as keep from Databackup
why the result is 6 not 12? I think the max value should 12 , have no idea why it return 6
does my query error?
thank you

View 1 Replies View Related

How To Check If Results Of Dynamic Query Exist

Dec 27, 2001

Hello,

I have a dynamic query in the stored procedure, and the code looks something like this:

SET @section_test = 'SELECT sectioncode FROM ' + @tablename + ' WHERE sectioncode = "' + @condition + '"'
EXEC (@section_test)

What I need to do is try to check if the query returns any values using EXISTS (possibly), but at the same time I don't want to return the results of that dynamic query's select statement in my stored procedure. Is it possible?

Thanks.

Regards,
Katya

View 1 Replies View Related

Query Analyser Does Not Check For Object Existence

Nov 27, 2000

we tried out the following code in query analyser -

create procedure TrialProc

as

select * from sakjdhf


when we executed this piece of TSQL in query analyser, we expected it to give an error or warning that no object by the name of sakjdhf exists ( as actually there is no such table or view in the database ). however to our surprise we got "command completed successfully " !!

does this mean the SQL server does not check for necessary objects when creating a stored procedure ? or is there some setting that we missed out whihch is causing SQL server to overlook the error in the code ?

View 3 Replies View Related

Check Multiple Parameter Instead Of Dynamic Query?

Oct 20, 2014

how to check multiple parameter instead of dynamic query.

View 1 Replies View Related

Query Or Script To Check Link Table

Mar 23, 2008

i'm pretty familiar w/ mysql, but relatively new to ms sql. Since i can do a lot more w/ ms sql, I have been trying to do all tasks in sql queries or scripts, but i'm stumped on this one. I have a table that links two things together. t1 has rows id1 and id2. When a row has these two id's, there is a "link" between them. I'm trying to make a command or script that will see if there is only 2 links for any given id.

for example, it would loop through each row, and run this command:

SELECT COUNT(*) AS Expr1
FROM links
WHERE (Id1 = this_rows_id1) OR (Id2 = this_rows_id1)

and again w/ id2

and then i would be interested in any row that only had a count of 2. is this possible?

View 2 Replies View Related

Query - Check For A String In Stored Procedure

Jul 23, 2005

Hi,I would like to check if a string value exist in a string in sqlserver stored procedure, e.g.set @testString = 'this is my test document.'if (@testString contains 'test')begin.....endHow do I do this in sql server stored procedure?Thanks,June...

View 1 Replies View Related







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