Multiple Options Issue

Mar 3, 2008

Hi,

The variable @Item can contain multiple values separated by a comma.
e.g. ItemA, ItemB

But the STORED PROCEDURE query sees it as one string instead of 2 separate ones.

How do I solve this?
Thanks.




Code SnippetWHILE(@StartDate < @EndDate)
BEGIN
IF LEFT(DATENAME(dw,@StartDate),3) NOT IN ('SAT','SUN')
INSERT INTO @temp(myDate) VALUES(@StartDate);
SET @StartDate = DATEADD(d,1,@StartDate);
END





Code SnippetSELECT LEFT(DATENAME(dw, te.myDate), 3) + ' ' + CONVERT(char(11), te.myDate, 106) AS 'NewsDate'
FROM @temp AS te
LEFT OUTER JOIN
NewsItemTable AS t
ON t.NewsDate = te.myDate
AND t.Item IN(@Item)
WHERE t.NewsDate IS NULL

View 1 Replies


ADVERTISEMENT

Multiple Options Into One SQL Field

Apr 13, 2007

Morning all,

I'm writing an Insert form which will write records to a few tables. What I want to know is how do I write multiple answers to one question in different rows in the table but keeping the ID?

For example.

The form has the following fields:

HotelIDHotelFacilities (CheckBoxList)

Now each hotel (in this case) will only have one ID but more than one HotelFacility .

How do I get my table to read...

 




HotelID

HotelFacility




1

Bar




1

Restaurant




1

Cafe




1

Wi-Fi Access


I presume INSERT INTO tblHotelFacilities(HotelID, HotelFacility)                  VALUES(@HotelID, @HotelFacility) won't write more than one selected facility?Thanks,Brett 

View 5 Replies View Related

Multiple Parameter Options

Apr 22, 2008

I need to create a series of reports, which will have multiple parameters. I will have 2 parameters, which I need to make available for both to be used, none to be used or one or the other.

I can achive this in the 'data' area of VS2005, the parameters are listed in the 'layout' area, however I can not get the report to run with out selecting both the parameters in the 'preview' area.

I think it may be to do with the Allow Null check box but I can not get it to work! with data type string.

He is my where clause, which works: -

WHERE (NewMainintro = @Intro) AND (NewStatus = @Status)


OR
(@Intro = '') AND (@Status = '')
OR
(NewMainintro = @Intro) AND (@Status = '')
OR
(NewStatus = @Status) AND (@Intro = '')


Any help would be appreciated.

Thanks

View 1 Replies View Related

How Can I Have Multiple Chart Options For A Report?

Apr 13, 2007

Hi, all experts here,

Thank you very much for your kind attention.

I have a question about how to have multiple chart options for a report? Like when I view a report, I want to see the report in different charts formats. It is possible in SQL Server 2005 Reporting Services (designer) to change from different chart options? Hope my question is clear for your advices.

Thank you very much in advance for your help and advices. And I am looking forward to hearing from you.

With best regards,

Yours sincerely,

View 7 Replies View Related

Setting And Restoring Multiple Connection Options

Jul 20, 2005

I need to set multiple values for some SQL statements, for exampleSET NUMERIC_ROUNDABORT OFFGOSETANSI_PADDING,ANSI_WARNINGS,CONCAT_NULL_YIELDS_NULL ,ARITHABORT,QUOTED_IDENTIFIER,ANSI_NULLS ONGOin a .sql file, but would like to reset them to their previous settingsagain for other SQL statements. I didn't find anything in books online. Ithought just calling "set" was enough, but apparently not ....Thanks.

View 3 Replies View Related

Search By Multiple Date Range Options

Nov 1, 2007

I inherited a system and am moving our SQL2000 input data into a new 2005 database for web searching by clients. The conversion went pretty well, but I'm looking for suggestions on how best to index and query the data.



Details: We have almost 500,000 records in a pretty wide history table, and will be adding more records daily. The original table design has numerous sets of dates(first/last of different types), some small fields, and one large text field that is used for full-text catalog. The input dates are all stored as datetimes set to midnight by an insert trigger.


...

FirstPub as datetime

LastPub as datetime

FirstSale as datetime

LastSale as datetime

Name as varchar(50)

Addr as varchar(50)

DetailText as text....



I need to create a new asp.net page that can accept any specific date, or a range of dates (first/last publish date or range, first/last sale date or range) along with any of the optional 10 text fields. All input is optional, and any combination of fields can be entered. Result set has to include the primary key, key dates, and the large text field.


I've read many posts and articles, but find many different opinions about what works best. I found a similar solution that used a series of case statements with text operators indicating if the date was input or not. Other guys say no - just pass the dates as null without any additional control fields.



I found solutions saying it's best to pass dates as strings, and others that say to use datetime everywhere and just format the presentation. Some say convert dates to formatted dates and then compare them. Others say that causes table scans and should be avoided.



Questions:

1) What is the best way to get a compare dates that are entered through an asp.net page and stored procedures?

2) How to query either a specific date, as well as a range between the first and last date specified? Can it be done efficiently without needing additional screen fields for the range specification? If tried checking nulls, but am having trouble selecting multiple sets of date ranges and/or specific dates with one proc. There is always the old method of storing the selected keys in temp table, and then returning the distinct rows. Most of my experience has been in SQL 7.0 and some 2000, so I'm wondering if there are new ways to tackle the problem.

3) Better to create an index for each date type that might be selected, or one index that has all the main dates in one place?

4) Should we split the large text field to another table in our search database? It would seem to make sense to split them as we add records from the input system. Two tables linked with the same primary key seems like a good improvement from original table design. How would that affect the performance of returning all selected rows and including the large text field?

View 3 Replies View Related

How To Set Options ONCE?

Jul 16, 2003

Very often, when I generate SQL scripts for a table, I forget to go to Option tab to click the pk, default, index boxes. Is there a way to permernatly set the whole sql server generate sql scripts options ONCE?

thanks
David

View 2 Replies View Related

Too Many SET Options

Mar 10, 2006

HiI have created a Sql Script through Enterprise Manager for Drop acolumn. By default its creating lot of 'SET' commands. I doubt allthese SET options are required or not. Pls comment on this issueBEGIN TRANSACTIONSET QUOTED_IDENTIFIER ONSET TRANSACTION ISOLATION LEVEL SERIALIZABLESET ARITHABORT ONSET NUMERIC_ROUNDABORT OFFSET CONCAT_NULL_YIELDS_NULL ONSET ANSI_NULLS ONSET ANSI_PADDING ONSET ANSI_WARNINGS ONCOMMITBEGIN TRANSACTIONALTER TABLE EmployeeDROP COLUMN OrderDetails_IDGOCOMMITDil

View 2 Replies View Related

Options?

Jan 18, 2008

Hi ,

I could do with a couple of pointers to the best options to acheive my goal, I'm pretty close with the way I've done it, but I feel there is a more elegant solution out their so your help would be most appreciated.

The problem is finding the best way of moving some SQL Server 2000 changed data into sql server 2005. We are only interested in some tables in 2000 (and sometimes just subsets of those). Because there are quite a few tables and the we want to set up a schedule to run periodically, we chose SSIS. The main reason for this is to utilise a for each loop that pulls each tables name from a one column staging table of table names. (that way we can do more or less comparisons by simply adding and removing from the staging table) Also in this loop, using the table name as a variable, we run an exec sql task along the lines of 'SELECT * from varTable EXCEPT SELECT * from varTable_tracker' which gives us the difference beteween the two tables (where the tracker table is a copy of the data table which is sychronised at the end of the job run). So far so good. Now the tricky bit, EXCEPT only works under 2005, the tables are in 2000 so we ended up having a linked server in 2005 back to the 2000 table. Is there a way of acheiving the same result without involving the linked server - or is there a task (script?) we can run to verify the linked server is up before we excecute the job -we already run checks on Connection Managers to see if they are up but never tried linked servers? Lastly, will performance be an issue

Thanks

View 5 Replies View Related

DBCC Options

May 4, 2002

anyone know about the undocument options of DBCC?
which options are undomented?
i.e.
log
There are only a few options which are documented in SQL Online Books
thank in advance

View 1 Replies View Related

Licensing Options

Dec 13, 1999

Is it necessary to reinstall SqlSvr 6.5 in order to chance
from 'per server' to 'per seat' licensing ?

View 1 Replies View Related

What SQL Dbcc Options Should Be Run .....

Aug 2, 2001

SQL 6.5

What are the most critical "dbcc" options that should be run to insure the sanity of database and DBA alike? Do these have to be run in single user mode or can they be run while users are on the system?

Thank You.

View 1 Replies View Related

Full T-Log: Options?

Apr 29, 2007

An automatic monthly delete has recently grown from 15 to 20 million rows. It is now filling my 70GB T-Log completly. I don't have any space to expand the T-Log. Do I have any options other than reducing the number of rows in the delete?

View 2 Replies View Related

Out Of Options, Need Performance Help.

Jan 21, 2004

hey guys, i need your help please.
here is the scenario:

1. I need to return a data back to client (result set varies 20-10,000)
2. I only want to show 20 records at a time
3. To get info i need to display i need to join 10 tables

When there are small #s of records it works but when i get over 8000 then it becomes a problem:

1. The first version was:
Get all data using big query and return everything back to client and display only 20 at a time (not very proficient).
Takes around 15 seconds to view 20 records.

2. Inspired by 4GuysFromRolla (http://www.4guysfromrolla.com/webtech/062899-1.shtml)
Use Stored Procedure w/ server side paging logic to get 20 records at the time. I had to pass every filter parameter and stuff. SP had to sort resultset and return only 20 records i need to display.
Takes around 5 seconds to view 20 records.

I still think it's slow, i know this is a very broad question but is there any other way to do it, logically?

Any help is appreciated.
Wojo.

View 14 Replies View Related

SQL Server Options

Apr 10, 2004

Hi folks, Recently i've installed a fresh Installation of Opertaing Sys and SQL.
Win 2000 server, sp4
SQl 2000 Enterprise, sp3.
I am using Domain user service startup for sql and is member of domain admin. I've manually added the user in Local-Admin group of the system. Obviously it's also has Sys-Admin server roles.
The problem is; when i use enterprise manager and change any of the server settings; Priority Boost or Fix Memory Allocation for the Sql server, nothing happens, the options dialog box closes and doesn't ask for restarting the server neither does the settings take effect when i restart SQL.
However if i change the settings using sp_configure using the same user; it works. i've assigned a fixed memory to SQL but the option "Reserver Physical Memory For SQL" won't work. Couldn't find this option in SP_Configure.
Any ideas, what has gone wrong.

View 6 Replies View Related

Table Options

Aug 14, 2007

Hi all,

This follows on from a query I had a few days back (and for which I was promptly flamed! However, I've got skin like a rhinoseros, so here goes...)

I have a table - ProjectSite - that is pulling information from a two tables (Project and Site). This table contains data regarding which sites are part of which project.

I now want a means of reporting dates against this. The problem is that each project has bespoke milestone dates, so I can't just create columns in ProjectSite. The only solution I can see is to pull each project (and there's quite a few and its corresponding sites into a new table) and then I can create my bespoke columns.

Does this sound like the best viable option, or can anyone suggest another means of doing this?

TIA,

SamuelT

View 1 Replies View Related

Deployment Options

Aug 7, 2006

Hello all,

I am considering the different options for package deployment on the server.
Until now, I have found several different ways to deploy packages to the server (File System):


Using the Import option from the Management Studio (only one by one)
Using the Deployment Utility (Needs building the whole project. Opens all the packages in debugging mode, cannot deploy to different folders)
Using the dtutil by constructing a command line for each package deployment. (complicated)
Simply copying the files from the local project folder to the "Program FilesMicrosoft SQL Server90DTSPackages" folder on the server.

Does anyone have any other suggestions for deployment?
The 4th seems to be the easiest one, but I seen anybody suggesting such an action. What's the downside of such an action?

Thanks,
Liran

View 1 Replies View Related

RDA Tracking Options

Oct 4, 2007

I hoipe someone can point me in the right direction here.

I have an application with the following requirements (using SQL CE 2 alas)


A set of tables on the server that need to be imported to the handheld. Using rda, I need to get the modifications to these tables from the server (add/edit/delete) but the handheld will never update these tables.

A set of tables on the server that need to be imported to the handheld. The handheld needs to add/edit existing records, and it needs to get any changes from the server.

A set of tables on the server where the handheld needs to import a subset of the records. It needs to add (but not edit) new records, upload the new records to the server, and download any changed (add/edit/delete) records to the handheld.
What tracking options should I use in these 3 cases?

The problem comes in that I need to have some foreign key relationships in the database on the handheld. Since rda munges the names of primary keys (and indexes), I do not know of a good way to add these foreign key constraints. Any suggestions?

Thanks

View 2 Replies View Related

Reporting Options

Feb 2, 2007

Hello all. I am currently doing some research into options for
setting up reporting. Right now we have a server on EE that's
getting hit a bit too hard by the reports. The budget is
currently a bit low, but we already have a second server
purchased.



For our reporting, we need data that is up to date within the last 15
minutes (less if possible). Because of the potential size of some
of our transactions, I've ruled out log shipping as being too much
downtime of the reporting data while the second server is catching up
to speed. So, I'm trying to figure out what reporting options I
have left open to me.



1) I understand that for reporting purposes, a snapshot must be taken
of the mirrored server. Why are reports not able to run directly
off the mirror live (or am I mistaken?).



2) Is it possible to mirror from EE to SE (remember, low budget for the second server)?



3) How high is the overhead when doing a snapshot every 5-15 minutes (
I would think it's machine specific, but overall is it pretty quick or
prohibitive based on how often the snapshot would be needed)?



4) Is replication perhaps a better option based on how up to date the
data has to be? Are there any other options that may be available
for near-realtime reporting?



Thanks in advance for your time.

View 4 Replies View Related

Hosting Options

Jan 4, 2006

Hello,

 

I have been attempting to locate a hosting company that offers SQL Server 2005 in addition to Analysis & Reporting Services but have been unable to find a hosting company which does so without purchasing the entire server. Anyone know of a company?

 

Thanks in Advance,

Garrett

View 1 Replies View Related

Deployment Options Help!

Jul 5, 2006

Sorry I am a newbie in SSIS.

I have got a small project that requires to feed in a .CSV flat file and load the data into SQL server 2000.

I developed a SSIS package for this and get it working in my computer, but I need to deploy it to customers that they don't have VS 2005 or SSIS installed. May any one of you give me some clues on that?

I played around with the flat file deployment and again it seems only working on my computer as I have everything installed.

View 1 Replies View Related

Licensing Options

May 29, 2008

Hello all,

Just wanted to get some feedback on this scenario. I will be developing an ASP.net application for our local intranet that employees will have access to. It may also be implmented to allow employees to access this ASP site from home as well. I would be using SQL Server 2000 as the backend DB and wondered what type of licensing would best fit this scenario?


Sorry if this is double posted....seemed to be having some issues with posting.

Thank you!

View 6 Replies View Related

ArithAbort And ArithIgnore Options

Jul 26, 2006

Hi,
I was recently experiencing a slowness when executing stored procedures from a .NET Application, but it went fast when executing from Query Analyzer. Research led me to find that by turning ArithAbort ON that it forces the SQL Server to use the same Execution plan whether the request is coming from Query Analyzer or the Application.
My concern now is the effect of ArithAbort. I understand what turning this option does, but I am trying to think of a scenario where turning it on could be bad.  Does anyone have any suggestions on what I should be aware of when disabling/enabling ArithAbort or ArithIgnore?
Thanks.
-Brian

View 1 Replies View Related

Sqldatasource And Advanced Options

Mar 13, 2007

Hello, I am trying to bind a sqldatasource control to the gridview.
I have selected the sqldatasource control and specified the connection string, on configure  Select statement page under advanced options both the check marks
Generate INSERT, UPDATE and DELETE Statements
Use Optimistic Concurrency  
are disabled for me.I have a proper SQL Server database not an express data base, how do i get to generate the InserCommand, EditCommand etc
Any help would be great .. relatively new here
thanks 
 

View 2 Replies View Related

Advanced SQL Generations Options

May 13, 2007

Advanced SQL generations options:
generate INSERT, UPDATE, and DELETE statements is all greyed out?
in my sql data source control.?
I have made a brand new instance with sql server management express....have I missed something?

View 4 Replies View Related

Options For Connecting To A Server

Jul 20, 2007

We have an intranet site (.NET 2.0) that needs to access to a SQL Server 2005. We've created a named user on the server, WebUser, and use it's credentials in the connection string to connect to the server.
Due compliance issues, we're being asked to remove all the named users from the server. Now the users will have to connect to the database using their security context. That means all the users need to be in some server role, should be given access to the server, etc which is a security risk and a maintenance nightmare.
What other alternatives do we have to solve this problem?
Your help is much appreciated.

View 1 Replies View Related

How Do You Display The Connection Options?

Dec 8, 2005

I know in ASP one could looop through the collection using For Each
like below to see all the connection options. How do you achieve this
in ASP.NET?

    for each item in
objCNN.Properties        intCTProps = intCTProps +
1        Response.Write "<tr><td>" & intCTProps
& "</td>" & vbCRLF        Response.Write
"<td>" & item.name & "</td>" &
vbCRLF        Response.Write "<td>" & item.value
& "</td></tr>" & vbCRLF    next

View 1 Replies View Related

Max Server Memory Options

Apr 4, 2001

Is it possible to leave this parameter (max server memory (MB)) on default(2147483647) if on my Cluster I have Oracle, Lotus Notes and some other things running, or I have to calculate the amount of memory SQL Server needs?
Thanks for any suggestions!

View 2 Replies View Related

Failover Options- Any Besides MSCS?

Jul 16, 1999

I need to know if there are any other failover options available for SQL Server/NT, beyond Microsoft Clustered Services. If there are any, which ones are advised?

Thanks,
Jon
jon_waldow@emeraldsolutions.com

View 1 Replies View Related

Dropdown Other Options..how To Store?

Jun 2, 2005

Hi
Often we come across a form with a dropdown list (populated from a lookup table) with "Other" option as well. When user selected "Other" option a textbox appears where he can specify new option(This option is not to be added to master lookup table).

What is the best way to store it in database?
I have 2 columns (A and B). 'A' contains Lookup ID if some option other than "Other" is selected, else 'A' has NULL and 'B' field contains the text of Textbox.

But while reporting I face problems as in a report the selected option text (either 'A' or 'B') has to be shown under one column only but SELECT A,B results in 2 columns.

View 1 Replies View Related

Front End Options (access)

Oct 27, 2006

My company uses MS SQL Server for the back end and a Retail specific CRM as the front end. I wish to develop some internal peices of software for our use. I was planning on doing this with access.

my options are:

*Use access as front end and backend
*Use access as front end and SQL server as backend (create new DB)
*Use other front end and SQL Server as backend.

My question is, what are some good front ends that are availble for reletively small demands? How does Visual Studio come into play?

*Also, I would prefer to be able to create a .exe. I dont think access alows that. I would not want users to be able to go in (or even see) the tables and queries. They should only be able to see the one main menu form at the very least.

thankyou,
Dynasty

View 1 Replies View Related

Security Options; And How To List On Lan.

Oct 5, 2005

I have been asigned an SQL server, and i'm new to it, so i have some doubts. I have seen there are 2 ways to log in to it (from an application), using the windows loging, or some kind of userid on SQL, and a mixed mode. Can somebody elavorate? Also, what are the UDL files for? Jow do i make the server appear on the sql servers list? Thanks.

EDIT: just found a good info on the security options ... what i don't get is why my server does not appears on browsing for SQL servers (others do).

View 2 Replies View Related

Sql Express Options With Replication ?

Aug 9, 2007

I am considering using a local database for a desktop application, instead of relying on remote connections. This will require replication I suppose to sync up table changes etc. What are my options when using Sql express on the client end and Sql server (standard edition) ?

After looking at this
http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx

Now, Im wondering how do I get local changes merged back into the primary database ?

View 1 Replies View Related







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