Is it possible to do in one statement?
I have a sp where I am passing 2 param:
@lastName and @ID. Some times ID can be empty and I
need to select based on lastname, if Id is not empty select
spesific record. My 'or' and 'And' is not working correct.
Can you help me?
SELECT *
FROM Table1...
I have the following code in my sp where I am passing the param:
select count(*) as Voided from Table1 where groupNumber=@GroupID and status='V'
select count(*) as Active from Table1 where groupNumber=@GroupID and status='A'
I wanted to display this way when the sp exec:
Voided x
Active y
Is...
Here is my query.
SELECT *
FROM OPENQUERY(LinkedServer, 'SELECT * from LinkedServer.test.dbo.Table1 where name=''test''' )
Still have this issue:
Server: Msg 18452, Level 14, State 1, Line 1
Login failed for user 'server\sqlexec'. Reason: Not associated with a trusted SQL Server connection.
I have a link server set, however when I am trying to see the tables in that server I get that error:
Login failed for user 'net\sqlexec'. Reason: Not associated with a trusted SQL Server connection.
I do have appopriate permission. The problem exists only when I run query from my desktop(query analyzer). However when I run the same qeury on a server (using my user id) it is running fine.
Thanks
I am getting this error after I change to be a correct syntax
Server: Msg 18452, Level 14, State 1, Line 1
Login failed for user 'net\sqlexec'. Reason: Not associated with a trusted SQL Server connection.
here is basic OPENQUERY statement, however if I use where close with conditional statement
syntax is incorrect. How do I fix this issue?
SELECT *
FROM OPENQUERY(IMGSPE, 'SELECT * from table1)
My query:
SELECT *
FROM OPENQUERY(IMGSPE, 'SELECT * from table1 where name='test'' )
Here is my statement, however it is not working.
if exists (select * from dbo.sysobjects where id = object_id(N'[prov].[dbo].[Prov]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [prov].[dbo].[Prov]
From a sp in database1 I need to drop a table in database2.
How do I do this? Right now my statement can't see that table located in different db.
drop table [dbo].[table]
I have 2 connection (conn1 and conn2) to the different sources.
I need to do the following logic:
1. Select data from conn1 based on pk
2.Compare the data to the data in conn2 based on pl
3.If data exists in conn2 update conn1 based on pk
Please help me with the task I should use in order to do...
I have the following statement in my module.
For some reason (I can't understand...) it is running on one pc but not running on the other.
I am getting an error about format function. Can you help me please....
qdf.SQL = "SELECT CVSSN, CVGRP, CVLOC, Format(CVLECY, '00') & Format(CVLEYR...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.