I need to create flat file connection managers. The connection Manager editor forces me to use fully qualified file names. Is there a possibility to use unqualified file names, because I need to reference to files in different directories with the identical file strcture.
I have a database that has been upgraded from SQL 200 to 2005. The database was owned by 'Joe' and all objects were also owned by 'Joe'. In SQL 2000 when Joe logged in he could simply issue 'select * from table' and would get results.
The upgraded db now has a user Joe and a schema Joe. All objects now belong to the schema Joe. Joe the user has his default schema set to Joe and he is the owner of the schema. When Joe logs in and tries to 'select * from table' he gets an invalid object. He can 'select * from joe.table'.
How can I set it up so that the objects are still owned by the schema Joe and a simple 'select * from table' works when user Joe logs in? I was convinced that is he owned the schema and this was his default schema it should work.
Why am im i getting this error I am trying to join four table from different databases.select INBTable.InBound_Calls, OUTTable.OutBound_Calls, INBTable.Line_Number as INLine_Number, OUTTable.Line_Number as OUTLine_Number, INBTable.Hold_Time as INHold_Time,OUTTable.Hold_Time as OUTHold_Time, INBAbandonInfo.INAbandon_Calls as INBAbandon_Calls, OUTAbandonInfo.OutAbandon_Calls as OUTAbandon_Callsfrom sql2.XMWin_Test.dbo.temp_Report20070807IN as INBTable JOIN sql2.Juniper_I.dbo.temp_Report20070807OUT as OUTTableon INBTable.Line_Number = OUTTable.Line_Number sql2.XMWin_Test.dbo.temp_GraphIN_INAbandon as INBAbandonInfoJOIN sql2.Juniper_I.dbo.temp_GraphIN_OutAbandon.Line_Number as OUTAbandonInfo on INBAbandonInfo.Line_Number = OUTAbandonInfo.Line_Number My Error Message: Msg 170, Level 15, State 1, Line 8 Line 8: Incorrect syntax near 'sql2'.
Are there any perfmonace or query optimization limitations or issues that arise when issueing a fully qualified query across multiple databases on the same Instance of SQL Server. In other words are all features of query optimization fully supported in queries that span databases on the same Instance.
I wihsh to discuss whether to use fully qualified names:[database].[schema].objectof objects to operate (create, query..) on is good or not?If someone change order of sql code blocks in my script - this may causelose of it's context (like: use master / use <mydb>..). I wish to have mysript independed on changes like this and always produce correct result.Does using full name make use of 'use <db>' statement unnecessary?
Our team has a DBA governing body that refuses to accept any T-SQL script that our dev group writes where fully qualified names of the objects aren't used. These non fully named objects in scripts just aren't accepted in their world.
So, all the scripts the developers now have to write must have fully qualified names in them. Of course, the Query analyser in Managment Studio could care less about object names as long as ambiguity is not found. So, I need some sort of Static Code analysis of these scripts that my team creates in order to hand them over to our DBA's to run.
The DBA's intend to make this inspection a manual process (they have time to kill I guess)... but my team doesn't have that luxury. It is not easy to ensure all scripts have this qualification in them with some many of them being written.
Does anyone know of any algorithim, tool, or options that could help me detect the presence of non-fully qualified names in T-SQL scripts?
The command sqlcmd seems to fail when using trusted connection and an IP address or a fully qualified hostname. For example:
sqlcmd -E -S nnn.nnn.nnn.nnn
where nnn.nnn.nnn.nnn is the real IP address of the machine, or
sqlcmd -E -S hostname.domain.com
where hostname.domain.com is the fully qualified hostname of the machine, gives the error:
Msg 18452, Level 14, State 1, Server 380GX280B05, Line 1 Login failed for user ''. The user is not associated with a trusted SQL Server c onnection.
On the other hand, sqlcmd -E -S 127.0.0.1 works, and so does sqlcmd -E -S hostname, or sqlcmd -E -S tcp:hostname,1433.
This is on a clean machine, with SQL Server 2005 freshly installed as Administrator with mixed authentication, and the test runned also by Administrator.
The command sqlcmd seems to fail when using trusted connection and an IP address or a fully qualified hostname. For example:
sqlcmd -E -S nnn.nnn.nnn.nnn
where nnn.nnn.nnn.nnn is the real IP address of the machine, or
sqlcmd -E -S hostname.domain.com
where hostname.domain.com is the fully qualified hostname of the machine, gives the error:
Msg 18452, Level 14, State 1, Server 380GX280B05, Line 1 Login failed for user ''. The user is not associated with a trusted SQL Server c onnection.
On the other hand, sqlcmd -E -S 127.0.0.1 works, and so does sqlcmd -E -S hostname, or sqlcmd -E -S tcp:hostname,1433.
This is on a clean machine, with SQL Server 2005 freshly installed as Administrator with mixed authentication, and the test runned also by Administrator.
I had been trying to solve this error with no success :
One or more of the server network addresses lacks a fully qualified domain name (FQDN). Specify the FQDN for each server, and click Start Mirroring again.
The syntax for a fully-qualified TCP address is: TCP://<computer_name>.<domain_segment>[.<domain_segment>]:<port>
I had installed three instances on my local machine to test Data base mirroring :
Principal : running SQL Developer Instance
Mirror : running SQL Developer Instance .
Witness : Running SQL Express.
Database mirroring already enabled using startup flag : -T1400
i even tried to configure it with out a witness but still have the same error .
I used the follwoing server name in the mirroring wizard(not localhost) :
How to identify your SQL Server version and edition http://support.microsoft.com/kb/321185/
How to obtain the latest SQL Server 2000 service pack http://support.microsoft.com/?kbid=290211
Service Pack 4 for Microsoft SQL Server 2000 http://download.microsoft.com/download/1/B/D/1BDF5B78-584E-4DE0-B36F-C44E06B0D2A3/ReadmeSql2k32desksp4.htm#_1461463_hardware_and_software_requiremen_fzpy
Cumulative list of the hotfixes that are available for SQL Server 2000 SP4 http://support.microsoft.com/?kbid=894905
A cumulative hotfix package is available for SQL Server 2000 Service Pack 4 build 2187 http://support.microsoft.com/?kbid=916287
Which appears to indicate 8.00.760 = sp3/sp3a 8.00.2039 = sp4 8.00.2187 = Cumulative rollup 8.00.2249 Final patch build number
I still have the following question which i would very much appreciate help in answering: If support is required from Microsft what is the acceptable level of SQL Server patching before Microsoft will agree to look at a SQL Server problem. ? SP4 Build 2039 + Build 2040 (awe fix) SP4 Build 2187 cumulative rollup SP4 Build 2249 fully patched as per KB894905 Do I need to apply builds 2187 to 2249 ? If so where/how can I obtain the down loads from ( 8.00.2187 - 8.00.2249) ?
Have logged a call with microsoft support but as yet no responce.
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.
I have a quick question on how to qualify table names as it relates to"dbo" vs. user names. Suppose that I am a user named "dwuser1", andthat I need to create a table named "dw_stage_1". Do I use dbo as in"dbo.dw_stage_1" or do I use "dwuser1.dw_stage_1" for the qualifiedtable name? Are both OK? If so, what would be the implications ofeach?
I need to dynamically create a ADO.NET connection manger
so, my question is if it is safe to create it with the string that is generated (ConnectionManagerType) when creating the connection manager manually on my PC.
I understood that this string is the full qualified name of the assembly, so will it be different when I create it on another P.C or it is fixed on all P.Cs ?
Im trying to write a generic data access layer that supports SQL CE and Im wondering if any type of schema qualifier can be placed in front of a table name when executing a sql statement.
I've tried soemthing like this
select * from dbo.Account
I get this error,
The table name is not valid. [ Token line number (if known) = 1,Token line offset (if known) = 19,Table name = account ]
It doesnt make really make sense to include a qualifier for sql ce but I just wanted to make sure that there wasnt some other syntax that I wasnt aware of.
I am trying to populate a GridView from a stored procedure. The stored procedure's schema name is not the same as the user id logged into the database. In the SqlDataSource wizard, I am able to select the stored procedure name (unqualified), but Test SQL fails: "Could not find stored procedure 'devSelLineOverview'." Running the page also fails with the same error.Well, of course, because the procedure name must be qualified as line16l2.devSelLineOverview. However, the wizard doesn't pick up the schema name and I'm unable to change it there. So I changed it in the page source, but then I get this error: "Invalid object name 'line16l2.devSelLineOverview'." I tried changing the command type to custom SQL statement (not a stored procedure) but that deleted all the select parameters. Here is the data source, with the qualified name. I've also tried [line16l2.devSelLineOverview] (Could not find stored procedure) and [line16l2].[devSelLineOverview] (Invalid object name).<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:PlantMetricsConnectionString %>"SelectCommand="line16l2.devSelLineOverview" SelectCommandType="StoredProcedure"><SelectParameters><asp:ControlParameter ControlID="date" Name="date" PropertyName="Text" Type="DateTime" /><asp:ControlParameter ControlID="shift" Name="shift" PropertyName="SelectedValue"Type="Byte" /><asp:ControlParameter ControlID="SKU" Name="sku" PropertyName="Text" Type="String" /><asp:ControlParameter ControlID="Lot" Name="lot" PropertyName="Text" Type="String" /></SelectParameters></asp:SqlDataSource>Thanks,Stephanie Giovannini
I have a schema XXX. This schema owns a set of tables say XXX.A, XXX.B and XXX.C.
I have a login XXX mapped to the user XXX.
When I connect to the SQL Server using login XXX and execute the query.
Select * from A, it throws be an error saying that"Invalid Object Name A".
Now when I modify the select statement specifying the schema it works. i.e. Select * from XXX.A
In the former case, is it not that SQL Server tries to search for the table in the current user's account and then if it not available it look's in the dbo's account.
HOw can I make a select without specifying the schema ?
We have a server running Windows Server 2003 with SQL Server 2005, it also does some minor file-sharing usage. I noticed that the over 3/4 of our 2GB of RAM was being used by SQL and the pagefile was over 1.5GB constantly. Needless to say this caused performance issues, so I upgraded to 4 GB of RAM. However it would seem that nothing has changed. The same amount of RAM is being committed to SQL resulting in the same size pagefile and 2GB of unused memory. Should my Windows Processor Scheduling and Memory Usage be set to Programs or Background Services/System Cache for best performance and best usage of memory with SQL server? Also when I look at the MS SQL server properties, what should these settings be for best performance and memory usage as they are currently set to: NOT use AWE to allocate memory 0MB - minimum server memory 2147483647MB - maximum server memory 0KB - Index creation memory 1024KB - minimum memory per query
Any help with this problem would be greatly appreciated.
Having sucessfully tested mirroring, I've suggested we should implement it at my place of work.
However, they are non too pleased that it is not yet officialy part of SQL Server 2005 and therefore not supported, does anyone know when it will be in standard edition? because I really really need to know...
SQL BPA says the following:"One or more objects are referencing tables/views withoutspecifying a schema! Performance and predictability of theapplication may be improved by specifying schema names.""When SQL Server looks up a table/view without a schemaqualification, it first searches the default schema and then the'dbo' schema. The default schema corresponds to the currentuser for ad-hoc batches, and corresponds to the schema of astored procedure when inside one. In either case, SQL Serverincurs an additional runtime cost to verify schema binding ofunqualified objects. Applications are more maintainable andmay observe a slight performance improvement if objectreferences are schema qualified."How important is to specify the schame (dbo. in my case) instored procedures? Will it really improve performance if I goand fix each object that is missing "dbo."?The problem is I have thousands and thousands of themwith no schemas. Before I invest a lot of time fixing themI am trying to determine if it's really worth it or not?Thank you
Hi all, i have a table1 with 3,25,000 records in US database.i want to upadate this table information in to table2 in SG database based on some condition (if prodid and skuno match in both tables, then update ordertransferind column in table2 from table1) what is happening is after 10,000 records query is not executing. in status bar it is displaying 'done'. but only 10,000 records are updating not the remaining ones. for this 10,000 records also it is taking more than 1 hour time. i tried by incresing the commandTimeout to max value(99999)...but still it is same...any advise...please suggest... i am using sql2005,visualstudio 2005.... thanks for the help..
I have been trying to formulate a fully editabe datagrid for a couple of days with no luck. I have used code from 4guys and some other sites and am at the point where I can render the datagrid correctly (as a bouncolumn and template column-textbox) but when I try to update the database it all falls apart. I am getting "input string was not in a correct format" and the error references ...Dim id as Integer = Convert.ToInt32(sls.DataKeys(dgi.ItemIndex))I suspect the problem lies in the area of primary indexes and such. The table I am using is a simple two-column table with usernames, passwords. Username is the primary field. Here is the actual code I am using...<code><%@ Page Explicit="True" Language="VB" Debug="True" %><%@ Import Namespace="System.Data" %><%@ Import Namespace="System.Data.OleDb" %><html> <script runat="server">Dim Connect As OleDbConnection = New OleDbConnectionDim Adapter As OleDbDataAdapter = New OleDbDataAdapterDim DS As DataSet = New DataSetDim ConnectString, SelectStatement As String Sub Page_Load(Sender As Object, E As EventArgs) If Not IsPostBack Then SelectStatement = "Select * From Table"ConnectString = "Provider=SQLOLEDB;UID=;PWD=;" & "Data Source=;Initial Catalog=;" Connect.ConnectionString = ConnectStringAdapter.SelectCommand = New oleDbCommand(SelectStatement, Connect)Adapter.SelectCommand.Connection.OpenAdapter.Fill(DS, "Items")sls.Datasource = DS.Tables("Items")Page.DatabindConnect.Close()End IfEnd Sub Sub Click(sender As Object, e As EventArgs) Dim myConnection as New OleDbConnection(ConnectString)Dim updateSQL as String = "UPDATE Table SET password = @Password WHERE Username = @ID"Dim myCommand as New oleDbCommand(updateSQL, myConnection) Dim dgi as DataGridItemFor Each dgi in sls.Items 'Read in the Primary Key Field Dim id as Integer = Convert.ToInt32(sls.DataKeys(dgi.ItemIndex)) Dim password as String = CType(dgi.FindControl("txtPass"), TextBox).Text 'Issue an UPDATE statement... myCommand.Parameters.Clear() myCommand.Parameters.Add("@ID", id) myCommand.Parameters.Add("@Password", password) myCommand.ExecuteNonQuery()Next End Sub </script><body><form runat="Server"> <asp:datagrid id="sls" runat="server" AutoGenerateColumns="False" datakeyfield="Username"> <Columns> <asp:BoundColumn HeaderText="UserName" datafield="Username"/> <asp:TemplateColumn HeaderText="Password"> <ItemTemplate> <asp:TextBox runat="server" id="txtPass" Columns="10" Text='<%# DataBinder.Eval(Container, "DataItem.Password") %>' /> </ItemTemplate> </asp:TemplateColumn> </Columns> </asp:datagrid><asp:button id="Update" text="Update All" runat="Server" onclick="Click"/></form></body></html></code>Anyone have any idea as to why the id variable (error message above) is causing problems?
I know that you can fully qualify a database and dbo in a statement, but is it possible to do this for different servers? For example, if you have three different servers registered in Enterprise Manager, can you write a script that could query any of the three servers?
I am managing a number of SQL Server 6.5 systems via lan and wan connections. I have a couple of servers which, althought I have an administrator account on the server and access through the fire walls, I can only connect if I set up entries under the client config utility using named pipes with the relevant ip address. The servers are set up to use both tcp/ip and named pipes. When I do connect I dont get the traffic lights, and Service manager shows the servers in indeterminate state although I know they are running OK. When I expand the server in EM, the SQL Executive also does not appear, again the service is running. I am connecting to the server as sa, and can perform all sa functions. I have connected to the server through security manager and it shows me as an administrator with sa rights. We are using standard security on these servers.
I downloaded the windows installer: SQLServerCE31-EN.msi
When I run it, it creates a directory in Program Files The directory has a number of dll files, a Readme file, a word document, and a text document. There is no link to actually launch SQLServer though. I've tried repairing, and removing and reinstalling but the results are the same. Can someone help me figure out how to actually launch this application?
All: I have about 35 packages in a SSIS Project and have been successful at building and deploying until now. For some reason it build stops processing after 5 packages and does not update the bindeployment folder.
Are there any logs to which I can refer to find out what is going on? Any ideas why I am experiencing this weird behavior all of a sudden.
I had to delete a couple of packages from my project as I created new replacements for them. I then noticed however that the packages did not get deleted from the bin and deployment folders and so I manually deleted them from those directories. Could this cause any problems and if so can I fix it now?
Basically I'm trying to produce a report that shows qualified employees for each program. Each employee can possess many qualifications. There will be no programID parameter submitted by the user. I just want to produce the report which shows the programs and the qualified employees for each. I thought I had a query that was working but once I added a different ProgramID into the ProgramModules table things went south.
Here are my tables:
tblEmployees (table of employees) - EmployeeID - EmployeeName
tblQualifications (table of qualifications) - Qualification_ID - QualificationTitle
tblEmployeeQualification (table of all employees qualifications) -EmpQualificationID -EmployeeID (fk for tblEmployees) -QualificationID (fk for tblQualifications)
tblPrograms (table of programs) -ProgramID -ProgramTitle
tblProgramModules (table of qualifications required by each program) -ProgramModuleID -ProgramID (fk for tblPrograms) -QualificationID (fk for tblQualifications)
Here is the query I was working with that works when there are only records in the ProgramModules table that use the same ProgramID
We have a flat file import proces which imports data from a series of unicode flat files.
The files have text qualifiers and are being imported to a table with the following format: CREATE TABLE [dsa].[OBS]( [Kundenummer] [nvarchar](10) NULL, [Navn] [nvarchar](60) NULL, [Adresse] [nvarchar](50) NULL, [PostnrBynavn] [nvarchar](50) NULL, [Kursusdato] [datetime] NULL, [Varighed] [decimal](18, 2) NULL, [Kursustype] [nvarchar](100) NULL, [Risikokoder] [nvarchar](50) NULL ) ON [PRIMARY]
In one of our files we have two rows that looks like this: "19298529";"THIS IS ROW 1";"ADDRESS 9 -13";"4200 SLAGELSE";"02-05-2006";8.00;"Kombikursus Førstehjælp - Brand 8 lek.";"37" "19448242";"THIS IS ROW 2";"ADDRESS 50";"4140 BORUP";"04-05-2006";4.00;""Fra vil selv - til kan selv". Om børn 1½ - 3 Ã¥r";"22"
Both rows are OK according to the format, but the second row actually contains the text qualifier in one of the qualified fields (""Fra vil selv - til kan selv". Om børn 1½ - 3 Ã¥r"). It's the title of a course with a comment. The proces fails on this file, and wont even redirect the row, as it does on other erroneous rows in other files we import.
We believe this is a valid text, but apparently SSIS doesn't Is this a bug or is this record not allowed? Is there a work around, and why wont SSIS redirect the row?
We believe the reason is that the field before is not text quaified (which is of course specified in the connection manager).
my where clause.. is similar to.'where Contains(Word, ''formsof(thesaurus,"'+@curWord+'") OR "'+@curWord+'*"'')'When i pass in Multi-Lan, i get results for Multi-LAN and MultiLAN.. however.. when i pass in Multilan.. i dont get results for Multilan nor Multi-lan.I have double checked my formats, and i have checked to see if this word was used in a previous expansion set.. everything checked out. Â I also have many other expansions that function without issue. BT and Bluetooth are interchangeable.
I have a database that is released as part of a thrid party product. I sent out an update but it failed at one of the customer sites because the objects were not fully quailified. The original statement work at all but one of the sites. The altered statement is what finally worked. The SQL Server instances are installation and configuration are controlled by our interface so all instances are installed and configured the same. Any idea on how this would happen? It has never happened on previous updates.
Original Statement: SELECT * FROM tblProcesses WHERE ProcessName='Name' IF @@ROWCOUNT=0 INSERT INTO tblProcesses(ProcessName, GroupTypeID, ProcessDesc) VALUES('Name', 1, 'Description') GO
Altered Statement: SELECT * FROM dbname.dbo.tblProcesses WHERE tblProcesses.ProcessName='Name' IF @@ROWCOUNT=0 INSERT INTO tblProcesses(ProcessName, GroupTypeID, ProcessDesc) VALUES('Name', 1, 'Description') GO
We've set up a report farm with two servers, both 64 bit with 4 CPUs each. One has 16Gig and the other 8Gig of memory. We're using Windows NLB and the load test software confirms that the NLB is working. When we run a number of concurrent reports, both servers get utilized, but they only work on a few at a time. The report server queue doesn't seem to be fully utilizing the hardware. From a prior post I've learned that the report server queue automatically runs 4 reports per CPU. This is not occuring for our setup. Has anyone else experienced the same? Are there any configurations that need to be set to open the queue up? The reports are heavy (300,000 records grouped and summed). Does this affect the queuing process?