|
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
|
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
|
What's the syntax error in the following TSQL stored procedure call?
EXEC StoredProcedureName 9,'723147504','1',CONVERT(DATETIME, '09-27-2024 14:14:28'),'calculated','','','',0,0,0,0,0,0,0,0; SSMS is telling me "Syntax error near keyword CONVERT"
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I typed it in as a Select and it worked fine. Changing it to and EXEC proc failed. Try converting the date then see.
DECLARE @DateT DateTime = Convert(DateTime, '09-09-2024 14:14:28')
EXEC StoredProcName 9,'12341239487','1', @DateT,'calculated','','','',0,0,0,0,0,0,0,0,0;
This works fine for me. Raiserror is the same way, can't cast or convert inline.
Jack of all trades, master of none, though often times better than master of one.
|
|
|
|
|
Thanks, Ron. I guess it's not a huge problem, but it is annoying!
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
|
If the parameter is typed as datetime , you shouldn't need to explicitly convert the string literal when you pass it in.
However, it would probably be best to use the unambiguous date format (yyyyMMdd ):
EXEC StoredProcedureName 9, '723147504', '1', '20240927 14:14:28', 'calculated', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0;
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I'll give this a try when I'm back in my office.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
If I give read-only access to a SQL Server login, does that mean they cannot call stored procedures that CRUD data?
What I'm looking for is the ability for users to:
1. Read the database,
2. Execute stored procedures that CRUD data.
But NOT run any DDL. Meaning they cannot change table structures or stored procedures.
I'm sure there must be a way to configure this.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
So long as the user has permission to execute the stored procedure, and the stored procedure and the tables it references have the same owner, then it will work even if the user doesn't have any permissions on the referenced tables.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks, Richard!
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Attempting to recover from the Azure disaster I downloaded the developer and then the express versions of SQL Server 22. Both failed to install because of a missing/incorrect msoledbsql. I then downloaded the dll and installed it before attempting to reinstall, it still failed on the same issue.
I tried the same with 2019 version with the same issue.
Any suggestions as to how to get around the problem?
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
|
Excellent - that resolved the issue, thanks. Now any chance you can shake a person out of Azure
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
I have discovered that in T-SQL for Sql Server 2022, if I run a stored procedure that happens to call another stored procedure that returns a result set, then the server returns both result sets to my application.
How can I, within T-SQL, specify that the result set of an embedded stored procedure call is not part of the return to the client? Is there a way to specifically choose?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
For a single resultset, you may be able to use INSERT .. EXEC to dump the resultset into a temporary table / table variable.
DECLARE @tmp TABLE ( ... );
INSERT INTO @tmp EXEC yourStoredProcedure ...; But if you control the other stored procedure, a cleaner option would be to add another parameter to suppress the output.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks, Richard. I'm frankly surprised that there's no documented way to return only specific result sets. I'll probably end up using the additional parameter to suppress output.
Cheers.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Is there any tool/solution to export the tables and then data from SQL Server to SQLite?
|
|
|
|
|
|
I know that tools, they simply don't run on my machine. They are C# apps and probably needs some net framework to install. But instead of digging to see why they are not run, I am concentrating to a reliable tool/solution (which I didn't find yet).
|
|
|
|
|
So basically, you've put as much effort into getting the tools you've found to run as you have into asking your question: ie: none.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
No, that's not true. For instance, I have installed a net framework for a C# application, but still doesn't run, so, what can I do? To find out why that application is not working?
modified 25-Jul-24 5:17am.
|
|
|
|
|
_Flaviu wrote: No, that's not true.
I suggest you re-read your own messages, remembering that nobody here can see your screen, access your computer, or read your mind. Do you really think you've put enough effort into describing the problem(s) you're having for someone to be able to help you?
From my perspective, your thread so far reads as:
Summary: I want a tool to do «x».
I've tried some tools - I won't tell you which - and none of them worked, probably because I didn't read the system requirements or install the prerequisites.
Rather than trying to fix the errors, or tell you what the errors are and ask for help with fixing them, I've added those tools to a secret shitlist of "unreliable tools".
I now demand that someone provide me with a tool that isn't on my secret shitlist - and no, I won't tell you what's on it! - that works first time, with zero effort on my part.
Remember, the effort someone is going to put into answering your question is directly related to the effort you put into asking it. If we have to keep dragging tiny snippets of information out of you in dribs and drabs, then why should we bother trying to help?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
I have succeeded to migrate a table from SQL Server by importing it the table to Excel, and from Excel sheet to SQLite using Python. The relations between tables I guess I should do it manually.
|
|
|
|
|