How To Get Names Of All Databases Using Sql Statements?
How can i get names of all databases using sql statements or system stored procedures? Thanks in advance!
View Complete Forum Thread with Replies
Related Forum Messages:
Referencing Other Databases In SQL Statements
Hello, I have an access database and an SQL database and using data transformation services, i want to update the access database using the SQL data. Can anyone tell me the syntax for referencing the access database? Is it something like: [TABLENAME].dbo.FIELDNAME ? Just to clarify, i have Microsoft Access Database Table 1 (UnitHistory) SQL Database Table 1 (UnitHistory) How do i reference these seperately? I want to update the microsoft access database based on the SQL database data. Eventually i'm trying to update an access database using the data held on my SQL server. Is DTS the best way for me to acomplish this or should i use another method? Thanks guys
View Replies !
Using Qualified Names Of Databases
I have databases a1 , a2 , a3 , a4 ... an. Each has a table t1 . I am writing a stored proc which compares the t1 table between any given two databases. I want to pass the database name as a variable .. so the SPROC looks like exec sp_comparetable 'a3' , 'a7' My question is , inside the SPROC ,how do I refer to the tables in the a3 and a7 databases. Thanks, Alok.
View Replies !
Price Of Using Multiple Databases In SELECT Statements
Hi,We are discussing possible implementation for sql2005 database(s). This database will serve one web portal. Part of data will get into it by hand, and part will be replicated from internal system.Some of us are for creating two separate databases, since there are two separate datasources. One, automatic, will change very little over time and requires almost no maintenance. Other datasource will be manual input. Tables and procedures related to this part will change over time.Some of us are for creating single database, since it will serve one web site. More important this group is concerned about performance issues since almost every select will require join between tables that would be stored in two separate databases. Do these issues exist? Can you share some insights, comments, links about this?
View Replies !
How To Get The List Of Names Of The Databases Of A Server Using OleDbConnection In C#.......?
I want to get the names of the databases of the server using OleDbConnection in c# which i have to add in to a combobox.....the same task i achieved using SqlConnection where in there is a Class SqlClientCollectionNames...the code is as followsusing (SqlConnection connection =new SqlConnection("Data Source=server;User ID=username;Password=passwd")) { connection.Open(); DataTable myData = connection.GetSchema(SqlClientMetaDataCollectionNames.Databases); foreach (DataRow row in myData.Rows) comboBox1.Items.Add(row[0]); connection.Close();} but the same i did for OleDbConnection it is not working using (OleDbConnection connection =new OleDbConnection("Provider=SQLOLEDB;Data Source=server;User ID=username;Password=passwd")) { connection.Open(); DataTable myData = connection.GetSchema(SqlClientMetaDataCollectionNames.Databases);//no such method Databases present in OleDb namespace foreach (DataRow row in myData.Rows) comboBox1.Items.Add(row[0]); connection.Close(); } is there any other way to do this using OleDbConnection........??Please help
View Replies !
Are Duplicate Instance Names A Problem If Physical Server Names Are Different?
If I restore the master database from ServerA to ServerB and start the SQL Server services on ServerA and ServerB, the master databases will be identical and running sp_helpserver and @@ServerName will indicate the SQL Server instance for both instances is ServerA. Is this ok considering the physical server names are different? If this is ok, how does SQL Server advertise on the network who it is? Does it append the physical server name to the SQL Server instance name during network communications? Thanks, Dave
View Replies !
DB Mirroring: Different Server Names With Same Instance Names
I'm going to be setting up DB mirroring between two SQL Server 2005 boxes. Since these are on two different servers, can the instance names be the same? Is there any reason NOT to do so if the mirror server is going to be used exclusively for DB mirroring? For example: if the my primary DB is located on SERVER1INSTANCE1, can the mirror be SERVER2INSTANCE1 or do the instance names have to be different even though they're on different boxes. Thanks!
View Replies !
Table Names And Field Names
I'm trying to do an update query that looks like this: UPDATE PAEMPLOYEE SET PAEMPLOYEE.LOCAT_CODE = EMPLOYEE.PROCESS_LEVEL FROM PAEMPLOYEE A JOIN EMPLOYEE B ON A.EMPLOYEE = B.EMPLOYEE It's erroring out on the Employee prefix B.EMPLOYEE saying: ..."does not match with a table name or alias name used in the query" Is it wrong or will it cause problems to have a field name the same as the table name?
View Replies !
Server Names Or Instance Names
Hello there. I'm trying to populate a drop down box with a list of all available instances of SQL server (express or not) available on a network. To list all instances I'm using EnumAvailableServers() in SmoApplication. The issue is that the Instance column in the returned data table is always empty, and both the Name and the Server columns contain the same string -- the name of the computer the SQL server is installed. Locally I have SSE installed, the instance name is <computer_name>SQLEXPRESS, however, using Smo I can't seem to get to the either full instance name or just the instance name. I can't assume SQLEXPRESS, since there may be more than one installed. Alternately I used EnumRegisteredServers() in SmoApplication.SqlServerRegistrations and that, while returning instance information (can be retrieved from the RegisteredServer in the returned collection), doesn't always return the remote SQL servers in the list. Any idea how can this be done? Maybe I'm going at it the wrong way, maybe there's another class / method I need to use to retrieve all instances? Thank you
View Replies !
Service Broker Not Working For Restored Databases (SQL 2000 Databases Restored On 2005)
I just restored my SQL server 2000 database on the SQL server 2005. after this i ran the Service broker sample ("Hello World") on this database by changing the AdventureWorks name to the new database name. The "setup.sql" runs fine. When i run the "SendMessage.sql" i was not getting any rows in the output (The message was not getting inserted into the queue). I checked the Service broker is enabled on this databased using the query "select is_broker_enabled from sys.databases where name = 'newdbname' " It was 1. I even tried the ALTER DATABASE SET ENABLE_BROKER. but it didnt work. When i tried the sample on a newly created database it worked fine. Is there any solution to make the restored database to work for service broker. Thanks Prashanth
View Replies !
Copying Databases Between Databases
hi from France !!! i would like how to duplicate a database to another server with all datas, constraints, keys, indexes... should i use sp_attach_db, dts, backup/restore, sql scripts... ??? thanks to all, nico
View Replies !
If Statements
Hello I have an SQL Data Source i want to compare 2 dates if one is equal to or less than the other i want to return either a string or a true i have been trying combinations for about an hour and it's getting a little frustrating i;ve tried searching for an example but cant find one so somesthing like Select ValuesWhere Date1 <= Date2 Return "String"(orTrue?) also IF date1 <= Today() Return "String OR True" thanks Chris
View Replies !
Help With If-Else Statements In SQL...please...
Hello guys. How is this declared in SQL? Select * FROM my_table if my_column = "1" UPDATE my_table SET my_other_column= "a" ////my_column and my_other_column belong to my_table else if my_column="2" UPDATE my_table SET my_other_column= "b" ////my_column and my_other_column belong to my_table
View Replies !
If Statements In SP
I use SQL Server 2005.I want to create a SP "Search". With this function a user can serach the member database on several criteria: age minimal, age maximal, name, city..BUT these criteria do not necessarily have to be defined by the user, so it might be that a user searches for all members whose age is between ageMin and ageMax leaving the name and city criteria empty.So in my SP I have to check whether these values are empty or not. If a parameter is not empty I have to add it to my selection query.. BUT, I know that SQL Server makes an execution plan, and understood that when you use if-statements the procedure needs to be recompiled every time?Is this true? If so:how does this work then?Is there another way for me to still be able to create this SP?
View Replies !
SQL Statements
Hi guys, Need some help in some query processing... Here goes,this is the results i have obtained so far |id |cat | name | 1 .....a... apple 1 .....b .. banana 2 .....a ...austria 2 .....b ...brazil 2 .....c ...china 3 .....a ...abraham 3 .....c ...clinton Column cat can have at most 3 different types of values..{a,b,c} I wanna write a query such that the result comes out as such <(....id ......a .......b......... c..) corresponding to these fields.> |Col 1| Col 2 | Col 3 | Col 4| ....1 ...apple ...banana ....2 ...austria .brazil... china ....3 ...abraham ..........clinton Anyone can help...thanks guys
View Replies !
Sql If Statements
I have some trade data. One colum is tran_status_mtf. within that column is "settled/traded", "cancelled", and "revised". I want to write and SQL statement that says if the trade is "settled" or "traded" display "A" in my output. How do I do this? I am new to SQL. Thanks in advance guys!!!
View Replies !
Different T-SQL Statements?
Hi, i just want to know if the T-SQL statements in SQL server 2005 are different from SQL Server 2000??? If they are different, where can i find the Server 2005 T-SQL Statements?
View Replies !
SUM And Iif Statements
Hello, I have a report with 1 field that I need to sum into 2 different textboxes based on another field's value. Specifically, Is it simply doing something like this below? =Iif(Fields!iBB.Value=1, Sum(Fields!Billed.Value) =Iif(Fields!iBB.Value=0, Sum(Fields!UnBilled.Value) Which will not get past intellisense checking, -or- do I have to do something different here? Thanks in advance.
View Replies !
SQL If Statements
I am totally new to creating IF statements inside stored procedures. I am passing some parameters from a ColdFusion form to a SP and if the form is empty for the small date I get an error. I would like to be able to check in the procedure to see if the parameter is empty and if it is set a default value for it. Here is my code. @JOB1, @COLLEGEDATE smalldatetime, If(@COLLEGEDATE <> ''") @COLLEGEDATE smalldatetime, ELSE @COLLEGEDATE = getDate(), RETURN @JOB2
View Replies !
IF Then Statements
I need to create a brief statement in Design View for SQL 2000. I successfully wrote "isnull(dbo.Data.Parcel,'')in the Column in Design View, which would ensure that a null value would be listed as a blank. Now I need to have dbo.data.status show as 'C&G' in any instance of data, otherwise it will be listed as blank. I tried writing "isnotnull(db0.data.status,'Homestead', '')", but it does not work. Is there a simple statement I can write in "column" of design view that can get the results that I need? -Steve
View Replies !
Using Sum In Sql Statements
I have written an sql statement thats using sum. The problem that I have is that when the value is zero it returns Null. Is there a way that I could return zero instead of null.
View Replies !
Help Writing SQL Statements
Hey everyone, I'm making a site and I need to write some code that will do the following things: Write a statement for the Page_Load event to pull the information from the db and load it into a textbox and a textbox with multiline attribute.
View Replies !
Use Two SQL Statements In One SqlDataSource ?
Hello, I have SqlDataSource to retrieve a data into DetailsView, or GridView, whatever. I want to use two Select command like this: <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=AHMED-4714D04B3;Initial Catalog=mp;Integrated Security=True" <% if (( parID == 3) || (ParID ==4) { SelectCommand="SELECT [PID], [PageID], [PageContent], [ParID], [ChiID] FROM [mp_page] WHERE ([ParID] = @ParID)"> <SelectParameters> <asp:ControlParameter ControlID="DropDownList1" Name="ParID" PropertyName="SelectedValue" /> </SelectParameters> } else { SelectCommand="SELECT [PID], [PageID], [PageContent], [ParID], [ChiID] FROM [mp_page] WHERE ([ChiID] = @ChiID)"> <SelectParameters> <asp:ControlParameter ControlID="DropDownList1" Name="ChiID" PropertyName="SelectedValue" /> </SelectParameters> } </asp:SqlDataSource> Is it possible to do something like that ?
View Replies !
Max SQL Statements In One Page
I'm running a custom built report on .net page Basically there are a lot categories. I need to run SQL statements for and for each category, the catch is these statements are all in loops for i = 1 to 12. Therefore 108 categories X 12 iterations of SQL calls = a little more that 1200 sql calls from one .net page. There is obviously a major problem with load time and running these reports are painful to the user and the system. Is there any easier way to possibly pre-compile all the data into a temp database so I wouldn't need to make as many sql calls??????? If so, would a stored procedure handle something like this. Sorry for being somewhat vague.
View Replies !
Several Select Statements?
Hello, how can i merge together several select statements? I have something like this: CREATE PROCEDURE Forum_GetThreads @ID int,@AscDesc bitASBEGINSET NOCOUNT ON;SELECT * FROM forum_ansageSELECT * FROM forum_topics WHERE (status = 0) ORDER BY (created) DESCIF (@AscDesc = 0)BEGIN SELECT * FROM forum_topics WHERE (status > 0) ORDER BY (created) DESCENDELSEBEGIN SELECT * FROM forum_topics WHERE (status > 0) ORDER BY (created) ASCENDHere i want to merge them all together and return only one SELECT statement with all the data
View Replies !
Help With Insert Sql Statements...
Hi guys! I have these commands that insert into two tables, if condition 1 is met, it will insert into the first table, if the second condition is met, it will insert into the second table. Is there a way for the insert statements to be merged so that I won't be executing two statements? Dim update_phase_before As New SqlCommand("INSERT INTO TE_shounin_todokesho_jizen (syain_No,date_kyou,time_kyou) SELECT syain_No,date_kyou,time_kyou FROM TE_todokesho WHERE TE_todokesho.b_a='before'", cnn) Dim update_phase_after As New SqlCommand("INSERT INTO TE_shounin_todokesho_jigo (syain_No,date_kyou,time_kyou) SELECT syain_No,date_kyou,time_kyou FROM TE_todokesho WHERE TE_todokesho.b_a='after'", cnn) Thanks.
View Replies !
Help With Combining Sql Statements
I'm trying to combine the following two strings to create a single Insert statement (and thus only generate one record instead of two). insertString = "Insert comments (uID) Select uID FROM users WHERE uName = @uName" insertString2 = "INSERT comments (eventID, text) VALUES ( @eventID, @comment)" I have tried: Insert comments (uID, eventID, text) SELECT uID FROM users WHERE uName = @uName VALUES (uID, @eventID, @comment) Individually they work fine, but I can't get the syntax correct to allow them to work together. As you can tell, I'm not very good with SQL, so any help would be greatly appreciated! Thanks in advance.
View Replies !
Executing Sql Statements
When i execute the following in Sql query anlyzerDeclare @dbname varchar(30),@str varchar(500),@emailID varchar(50)set @EmailID='santosh@yahoo.com'set @dbname='DB_kms_prv'set @str='SELECT empid, NTName, officialEmail, PreferredName FROM ' +@dbname + '.dbo.tblEmployee where officialEmail=' + @emailIDexec (@str)I get error messageThe column prefix 'santosh@yahoo' does not match with a table name oralias name used in the query.How to get rid of it..?
View Replies !
Combining 3 SQL Statements
Hey all. Ive got a big problem with an sql statement Im working on.There are 2 tables with a master/detail relationship. The Header Tableis the master, the Line Table is the detail. So for each Header, thereare many Lines, but a Line can only reference one Header.There is a Line Total and Line Cost in each Line Record. Each LineRecord has a type.What I want to be able to do is, for each Header, I want to Sum eachcorresponding Line's Total and Cost where the type is either one valueor another. If the type is, for example, 10, only sum the Total, if itstype 2, only sum the Cost.Therefore, after the query is executed, you should have a result setsomething like thisJob : Job1 (header id)Desc : Job0001 (header desc)Cost : (sum of Line Costs where Line Type is 2 and header id is Job1)Total : (sum of Line Totals where Line Type is 10 and header id isJob1)-----------------------------------------------------------------------------------------------------------Job : Job2 (header id)Desc : Job0002 (header desc)Cost : (sum of Line Costs where Line Type is 2 and header id is Job2)Total : (sum of Line Totals where Line Type is 10 and header id isJob2)-----------------------------------------------------------------------------------------------------------etc.Hope this makes sense. Thanks
View Replies !
How To Combine 3 SQL Statements Into 1?
I have the following 3 SQL statements that need to be combined, ifpossible. The output of one feeds the input of the next. I need to viewall of the defined output fields (the output needs to be used in aCrystal Report).The SQL Follows:/* Input is ISBN (vendor_part_number) */QUERY_1 - returns 1 recordselect p.product_id, v.name, m.description, p.author, p.title,p.revision_number, p.copyright_edition, p.vendor_part_number,p.conforming_flag,m.code, mp.unit_price_product, mm.quota_pricefrom T_PRODUCT p, T_VENDOR v, T_PRODUCT_VENDOR pv,T_MULTILIST_PRODUCT mp, T_MULTILIST m,T_MULTILIST_MEMBERSHIP mm where/* p.vendor_part_number == input */p.vendor_part_number = '0153364475' and p.medium_type ='TEXTBOOK' andp.product_id = pv.product_id and pv.type = 'CONTRACT' andpv.vendor_id = v.id andp.product_id = mp.product_id andm.code = mp.multilist_code and m.proclamation_year =mp.proclamation_yearand m.proclamation_seq_id = mp.proclamation_seq_id andm.code = mm.multilist_code and m.proclamation_year =mm.proclamation_yearand m.proclamation_seq_id = mm.proclamation_seq_id/* The above should return a single record */QUERY_2 - returns 2 recordsselect p.product_id, p.consumable, p.title, p.copyright_edition,p.vendor_part_number, p.product_type,p.item_type, p.hardware_requiredfrom T_PRODUCT p, T_PRODUCT_RELATION pr where (pr.relationship_type ='AID'or pr.relationship_type = 'KIT') andp.product_id = pr.child_product_id and pr.parent_product_id =90321/* 90321 = result from above: pr.parent_product_id = p.product_id*/QUERY_3 - returns 18 recordsselect p.product_id, p.consumable, p.title, p.copyright_edition,p.vendor_part_number, p.product_type,p.item_type, p.hardware_requiredfrom T_PRODUCT p, T_PRODUCT_RELATION pr where (pr.relationship_type ='AID'or pr.relationship_type = 'KIT') andp.product_id = pr.child_product_id and pr.parent_product_id in(90322, 90323)/* 90322, 90323 = result from QUERY_2: pr.parent_product_id =p.product_id */Only 21 records are returned from these combined queries. I need accessto all of them even though there are 3 different resultsets, 2 of whichcontain the same fields. Is there a way to simplify this into a storedprocedure or a view that can take 1 input parameter? It needs to beused in a Crystal Report, which is limited in its handling of thesetypes of complex queries.
View Replies !
Iif And Case Statements
Hi all,I have to translate an Access query into sql. The query has thefollowing statement. I know SQL doesn't support iif, so can someone tellme how to use the case statement to get the same result?select field1,IIf(Grand_total-50>0, grand_total-50, 0) AS field2,field3Thanks.*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!
View Replies !
Using SQL Case Statements HOW???
I'm trying to make a view that uses organization name from one tableand contact first and last name from another table. In the view Ihave a field that I want to show Organization followed by the maincontact. Problem is if the organization field or name field is NULLthen it doesn't show anything. If one field is empty I still want itto show the other field in the table.Example:Org1--ContactOrg2--ContactOrg3 (Still shows org even without a contact name)Contact (Still shows contact even without an org name)Tried using a CASE statement but didn't work.
View Replies !
Compound Statements
Hello,How can I stop/prevent SQL server from running compound SQLstatements. I do not want the server to run multipleupdate/delete/insert/select statements as a batch. Is there an option?/Kafwww.afiouni.com
View Replies !
Variables In SQL Statements
What am I doing wrong in the following snippet of code?-----------------------------------declare @FullPath varchar(255)set @FullPath = 'C:MyDirMyFile.txt'bulk insert Northwind.dbo.Sometablefrom @FullPathwith(FIELDTERMINATOR = ',')-----------------------------------This works when I write the path out instead of using the @FullPathvariable. I have a cursor that will Bulk Insert all files names from atable. The path will not change but the file name will. I guess I could usea system call to rename the file in use to a hardcoded name and then renameback to original name but I would like find a way to make the above conceptwork if it is possible.TIA,-p
View Replies !
Solving The ' In ASP With SQL Statements
Hi All, It's probaly still Sunday in most areas, but hope I get a quick response on this 1..... I'm doing ASP with SQL 2000. And for the moment, I write inline SQL Scripts into my ASP pages. Store procs can only come later ( don't ask why...). So as most of u will know, if any characther from the textboxes comes with a ' , everything will go haywire! Thus, I'm using this existing code to solve the prob: FAddress = Replace(FAddress, "'", "%%") Call OpenDB() SQL_query =" SET NOCOUNT ON" & _ " set DateFormat dmy" & _ " declare @FAddress varchar(100)" & _ " set @FAddress='"& FAddress &"'" & _ " set @FAddress=(replace(@FAddress,'%%',''''))" & _........and so on Is there a better way? Some problems from this is if I am inserting large info in a text datatype, I can't do it..... Some code or function that I can call and apply to my entire system without recoding alot....:) SQL and ASP jedi masters...please enlighten me.
View Replies !
Combine These Two Sql Statements
SELECT bms_id,email_address,COUNT(*) INTO #temp FROM emp_db WHERE email_address IS NOT NULL GROUP BY bms_id,email_address ORDER BY bms_id DESC,COUNT(*) DESC SELECT bms_id COUNT(*) FROM #TEMP GROUP BY bms_id ORDER BY COUNT(*) DESC How can i put these two statements into a single sql statement. Thanks.
View Replies !
Question On IF ... Then...Else Statements
Can someone please tell me if coded this correctly? I am attempting to check to see if my variable [GROUP] begins with the letter 'P'. If the variable [GROUP] begins with the letter 'P', then I wish to execute my stored procedure CLAIMS_LOGIC_PART1. If, my variable [GROUP] does not begin with the letter 'P', then I wish to execute the stored procedure CLAIMS_LOGIC_PART2. I am confused in that, I am unsure if my code below is performing exactly what I want as I described above. I think the code below is incorrect, but I am unsure how to fix it. I am new to stored procedures and SQL coding in general. I think my code below will only execute CLAIMS_LOGIC_PART1 every time. The reason I think this is because of the Exists keyword which returns True or False correct?? If that is true, then my understanding would be that the Select statement will always return True since I will always have some [GROUP] start with the letter 'P' and my second stored procedure call will never get executed. Can someone help me on this ?? Thank you so much, Rey Code: If Exists (Select [GROUP] From TBL_DATALIB_CLAIMS_TEMP Where LEFT([GROUP], 1) = 'P') Begin Exec CLAIMS_LOGIC_PART1 End Else Exec CLAIMS_LOGIC_PART2
View Replies !
Concatenating Sql Statements
I have a web application that has SQL7 as the back end. SQLServer and ORACLE have a feature that allows sql commands to be combined in one statement. Another words I am able to to SELECT * FROM table_name WHERE id = 2 DROP TABLE other_table If I type this in a query analyzer It will perform both commands. Is there a way to turn this 'feature' off. The main reason I want to turn it off is so if a numerical value is sent as a url variable someone can't add the drop table statement or any other sql command to the value of the url variable and have it executed. We have added ample code to trap for this problem but I would like to also handle it at the database level. Thanks, Jeff
View Replies !
Building Sql Statements
Hi, I am having some problems trying to build an sql statement from more than one statement. Here is the statement select 'Insert App_Column (Table_ID, Column_Type_Transformation, Column_Name, ) Values (@table_ID,' ,'NULL,', name from payatwork..syscolumns where id in ( select id from payatwork..sysobjects where name like 'Employee_Profile') order by colorder, ')' What I am finding is that the bracket at the end of the statement is not appearing - how do I append statements to the end of this sql statement (i've tried various combinations of the + sign and the comma without success. thanks, Jim
View Replies !
HELP...."OR" Conditions In SQL Statements
Folks, I'm having some real problems using the OR condition in a very simple SQL statement and could use your help or insight on where the problem lies, or perhaps a workaround. I have a large flat table in a SQL 7 database with 10 million + records called "HISTORY". I have not installed either service pack 1 or 2. I'm attempting to run a query that references the following four fields which are all non-clustered keys: EQUIPMENT_NO TEXT 12 CHASSIS_IN TEXT 12 CHASSIS TEXT 12 SVC_DATE_TIME SMALLDATETIME Here's the SQL statement: SELECT * FROM HISTORY WHERE (HISTORY.EQUIPMENT_NO = 'XYZ123' OR HISTORY.CHASSIS = 'XYZ123' OR HISTORY.CHASSIS_IN = 'XYZ123') AND SVC_DATE_TIME >= '01/15/00 00:00:00 AM' AND SVC_DATE_TIME <= '02/28/00 23:59:59 PM' ORDER BY EQUIPMENT_NO This query takes 11 min. 5 sec. inder the Query Analyzer and ultimately returns the 31 desired records. If you remove the SVC_DATE_TIME criteria, about 350 records are returned in a matter of seconds. I've also tried variations on the date syntax such as '01/15/00', etc. with no change in the amount of time to execute. Other queries such as a simple AND condition combining EQUIPMENT_NO and SVC_DATE_TIME are snappy. Are there known problems/bugs with "OR" conditions in queries that anyone is aware of, particularly with parentheses; am I composing this query incorrectly? Is there some alternate syntax that would work as expected? I can't see where the query shouldn't execute quickly as expected, particularly with all indexed fields involved. I'm stumped! Lend me your expertise. Thanks much. Clark R. Farabaugh, Jr. Financial Systems Analyst VIT Norfolk, VA
View Replies !
IIF Statements For SQL7
I'm converting some access queries to views in MSSQL7, is there any easy way to convert the iif statments used in VB on ACCESS queries to the views? This is my query that I need to convert SELECT table.br, table.ae, table.accnt, IIF(table.[type] = 'o', 'OPTION','Stock') AS Sectyp, table.[LEVEL], table.minamount, table.maxpercent, table.minshares, table.maxshares, table.cents FROM table ORDER BY table.br, table.ae, table.accnt, IIf([type] = 'o','OPTION', 'Stock'), table.[LEVEL] Of course this view does not work.. Thanks
View Replies !
|