How to determine SQL Server stored procedure parmeters at run time in .NET?
Is there any way for an application to determine the parameters and paramter types of a stored procedure at run time? ...
Is there any way for an application to determine the parameters and paramter types of a stored procedure at run time? ...
I have a postgres table like this: CREATE SEQUENCE seq; CREATE TABLE tbl (id INTEGER DEFAULT VALUE nextval('seq'), data VARCHAR); When I insert into the table: INSERT INTO tbl (data) VALUES ('something'); How can I get back the value of the id field for the record I just created? (Note, I may have got some of the SQL syntax a bit ...
I am doing a multiple insert in vba access query as below: Private Sub btnSubmit_Enter() DoCmd.RunSQL ("insert into tblAutonumber (Dummy)values ('DummyValue')") Dim lastAutonumber As Long lastAutonumber = DMax("Autonumber", "tblAutonumber") txtAutoNumber.Value = lastAutonumber DoCmd.RunSQL ("insert into tbltesting " & _ "(Empid, Te...
I am trying to call a stored procedure over a database link. The code looks something like this: declare symbol_cursor package_name.record_cursor; symbol_record package_name.record_name; begin symbol_cursor := package_name.function_name('argument'); loop fetch symbol_cursor into symbol_record; exit w...
I have this working SQL statement: select oriseqs.newID from oriseqs WHERE oriseqs.singlets=1 AND oriseqs.newID not in (select newID from cleanreport WHERE trash!="") My question is how to avoid doing one select inside another in this particular case. I mean to rewrite the select statement in a way that there is no nested select. He...
Hi, I have a Query that's supposed to run like this - If(var = xyz) SELECT col1, col2 ELSE IF(var = zyx) SELECT col2, col3 ELSE SELECT col7,col8 FROM . . . How do I achieve this in T-SQL without writing separate queries for each clause? Currently I'm running it as IF (var = xyz) { Query1 } ELSE IF (var = zyx) { ...
I have a query that returns data in the following form attribute value --------- ---------- petid 1000 name buttercup species cat age 10 owner Bob Dole Basically I want to go through every row and return the fields name and species in a single string, so here the result wou...
The site I am working with has a somewhat convoluted way with dealing with users and permissions. These are the user types: User Facility Approver Facility Admin Corporate Approver Corporate Admin Now there are also facilities, and that is where these permission levels come into play. Facilities are linked to users and user levels ...
I just added a new column in my DB which I need to propagate with a specific text value (Confirmed). Is there a simple way to apply to all my data entries so I don't have to go through all my rows and type the value in? Thanks ...
Does anyone know why a SQL SELECT query returns no rows when SELECTing from an empty table, but when trying to SELECT the AVG from a column in an empty table it returns < null >? The difference in behavior just seems odd to me. I’m using a sqlite database if that makes any difference. Here are the two queries: Normal select: SELECT ...
Hello, i've looking for an IDE for MySQL with intellisense, which would help a lot. Any suggestions? Thanks! ...
I want to efficiently check if a table contains any rows that match <condition A> and do not match <condition B>, where the conditions are arbitrary. In Oracle, this almost works: select count(*) from dual where exists ( select * from people where (<condition A>) and not (<condition B>) ); -- returns zero if all rows that match <...
I have the following SQL which I am trying to translate to LINQ: SELECT f.value FROM period as p LEFT OUTER JOIN facts AS f ON p.id = f.periodid AND f.otherid = 17 WHERE p.companyid = 100 I have seen the typical implementation of the left outer join (ie. into x from y in x.DefaultIfEmpty() etc.) but am unsure how to introduce the oth...
I know the syntax: ALTER TABLE [TheTable] DROP CONSTRAINT [TheDefaultConstraint] but how to I drop the default constraint when I don't know its name? (That is, it was autogenerated at CREATE TABLE time.) ...
I have a table in my database that has 1.1MM records. I have another table in my database that has about 2000 records under the field name, "NAME". What I want to do is do a search from Table 1 using the smaller table and pull the records where they match the smaller tables record. For example Table 1 has First Name, Last Name. Table 2 h...
I am developing a vba form for employee database, in that there is a search criteria for userid and employees name with the userid should be displayed in a list box control which comes from a single table I need to populate a list box with value from a table according to a value in a text box which act as a search box (eg: userid) Plea...
I need to populate the access form list box from a access table. Below is the code which I copy-pasted on button click event: Public Sub PopulateLBWithData(DBPath As String, _ TableName As String, FieldName As String, _ oListControl As Object,Optional Distinct As Boolean = False, _ Optional OrderBy As String) ''#PURPOSE: Populate a l...
can we use packages in ms sql server 2008...i m new to sql server ... if yes how it can be created and used.... ...
Below is the code to fill a list box in a VBA application : Private Sub Form_Open(Cancel As Integer) ''#Populate list box control. Dim cnn As ADODB.Connection Dim strSQL As String Dim rst As ADODB.Recordset Dim strList As String On Error GoTo ErrHandler ''#Use DSN to Northwind. ''#Modify connection and connection str...
Hi again, Suppose i have > ID FromDate ToDate > -- -------- ------- > 1 01/01/2005 30/6/2007 > 2 01/01/2008 31/12/2009 I want to count the years that are included on this 2 rows. Here is 1,5 years for the first row + 2 years from second row = To...